/** * */ public void paint(Graphics g) { Rectangle bounds = getState().getRectangle(); if (g.hitClip(bounds.x, bounds.y, bounds.width, bounds.height)) { Graphics2D g2 = (Graphics2D) g; Stroke stroke = g2.getStroke(); g2.setStroke(getSelectionStroke()); g.setColor(getSelectionColor()); g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); g2.setStroke(stroke); } super.paint(g); }
/** * */ public void mouseReleased(MouseEvent e) { if (!e.isConsumed() && first != null) { if (preview != null && preview.isVisible()) { if (isLabel(index)) { moveLabel(e); } else { resizeCell(e); } } e.consume(); } super.mouseReleased(e); }
/** * * @param state * Cell state for which a handler should be created. * @return Returns the handler to be used for the given cell state. */ public mxCellHandler createHandler(mxCellState state) { if (graph.getModel().isVertex(state.getCell())) { return new mxVertexHandler(this, state); } else if (graph.getModel().isEdge(state.getCell())) { mxEdgeStyleFunction style = graph.getView().getEdgeStyle(state, null, null, null); if (graph.isLoop(state) || style == mxEdgeStyle.ElbowConnector || style == mxEdgeStyle.SideToSide || style == mxEdgeStyle.TopToBottom) { return new mxElbowEdgeHandler(this, state); } return new mxEdgeHandler(this, state); } return new mxCellHandler(this, state); }
/** * * @param state * Cell state for which a handler should be created. * @return Returns the handler to be used for the given cell state. */ public mxCellHandler createHandler(mxCellState state) { if (graph.getModel().isVertex(state.getCell())) { return new mxVertexHandler(this, state); } else if (graph.getModel().isEdge(state.getCell())) { mxEdgeStyleFunction style = graph.getView().getEdgeStyle(state, null, null, null); if (graph.isLoop(state) || style == mxEdgeStyle.ElbowConnector || style == mxEdgeStyle.SideToSide || style == mxEdgeStyle.TopToBottom) { return new mxElbowEdgeHandler(this, state); } return new mxEdgeHandler(this, state); } return new mxCellHandler(this, state); }
/** * */ public void paint(Graphics g) { Rectangle bounds = getState().getRectangle(); if (g.hitClip(bounds.x, bounds.y, bounds.width, bounds.height)) { Graphics2D g2 = (Graphics2D) g; Stroke stroke = g2.getStroke(); g2.setStroke(getSelectionStroke()); g.setColor(getSelectionColor()); g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); g2.setStroke(stroke); } super.paint(g); }
/** * */ public void mouseReleased(MouseEvent e) { if (!e.isConsumed() && first != null) { if (preview != null && preview.isVisible()) { if (isLabel(index)) { moveLabel(e); } else { resizeCell(e); } } e.consume(); } super.mouseReleased(e); }