public void run() { graph.getGraphLayoutCache().remove(new Object[] { edge }); } });
public void run() { graph.getGraphLayoutCache().remove(new Object[] { cell }, true, true); } });
public void removeEntityFromAllGraphs(Object ent){ Vector v=this.getUOModels(); Enumeration enumeration=v.elements(); while (enumeration.hasMoreElements()){ JGraph jg=(JGraph)enumeration.nextElement(); Vector<DefaultGraphCell> dgcs=this.getCell(jg,ent); if (!dgcs.isEmpty()){ Object[] cells=dgcs.toArray(); //cells = ButtonToolBar.this.editor.graph.getDescendants(cells); jg.getGraphLayoutCache().remove(cells,true,true); jg.getModel().remove(cells); //removeConnectedEdges(jg,dgc); //dgc.removeAllChildren(); //cells=jg.getDescendants(cells); //jg.getGraphLayoutCache().remove(cells,true,true); } } }
/** * Removes cells from the model, including all children and connected edges * if <code>children</code> or <code>edges</code> is true, respectively. * * @param cells * The cells to remove. * @param descendants * Whether to remove all descendants as well. * @param edges * Whether to remove all connected edges as well. */ public void remove(Object[] cells, boolean descendants, boolean edges) { if (cells != null && cells.length > 0) { if (edges) { Object[] tmp = DefaultGraphModel.getEdges(getModel(), cells) .toArray(); Object[] newCells = new Object[cells.length + tmp.length]; System.arraycopy(cells, 0, newCells, 0, cells.length); System.arraycopy(tmp, 0, newCells, cells.length, tmp.length); cells = newCells; } if (descendants) cells = DefaultGraphModel.getDescendants(getModel(), cells) .toArray(); remove(cells); } }
remove(toRemove.toArray()); return children.toArray();
protected void exportDone(JComponent comp, Transferable data, int action) { if (comp instanceof JGraph && data instanceof GraphTransferable) { JGraph graph = (JGraph) comp; if (action == TransferHandler.MOVE) { Object[] cells = ((GraphTransferable) data).getCells(); graph.getGraphLayoutCache().remove(cells); } graph.getUI().updateHandle(); graph.getUI().setInsertionLocation(null); } }
graph.getGraphLayoutCache().remove(cellsToRemove.toArray(),true,true);
glc.remove(new Object[] { k.getB() }); processed.add(k);
public void objEntityChanged(EntityEvent e) { remapEntity(e); updateEntityCell(e.getEntity()); // maybe super entity was changed ObjEntity entity = (ObjEntity) e.getEntity(); DefaultEdge inheritanceEdge = inheritanceEdges.get(entity); if (inheritanceEdge != null) { if (entity.getSuperEntity() == null) { graph.getGraphLayoutCache().remove(new Object[] { inheritanceEdge }); inheritanceEdges.remove(entity); } else { inheritanceEdge.setTarget(entityCells.get( entity.getSuperEntity().getName()).getChildAt(0)); Map nested = new HashMap(); nested.put(inheritanceEdge, inheritanceEdge.getAttributes()); graph.getGraphLayoutCache().edit(nested); } } else { if (entity.getSuperEntity() != null) { DefaultEdge edge = createInheritanceEdge(entity); graph.getGraphLayoutCache().insert(edge); } } }