/** * */ public boolean hitFoldingIcon(Object cell, int x, int y) { if (cell != null) { mxIGraphModel model = graph.getModel(); // Draws the collapse/expand icons boolean isEdge = model.isEdge(cell); if (foldingEnabled && (model.isVertex(cell) || isEdge)) { mxCellState state = graph.getView().getState(cell); if (state != null) { ImageIcon icon = getFoldingIcon(state); if (icon != null) { return getFoldingIconBounds(state, icon).contains(x, y); } } } } return false; }
return super.getFoldingIcon(state);
/** * */ public boolean hitFoldingIcon(Object cell, int x, int y) { if (cell != null) { mxIGraphModel model = graph.getModel(); // Draws the collapse/expand icons boolean isEdge = model.isEdge(cell); if (foldingEnabled && (model.isVertex(cell) || isEdge)) { mxCellState state = graph.getView().getState(cell); if (state != null) { ImageIcon icon = getFoldingIcon(state); if (icon != null) { return getFoldingIconBounds(state, icon).contains(x, y); } } } } return false; }
/** * */ protected void cellDrawn(mxICanvas canvas, mxCellState state) { if (isFoldingEnabled() && canvas instanceof mxGraphics2DCanvas) { mxIGraphModel model = graph.getModel(); mxGraphics2DCanvas g2c = (mxGraphics2DCanvas) canvas; Graphics2D g2 = g2c.getGraphics(); // Draws the collapse/expand icons boolean isEdge = model.isEdge(state.getCell()); if (state.getCell() != graph.getCurrentRoot() && (model.isVertex(state.getCell()) || isEdge)) { ImageIcon icon = getFoldingIcon(state); if (icon != null) { Rectangle bounds = getFoldingIconBounds(state, icon); g2.drawImage(icon.getImage(), bounds.x, bounds.y, bounds.width, bounds.height, this); } } } }
/** * */ protected void cellDrawn(mxICanvas canvas, mxCellState state) { if (isFoldingEnabled() && canvas instanceof mxGraphics2DCanvas) { mxIGraphModel model = graph.getModel(); mxGraphics2DCanvas g2c = (mxGraphics2DCanvas) canvas; Graphics2D g2 = g2c.getGraphics(); // Draws the collapse/expand icons boolean isEdge = model.isEdge(state.getCell()); if (state.getCell() != graph.getCurrentRoot() && (model.isVertex(state.getCell()) || isEdge)) { ImageIcon icon = getFoldingIcon(state); if (icon != null) { Rectangle bounds = getFoldingIconBounds(state, icon); g2.drawImage(icon.getImage(), bounds.x, bounds.y, bounds.width, bounds.height, this); } } } }