/** * A shortcut method to create a connection set that represents the * connections in this model. Useful for encoding to avoid writing redundant * connection data stored in the cells. */ public ConnectionSet getConnectionSet() { return ConnectionSet .create(this, DefaultGraphModel.getAll(this), false); }
/** * Returns an edit that represents a remove. */ protected GraphModelEdit createRemoveEdit(Object[] cells) { // Remove from GraphStructure ConnectionSet cs = ConnectionSet.create(this, cells, true); // Remove from Group Structure ParentMap pm = ParentMap.create(this, cells, true, false); // Construct Edit GraphModelEdit edit = createEdit(null, cells, null, cs, pm, null); if (edit != null) edit.end(); return edit; }
protected Transferable createTransferable(JGraph graph, Object[] cells) { Object[] flat = graph.getDescendants(graph.order(cells)); ParentMap pm = ParentMap.create(graph.getModel(), flat, false, true); ConnectionSet cs = ConnectionSet.create(graph.getModel(), flat, false); Map viewAttributes = GraphConstants.createAttributes(flat, graph .getGraphLayoutCache()); Rectangle2D bounds = graph.getCellBounds(graph.getSelectionCells()); bounds = new AttributeMap.SerializableRectangle2D(bounds.getX(), bounds .getY(), bounds.getWidth(), bounds.getHeight()); out = flat; return create(graph, flat, viewAttributes, bounds, cs, pm); }
ConnectionSet cs = ConnectionSet.create(graphModel, cells, false); ParentMap pm = ParentMap.create(graphModel, cells,