/** * Returns the minimal rectangular bounds that enclose all the elements in * the <code>bounds</code> map. After a layout has completed this method * will return the collective bounds of the new laid out graph. * Note this method may return null and should be checked before using. * * @return the collective bounds of the elements in <code>bounds</code> */ public Rectangle2D getGraphBounds() { return GraphLayoutCache.getBounds(graphLayoutCache.getCellViews()); }
/** * Returns a nested map of (cell, map) pairs that represent all attributes * of all cell views in this view. * * @see #getCellViews */ public Map createNestedMap() { CellView[] cellViews = getCellViews(); Map nested = new Hashtable(); for (int i = 0; i < cellViews.length; i++) { nested.put(cellViews[i].getCell(), new Hashtable((Map) cellViews[i] .getAllAttributes().clone())); } return nested; }
/** * A helper method to return various arrays of cells that are visible in * this cache. For example, to get all selected vertices in a graph, do * <code>graph.getSelectionCells(graph.getGraphLayoutCache().getCells(false, true, false, false));</code> */ public Object[] getCells(boolean groups, boolean vertices, boolean ports, boolean edges) { CellView[] views = getCellViews(); List result = new ArrayList(views.length); GraphModel model = getModel(); for (int i = 0; i < views.length; i++) { Object cell = views[i].getCell(); boolean isEdge = model.isEdge(cell); if ((ports || !model.isPort(cell))) { if (((((ports || vertices) && !isEdge) || (edges && isEdge)) && views[i] .isLeaf()) || (groups && !views[i].isLeaf())) result.add(views[i].getCell()); } } return result.toArray(); }
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){
VertexView vv=null; while (!created){ CellView[] cellviews = this.getGraphLayoutCache().getCellViews(); for (CellView cv:cellviews){ if (cv.getCell()==vertex){