/** * Required for XML persistence * * @return whether or not the cache is partial */ public boolean getPartial() { return isPartial(); }
/** * Whether or not the specified cell is visible. * NOTE: Your GraphLayoutCache must be <code>partial</code> (set * <code>partial</code> to <code>true</code> in the constructor) * in order to use the visibility functionality of expand/collapse, * setVisible, etc. * null is always visible * * @param cell the whose visibility to determine * @return whether or not the cell is visible */ public boolean isVisible(Object cell) { return !isPartial() || visibleSet.contains(cell) || cell == null; }
/** * Sets the current model. */ public void setModel(GraphModel model) { roots.clear(); mapping.clear(); hiddenMapping.clear(); visibleSet.clear(); graphModel = model; if (!isPartial()) { Object[] cells = DefaultGraphModel.getRoots(getModel()); CellView[] cellViews = getMapping(cells, true); insertViews(cellViews); } // Update PortView Cache and Notify Observers update(); }
/** * Inserts the <code>cells</code> and connections into the model, and * absorbs the local attributes. This implementation sets the inserted cells * visible and selects the new roots depending on graph.selectNewCells. */ public void insert(Object[] roots, Map attributes, ConnectionSet cs, ParentMap pm, UndoableEdit[] e) { Object[] visible = null; if (isPartial() && showsInsertedCells) { List tmp = DefaultGraphModel.getDescendants(graphModel, roots); tmp.removeAll(visibleSet); if (!tmp.isEmpty()) visible = tmp.toArray(); } // Absorb local attributes GraphLayoutCacheEdit edit = createLocalEdit(roots, attributes, visible, null); if (edit != null) e = augment(e, edit); graphModel.insert(roots, attributes, cs, pm, e); }
if (attributes != null || cs != null || pm != null || e != null) { Object[] visible = null; if (isPartial() && showsInvisibleEditedCells) { Set tmp = new HashSet(); if (attributes != null)
if (graphLayoutCache != null && graphLayoutCache.isPartial() && edgePromotion) { Set cells1 = getHiddenChildren(cell1);
if (graphLayoutCache != null && graphLayoutCache.isPartial() && edgePromotion) { Set cells = getHiddenChildren(cell);
boolean visibleCells, boolean selfLoops) { LinkedList incomingEdges = new LinkedList(); if (graphLayoutCache != null && graphLayoutCache.isPartial() && edgePromotion) { Set cells = getHiddenChildren(cell);
if (cells != null && isPartial()) { boolean updatePorts = false;
public void graphLayoutCacheChanged(GraphLayoutCacheEvent e) { Object[] changed = e.getChange().getChanged(); if (changed != null && changed.length > 0) { for (int i = 0; i < changed.length; i++) { graph.updateAutoSize(graphLayoutCache.getMapping( changed[i], false)); } } Rectangle2D oldDirtyRegion = e.getChange().getDirtyRegion(); graph.addOffscreenDirty(oldDirtyRegion); Rectangle2D newDirtyRegion = graph.getClipRectangle(e.getChange()); graph.addOffscreenDirty(newDirtyRegion); Object[] inserted = e.getChange().getInserted(); if (inserted != null && inserted.length > 0 && graphLayoutCache.isSelectsLocalInsertedCells() && !(graphLayoutCache.isSelectsAllInsertedCells() && !graphLayoutCache .isPartial()) && graph.isEnabled()) { Object[] roots = DefaultGraphModel.getRoots(graphModel, inserted); if (roots != null && roots.length > 0) { lastFocus = focus; focus = graphLayoutCache.getMapping(roots[0], false); graph.setSelectionCells(roots); } } updateSize(); }
if (!graphLayoutCache.isPartial() && graphLayoutCache.isSelectsAllInsertedCells() && graph.isEnabled()) {