public mxICell insert(mxICell child) { int index = getChildCount(); if (child.getParent() == this) { index--; } return insert(child, index); }
public mxICell insert(mxICell child) { int index = getChildCount(); if (child.getParent() == this) { index--; } return insert(child, index); }
newGraph.clearSelection(); newGraph.selectAll(); Object[] cells = newGraph.getSelectionCells(); //here you have all cells for (Object c : cells) { mxCell cell = (mxCell) c; //cast if (cell.isVertex()) { //isVertex //todo }else{ //is not a vertex, so u can get source and target //todo cell.getChildCount(); //Returns the number of child cells. (edges) cell.getChildAt(x); //Returns the child at the specified index. (target) }
/** * Recursively finds the visual elements. * * @param parent The parent node. * @param nodes List of thre nodes. * @param edges List of the edges. */ protected static final void getVisualElements(mxCell parent, List<VNode> nodes, List<VEdge> edges) { if (parent instanceof VNode) { if (!(parent instanceof VInParameter) && !(parent instanceof VOutParameter)) { nodes.add((VNode) parent); } } else if (parent instanceof VEdge) { edges.add((VEdge) parent); } for (int i = 0; i < parent.getChildCount(); ++i) { getVisualElements((mxCell) parent.getChildAt(i), nodes, edges); } } }
if ( cell.getChildCount() > 0 ) for ( int i = 0; i < cell.getChildCount(); i++ ) if ( cell.getChildCount() > 0 ) for ( int i = 0; i < cell.getChildCount(); i++ )
if ( cell.getChildCount() > 0 ) for ( int i = 0; i < cell.getChildCount(); i++ ) if ( cell.getChildCount() > 0 ) for ( int i = 0; i < cell.getChildCount(); i++ )