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;
 }
Example #2
0
 /**
  * If there are deps that are going from inside a FigComponent to inside a FigComponentInstance
  * the returned vector-set is not null. Then in the vector-set are the UMLDeploymentDiagram and
  * all FigDependencies with this characteristic and their FigObjects described over the supplier
  * and client.
  *
  * @param dd the diagram to check
  * @return the set of offenders
  */
 public ListSet computeOffenders(UMLDeploymentDiagram dd) {
   Collection figs = dd.getLayer().getContents();
   ListSet offs = null;
   for (Object obj : figs) {
     if (!(obj instanceof FigDependency)) {
       continue;
     }
     FigDependency figDependency = (FigDependency) obj;
     if (!(Model.getFacade().isADependency(figDependency.getOwner()))) {
       continue;
     }
     Object dependency = figDependency.getOwner();
     Collection suppliers = Model.getFacade().getSuppliers(dependency);
     int count = 0;
     if (suppliers != null) {
       for (Object moe : suppliers) {
         if (Model.getFacade().isAObject(moe)) {
           Object objSup = moe;
           if (Model.getFacade().getElementResidences(objSup) != null
               && (Model.getFacade().getElementResidences(objSup).size() > 0)) {
             count += 2;
           }
           if (Model.getFacade().getComponentInstance(objSup) != null) {
             count++;
           }
         }
       }
     }
     Collection clients = Model.getFacade().getClients(dependency);
     if (clients != null && (clients.size() > 0)) {
       for (Object moe : clients) {
         if (Model.getFacade().isAObject(moe)) {
           Object objCli = moe;
           if (Model.getFacade().getElementResidences(objCli) != null
               && (Model.getFacade().getElementResidences(objCli).size() > 0)) {
             count += 2;
           }
           if (Model.getFacade().getComponentInstance(objCli) != null) {
             count++;
           }
         }
       }
     }
     if (count == 3) {
       if (offs == null) {
         offs = new ListSet();
         offs.add(dd);
       }
       offs.add(figDependency);
       offs.add(figDependency.getSourcePortFig());
       offs.add(figDependency.getDestPortFig());
     }
   }
   return offs;
 }
    public CopyAction(UMLDeploymentDiagram d) {

      super(MComponentInstanceImpl.class, d.getName());
      diagram = d;
      ProjectBrowser pb = ProjectBrowser.TheInstance;
      Object target = pb.getDetailsTarget();
      if (target instanceof MClass) {
        orig = (MClass) target;

        System.err.println("--------------------------------" + target.getClass());
      }
    }
 /**
  * If there are interfaces that are not inside a component the returned ListSet is not null. Then
  * in the ListSet are the UMLDeploymentDiagram and all FigInterfaces with no enclosing
  * FigComponent
  *
  * @param dd the diagram to check
  * @return the set of offenders
  */
 public ListSet computeOffenders(UMLDeploymentDiagram dd) {
   Collection figs = dd.getLayer().getContents();
   ListSet offs = null;
   Iterator figIter = figs.iterator();
   while (figIter.hasNext()) {
     Object obj = figIter.next();
     if (!(obj instanceof FigInterface)) continue;
     FigInterface fi = (FigInterface) obj;
     Fig enclosing = fi.getEnclosingFig();
     if (enclosing == null || (!(Model.getFacade().isAComponent(enclosing.getOwner())))) {
       if (offs == null) {
         offs = new ListSet();
         offs.add(dd);
       }
       offs.add(fi);
     }
   }
   return offs;
 }