/** * Returns a boolean indicating if the given <em>mxCell</em> should be ignored as a vertex. This returns true if the cell has no connections. * * @param vertex * Object that represents the vertex to be tested. * @return Returns true if the vertex should be ignored. */ public boolean isVertexIgnored(Object vertex) { return super.isVertexIgnored(vertex) || graph.isSwimlane(vertex) || graph.getModel().getGeometry(vertex).isRelative() || graph.getConnections(vertex).length == 0; }
mxIGraphModel model = graph.getModel(); if (cell != null && !visited.contains(cell) && (!isVertexIgnored(cell) || isBoundaryEvent(cell))) { visited.add(cell);
/** * */ protected mxRectangle apply(TreeNode node, mxRectangle bounds) { mxRectangle g = graph.getModel().getGeometry(node.cell); if (node.cell != null && g != null) { if (isVertexMovable(node.cell)) { g = setVertexLocation(node.cell, node.x, node.y); } if (bounds == null) { bounds = new mxRectangle(g.getX(), g.getY(), g.getWidth(), g.getHeight()); } else { bounds = new mxRectangle(Math.min(bounds.getX(), g.getX()), Math.min(bounds.getY(), g.getY()), Math.max(bounds.getX() + bounds.getWidth(), g.getX() + g.getWidth()), Math.max(bounds.getY() + bounds.getHeight(), g.getY() + g.getHeight())); } } return bounds; }
public void execute(Object parent) { mxIGraphModel model = graph.getModel(); List<Object> roots = graph.findTreeRoots(parent, true, invert);
/** * * @param edge * @param isSource * @return */ public Object getTerminal(Object edge, boolean isSource) { return graph.getModel().getTerminal(edge, isSource); };
/** * Returns the terminal to be used for a given port. This implementation * always returns the parent cell. * * @param cell Cell that represents the port. * @param source If the cell is the source or target port. * @return Returns the terminal to be used for the given port. */ public Object getTerminalForPort(Object cell, boolean source) { return getModel().getParent(cell); }
/** * Validates the graph by validating each descendant of the given cell or * the root of the model. Context is an object that contains the validation * state for the complete validation run. The validation errors are attached * to their cells using <setWarning>. This function returns true if no * validation errors exist in the graph. */ public String validateGraph() { return validateGraph(graph.getModel().getRoot(), new Hashtable<Object, Object>()); }
/** * Returns true if the parent of the given cell should be extended if the * child has been resized so that it overlaps the parent. This * implementation returns ExtendParents if cell is not an edge. * * @param cell Cell that has been resized. */ public boolean isExtendParent(Object cell) { return !getModel().isEdge(cell) && isExtendParents(); }
/** * Returns true if the given vertex has no connected edges. * * @param vertex Object that represents the vertex to be tested. * @return Returns true if the vertex should be ignored. */ public boolean isVertexIgnored(Object vertex) { return !graph.getModel().isVertex(vertex) || !graph.isCellVisible(vertex); }
/** * Returns true if the given vertex has no connected edges. * * @param vertex Object that represents the vertex to be tested. * @return Returns true if the vertex should be ignored. */ public boolean isVertexIgnored(Object vertex) { return !graph.getModel().isVertex(vertex) || !graph.isCellVisible(vertex); }
/** * Checks the type of the given value. */ public boolean checkTerminal(mxGraph graph, Object terminal, Object edge) { Object userObject = graph.getModel().getValue(terminal); return checkType(graph, userObject, type, attr, value); }
/** * Returns true if the parent of the given cell should be extended if the * child has been resized so that it overlaps the parent. This * implementation returns ExtendParents if cell is not an edge. * * @param cell Cell that has been resized. */ public boolean isExtendParent(Object cell) { return !getModel().isEdge(cell) && isExtendParents(); }
/** * Draws the graph onto the given canvas. * * @param canvas Canvas onto which the graph should be drawn. */ public void drawGraph(mxICanvas canvas) { drawCell(canvas, getModel().getRoot()); }
/** * 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(); }
/** * */ public boolean isStateHandled(mxCellState state) { return graphComponent.getGraph().getModel().isVertex(state.getCell()); }
/** * Returns a boolean indicating if the given <mxCell> should be ignored as a vertex. This returns true if the cell has no connections. * * @param vertex * Object that represents the vertex to be tested. * @return Returns true if the vertex should be ignored. */ @Override public boolean isVertexIgnored(Object vertex) { return super.isVertexIgnored(vertex) || graph.isSwimlane(vertex) || graph.getModel().getGeometry(vertex).isRelative() || graph.getConnections(vertex).length == 0; }
/** * First validates all bounds and then validates all points recursively on * all visible cells. */ public void validate() { mxRectangle graphBounds = getBoundingBox(validateCellState(validateCell((currentRoot != null) ? currentRoot : graph.getModel().getRoot()))); setGraphBounds((graphBounds != null) ? graphBounds : new mxRectangle()); }
/** * Returns true if the label bounds of the state should be used for the * editor. */ protected boolean useLabelBounds(mxCellState state) { mxIGraphModel model = state.getView().getGraph().getModel(); mxGeometry geometry = model.getGeometry(state.getCell()); return ((geometry != null && geometry.getOffset() != null && !geometry.isRelative() && (geometry.getOffset().getX() != 0 || geometry .getOffset().getY() != 0)) || model.isEdge(state.getCell())); }
/** * Returns true if the label bounds of the state should be used for the * editor. */ protected boolean useLabelBounds(mxCellState state) { mxIGraphModel model = state.getView().getGraph().getModel(); mxGeometry geometry = model.getGeometry(state.getCell()); return ((geometry != null && geometry.getOffset() != null && !geometry.isRelative() && (geometry.getOffset().getX() != 0 || geometry .getOffset().getY() != 0)) || model.isEdge(state.getCell())); }