/** * Returns the current root of the displayed cell hierarchy. This is a * shortcut to <mxGraphView.currentRoot> in <view>. * * @return Returns the current root in the view. */ public Object getCurrentRoot() { return view.getCurrentRoot(); }
/** * Returns the current root of the displayed cell hierarchy. This is a * shortcut to <mxGraphView.currentRoot> in <view>. * * @return Returns the current root in the view. */ public Object getCurrentRoot() { return view.getCurrentRoot(); }
/** * Returns the first child of the root in the model, that is, the first or * default layer of the diagram. * * @return Returns the default parent for new cells. */ public Object getDefaultParent() { Object parent = defaultParent; if (parent == null) { parent = view.getCurrentRoot(); if (parent == null) { Object root = model.getRoot(); parent = model.getChildAt(root, 0); } } return parent; }
/** * Returns true if the given cell is not the current root or the root in * the model. This can be overridden to not render certain cells in the * graph display. */ protected boolean isCellDisplayable(Object cell) { return cell != graph.getView().getCurrentRoot() && cell != graph.getModel().getRoot(); }
/** * Constructs a change of the current root in the given view. */ public mxCurrentRootChange(mxGraphView view, Object root) { this.view = view; this.root = root; this.previous = this.root; this.up = (root == null); if (!up) { Object tmp = view.getCurrentRoot(); mxIGraphModel model = view.graph.getModel(); while (tmp != null) { if (tmp == root) { up = true; break; } tmp = model.getParent(tmp); } } }
/** * Returns the first child of the root in the model, that is, the first or * default layer of the diagram. * * @return Returns the default parent for new cells. */ public Object getDefaultParent() { Object parent = defaultParent; if (parent == null) { parent = view.getCurrentRoot(); if (parent == null) { Object root = model.getRoot(); parent = model.getChildAt(root, 0); } } return parent; }
/** * Returns true if the given cell is not the current root or the root in * the model. This can be overridden to not render certain cells in the * graph display. */ protected boolean isCellDisplayable(Object cell) { return cell != graph.getView().getCurrentRoot() && cell != graph.getModel().getRoot(); }
/** * Constructs a change of the current root in the given view. */ public mxCurrentRootChange(mxGraphView view, Object root) { this.view = view; this.root = root; this.previous = this.root; this.up = (root == null); if (!up) { Object tmp = view.getCurrentRoot(); mxIGraphModel model = view.graph.getModel(); while (tmp != null) { if (tmp == root) { up = true; break; } tmp = model.getParent(tmp); } } }
/** * Changes the current root of the view. */ public void execute() { Object tmp = view.getCurrentRoot(); view.currentRoot = previous; previous = tmp; mxPoint translate = view.graph.getTranslateForRoot(view .getCurrentRoot()); if (translate != null) { view.translate = new mxPoint(-translate.getX(), translate.getY()); } // Removes all existing cell states and revalidates view.reload(); up = !up; String eventName = (up) ? mxEvent.UP : mxEvent.DOWN; view.fireEvent(new mxEventObject(eventName, "root", view.currentRoot, "previous", previous)); }
/** * Changes the current root of the view. */ public void execute() { Object tmp = view.getCurrentRoot(); view.currentRoot = previous; previous = tmp; mxPoint translate = view.graph.getTranslateForRoot(view .getCurrentRoot()); if (translate != null) { view.translate = new mxPoint(-translate.getX(), translate.getY()); } // Removes all existing cell states and revalidates view.reload(); up = !up; String eventName = (up) ? mxEvent.UP : mxEvent.DOWN; view.fireEvent(new mxEventObject(eventName, "root", view.currentRoot, "previous", previous)); }
if (state != null && state.getCell() != graph.getView().getCurrentRoot())
if (state != null && state.getCell() != graph.getView().getCurrentRoot())
|| parent == graph.getView().getCurrentRoot())
|| parent == graph.getView().getCurrentRoot())
if (cell != null && cell != view.getCurrentRoot() && cell != model.getRoot() && (model.isVertex(cell) || model.isEdge(cell)))
if (cell != null && cell != view.getCurrentRoot() && cell != model.getRoot() && (model.isVertex(cell) || model.isEdge(cell)))
updateFloatingTerminalPoints(state, source, target); if (state.getCell() != getCurrentRoot() && (state.getAbsolutePointCount() < 2 || state.getAbsolutePoint(0) == null || state
updateFloatingTerminalPoints(state, source, target); if (state.getCell() != getCurrentRoot() && (state.getAbsolutePointCount() < 2 || state.getAbsolutePoint(0) == null || state
|| parent == graph.getView().getCurrentRoot())
|| parent == graph.getView().getCurrentRoot())