/** * 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 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 cell is a valid source for new connections. * This implementation returns true for all non-null values and is * called by is called by <isValidConnection>. * * @param cell Object that represents a possible source or null. * @return Returns true if the given cell is a valid source terminal. */ public boolean isValidSource(Object cell) { return (cell == null && allowDanglingEdges) || (cell != null && (!model.isEdge(cell) || isConnectableEdges()) && isCellConnectable(cell)); }
/** * Returns true if the given cell is a valid source for new connections. * This implementation returns true for all non-null values and is * called by is called by <isValidConnection>. * * @param cell Object that represents a possible source or null. * @return Returns true if the given cell is a valid source terminal. */ public boolean isValidSource(Object cell) { return (cell == null && allowDanglingEdges) || (cell != null && (!model.isEdge(cell) || isConnectableEdges()) && isCellConnectable(cell)); }
/** * */ public boolean filter(Object cell) { return view.getState(cell) != null && model.getChildCount(cell) == 0 && ((model.isVertex(cell) && vertices) || (model .isEdge(cell) && edges)); }
/** * */ public boolean filter(Object cell) { return view.getState(cell) != null && model.getChildCount(cell) == 0 && ((model.isVertex(cell) && vertices) || (model .isEdge(cell) && edges)); }
/** * Returns true if the given cell should be kept inside the bounds of its * parent according to the rules defined by getOverlap and * isAllowOverlapParent. This implementation returns false for all children * of edges and isConstrainChildren() otherwise. */ public boolean isConstrainChild(Object cell) { return isConstrainChildren() && !getModel().isEdge(getModel().getParent(cell)); }
/** * Returns true if the given edge has no source or target terminal. * * @param edge Object that represents the edge to be tested. * @return Returns true if the edge should be ignored. */ public boolean isEdgeIgnored(Object edge) { mxIGraphModel model = graph.getModel(); return !model.isEdge(edge) || !graph.isCellVisible(edge) || model.getTerminal(edge, true) == null || model.getTerminal(edge, false) == null; }
/** * Returns true if the given cell should be kept inside the bounds of its * parent according to the rules defined by getOverlap and * isAllowOverlapParent. This implementation returns false for all children * of edges and isConstrainChildren() otherwise. */ public boolean isConstrainChild(Object cell) { return isConstrainChildren() && !getModel().isEdge(getModel().getParent(cell)); }
/** * Returns true if the given edges's label is moveable. This returns * <movable> for all given cells if <isLocked> does not return true * for the given cell. * * @param cell <mxCell> whose label should be moved. * @return Returns true if the label of the given cell is movable. */ public boolean isLabelMovable(Object cell) { return !isCellLocked(cell) && ((model.isEdge(cell) && isEdgeLabelsMovable()) || (model .isVertex(cell) && isVertexLabelsMovable())); }
/** * Returns true if the given edges's label is moveable. This returns * <movable> for all given cells if <isLocked> does not return true * for the given cell. * * @param cell <mxCell> whose label should be moved. * @return Returns true if the label of the given cell is movable. */ public boolean isLabelMovable(Object cell) { return !isCellLocked(cell) && ((model.isEdge(cell) && isEdgeLabelsMovable()) || (model .isVertex(cell) && isVertexLabelsMovable())); }
/** * Returns true if the given edge has no source or target terminal. * * @param edge Object that represents the edge to be tested. * @return Returns true if the edge should be ignored. */ public boolean isEdgeIgnored(Object edge) { mxIGraphModel model = graph.getModel(); return !model.isEdge(edge) || !graph.isCellVisible(edge) || model.getTerminal(edge, true) == null || model.getTerminal(edge, false) == null; }
protected Object getCell(MouseEvent e) { mxGraph graph = graphComponent.getGraph(); mxIGraphModel model = graph.getModel(); Object cell = super.getCell(e); if (cell == mxEdgeHandler.this.state.getCell() || (!graph.isConnectableEdges() && model.isEdge(cell))) { cell = null; } return cell; }
protected Object getCell(MouseEvent e) { mxGraph graph = graphComponent.getGraph(); mxIGraphModel model = graph.getModel(); Object cell = super.getCell(e); if (cell == mxEdgeHandler.this.state.getCell() || (!graph.isConnectableEdges() && model.isEdge(cell))) { cell = null; } return cell; }
/** * Draws the child edges and/or all other children in the given cell * depending on the boolean arguments. */ protected void drawChildren(Object cell, boolean edges, boolean others) { mxIGraphModel model = graph.getModel(); int childCount = model.getChildCount(cell); for (int i = 0; i < childCount; i++) { Object child = model.getChildAt(cell, i); boolean isEdge = model.isEdge(child); if ((others && !isEdge) || (edges && isEdge)) { drawCell(canvas, model.getChildAt(cell, i)); } } }
/** * Returns true if the given cell is a valid drop target for the specified * cells. This returns true if the cell is a swimlane, has children and is * not collapsed, or if splitEnabled is true and isSplitTarget returns * true for the given arguments * * @param cell Object that represents the possible drop target. * @param cells Objects that are going to be dropped. * @return Returns true if the cell is a valid drop target for the given * cells. */ public boolean isValidDropTarget(Object cell, Object[] cells) { return cell != null && ((isSplitEnabled() && isSplitTarget(cell, cells)) || (!model .isEdge(cell) && (isSwimlane(cell) || (model .getChildCount(cell) > 0 && !isCellCollapsed(cell))))); }
/** * Draws the child edges and/or all other children in the given cell * depending on the boolean arguments. */ protected void drawChildren(Object cell, boolean edges, boolean others) { mxIGraphModel model = graph.getModel(); int childCount = model.getChildCount(cell); for (int i = 0; i < childCount; i++) { Object child = model.getChildAt(cell, i); boolean isEdge = model.isEdge(child); if ((others && !isEdge) || (edges && isEdge)) { drawCell(canvas, model.getChildAt(cell, i)); } } }
/** * Returns the icon used to display the collapsed state of the specified * cell state. This returns null for all edges. */ public ImageIcon getFoldingIcon(mxCellState state) { if (state != null && isFoldingEnabled() && !getGraph().getModel().isEdge(state.getCell())) { Object cell = state.getCell(); boolean tmp = graph.isCellCollapsed(cell); if (graph.isCellFoldable(cell, !tmp)) { return (tmp) ? collapsedIcon : expandedIcon; } } return null; }
/** * 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())); }