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();
 }
Ejemplo n.º 3
0
  public Vector getChildren(Object parent) {
    if (!(parent instanceof MClass)) return null;
    Vector res = new Vector();
    Vector ends = new Vector(((MClass)parent).getAssociationEnds());
    if (ends == null) return null;
    java.util.Enumeration enum = ends.elements();
    while (enum.hasMoreElements()) {
      MAssociationEnd ae = (MAssociationEnd) enum.nextElement();
      MAssociation asc = ae.getAssociation();
      Vector allEnds = new Vector( asc.getConnections());
      MAssociationEnd otherEnd = null;
      if (ae == allEnds.elementAt(0))
	otherEnd = (MAssociationEnd) allEnds.elementAt(1);
      if (ae == allEnds.elementAt(1))
	otherEnd = (MAssociationEnd) allEnds.elementAt(0);
      if (otherEnd == null) continue;
      if (!otherEnd.isNavigable()) continue;
      if (res.contains(otherEnd.getType())) continue;
      res.addElement(otherEnd.getType());
      // needs-more-work: handle n-way Associations
    }
    return res;
  }
Ejemplo n.º 4
0
 public Vector getPrereqs() {
   Vector pros = new Vector();
   pros.addElement(MClassifier.class);
   return pros;
 }