public void setNode(Vector figures) {
   int size = figures.size();
   if (figures != null && (size > 0)) {
     for (int i = 0; i < size; i++) {
       Object o = figures.elementAt(i);
       if (o instanceof FigComponentInstance) {
         FigComponentInstance figcomp = (FigComponentInstance) o;
         figcomp.setEnclosingFig(this);
       }
     }
   }
 }
 public Vector rowObjectsFor(Object t) {
   if (!(t instanceof UMLDeploymentDiagram)) return new Vector();
   UMLDeploymentDiagram d = (UMLDeploymentDiagram) t;
   Vector edges = d.getEdges();
   Vector res = new Vector();
   int size = edges.size();
   for (int i = 0; i < size; i++) {
     Object edge = edges.elementAt(i);
     if (edge instanceof MDependencyImpl) res.addElement(edge);
   }
   return res;
 }
 public java.util.Enumeration gen(Object o) {
   MClass c = (MClass) o;
   Vector specs = new Vector(c.getSpecializations());
   if (specs == null) {
     return EnumerationEmpty.theInstance();
   }
   // TODO: it would be nice to have a EnumerationXform
   // and a Functor object in uci.util
   Vector specClasses = new Vector(specs.size());
   java.util.Enumeration enum = specs.elements();
   while (enum.hasMoreElements()) {
     MGeneralization g = (MGeneralization) enum.nextElement();
     MGeneralizableElement ge = g.getChild();
     // assert: ge != null
     if (ge != null) specClasses.addElement(ge);
   }
   return specClasses.elements();
 }
 public int getChildCount(Object parent) {
   Vector children = getChildren(parent);
   if (children != null) return children.size();
   return 0;
 }
  public void setEnclosingFig(Fig encloser) {

    if (encloser != null && encloser.getOwner() instanceof MNodeInstance && getOwner() != null) {
      MNodeInstance node = (MNodeInstance) encloser.getOwner();
      MComponentInstance comp = (MComponentInstance) getOwner();
      if (comp.getNodeInstance() != node) {
        comp.setNodeInstance(node);
      }
      super.setEnclosingFig(encloser);

      Vector figures = getEnclosedFigs();

      if (getLayer() != null) {
        // elementOrdering(figures);
        Vector contents = getLayer().getContents();
        int contentsSize = contents.size();
        for (int j = 0; j < contentsSize; j++) {
          Object o = contents.elementAt(j);
          if (o instanceof FigEdgeModelElement) {
            FigEdgeModelElement figedge = (FigEdgeModelElement) o;
            figedge.getLayer().bringToFront(figedge);
          }
        }
      }
    } else if (encloser == null && getEnclosingFig() != null) {
      if (getEnclosingFig() instanceof FigNodeModelElement)
        ((FigNodeModelElement) getEnclosingFig()).getEnclosedFigs().removeElement(this);
      _encloser = null;
    }
    /*
    super.setEnclosingFig(encloser);

    Vector figures = getEnclosedFigs();

    if (getLayer() != null) {
      // elementOrdering(figures);
      Vector contents = getLayer().getContents();
      int contentsSize = contents.size();
      for (int j=0; j<contentsSize; j++) {
        Object o = contents.elementAt(j);
        if (o instanceof FigEdgeModelElement) {
          FigEdgeModelElement figedge = (FigEdgeModelElement) o;
          figedge.getLayer().bringToFront(figedge);
        }
      }
    }

    if (!(getOwner() instanceof MModelElement)) return;
    if (getOwner() instanceof MComponentInstance) {
      MComponentInstance me = (MComponentInstance) getOwner();
      MNodeInstance mnode = null;

      if (encloser != null && (encloser.getOwner() instanceof MNodeInstance)) {
        mnode = (MNodeInstance) encloser.getOwner();
      }
      if (encloser != null && (encloser.getOwner() instanceof MComponentInstance)) {
        MComponentInstance comp = (MComponentInstance) encloser.getOwner();
        mnode = (MNodeInstance) comp.getNodeInstance();
      }
      try {
        if(mnode != null) {
          me.setNodeInstance(mnode);
        }
        else {
          if (me.getNodeInstance() != null) {
            me.setNodeInstance(null);
          }
        }
        setNode(figures);
      }
      catch (Exception e) {
        cat.error("could not set package", e);

      }
    }
    */
  }