Exemplo n.º 1
0
 /**
  * @param fgVec the FigGroup
  * @param ft the FigText
  * @param i get the fig after fig i
  * @return the FigText
  */
 protected FigText getNextVisibleFeature(FigGroup fgVec, FigText ft, int i) {
   if (fgVec == null || i < 1) {
     return null;
   }
   FigText ft2 = null;
   List v = fgVec.getFigs();
   if (i >= v.size() || !((FigText) v.get(i)).isVisible()) {
     return null;
   }
   do {
     i++;
     while (i >= v.size()) {
       if (fgVec == getCompartment(Model.getMetaTypes().getAttribute())) {
         fgVec = getCompartment(Model.getMetaTypes().getOperation());
       } else {
         fgVec = getCompartment(Model.getMetaTypes().getAttribute());
       }
       v = new ArrayList(fgVec.getFigs());
       i = 1;
     }
     ft2 = (FigText) v.get(i);
     if (!ft2.isVisible()) {
       ft2 = null;
     }
   } while (ft2 == null);
   return ft2;
 }
Exemplo n.º 2
0
 /**
  * @param fgVec the FigGroup
  * @param ft the Figtext
  * @param i get the fig after fig i
  * @return the FigText
  */
 protected FigText getNextVisibleFeature(FigGroup fgVec, FigText ft, int i) {
   if (fgVec == null || i < 1) {
     return null;
   }
   FigText ft2 = null;
   // TODO: come GEF V 0.12 use getFigs returning an array
   Vector v = new Vector(fgVec.getFigs());
   if (i >= v.size() || !((FigText) v.elementAt(i)).isVisible()) {
     return null;
   }
   do {
     i++;
     while (i >= v.size()) {
       if (fgVec == getAttributesFig()) {
         fgVec = getOperationsFig();
       } else {
         fgVec = getAttributesFig();
       }
       v = new Vector(fgVec.getFigs());
       i = 1;
     }
     ft2 = (FigText) v.elementAt(i);
     if (!ft2.isVisible()) {
       ft2 = null;
     }
   } while (ft2 == null);
   return ft2;
 }
Exemplo n.º 3
0
 /**
  * @param fgVec the FigGroup
  * @param ft the Figtext
  * @param i get the fig before fig i
  * @return the FigText
  */
 protected FigText getPreviousVisibleFeature(FigGroup fgVec, FigText ft, int i) {
   if (fgVec == null || i < 1) {
     return null;
   }
   FigText ft2 = null;
   List figs = fgVec.getFigs();
   if (i >= figs.size() || !((FigText) figs.get(i)).isVisible()) {
     return null;
   }
   do {
     i--;
     while (i < 1) {
       if (fgVec == getCompartment(Model.getMetaTypes().getAttribute())) {
         fgVec = getCompartment(Model.getMetaTypes().getOperation());
       } else {
         fgVec = getCompartment(Model.getMetaTypes().getAttribute());
       }
       figs = fgVec.getFigs();
       i = figs.size() - 1;
     }
     ft2 = (FigText) figs.get(i);
     if (!ft2.isVisible()) {
       ft2 = null;
     }
   } while (ft2 == null);
   return ft2;
 }
Exemplo n.º 4
0
 private void buildTree(Fig f, DefaultMutableTreeNode tn) {
   if (f instanceof FigGroup) {
     FigGroup fg = (FigGroup) f;
     for (int i = 0; i < fg.getFigCount(); ++i) {
       addNode(tn, fg.getFigAt(i));
     }
   } else if (f instanceof FigEdge) {
     FigEdge fe = (FigEdge) f;
     Fig lineFig = fe.getFig();
     addNode(tn, lineFig);
     addNode(tn, fe.getSourceFigNode());
     addNode(tn, fe.getSourcePortFig());
     addNode(tn, fe.getDestFigNode());
     addNode(tn, fe.getDestPortFig());
     for (Fig pathFig : (Vector<Fig>) fe.getPathItemFigs()) {
       addNode(tn, pathFig);
     }
   }
 }