/** * Updates mouse position. */ public void update(MouseEvent e, mxCellState targetState, double x, double y) { super.update(e, targetState, x, y); timestamp = System.currentTimeMillis(); }
/** * */ protected mxConnectPreview createConnectPreview() { return new mxConnectPreview(graphComponent); }
/** * */ protected Rectangle getDirtyRect() { return getDirtyRect(null); }
geo.setTerminalPoint(transformScreenPoint(x, y), false); revalidate(previewState); fireEvent(new mxEventObject(mxEvent.CONTINUE, "event", e, "x", x, "y", y)); Rectangle tmp = getDirtyRect(dirty);
/** * Updates the style of the edge preview from the incoming edge */ public void start(MouseEvent e, mxCellState startState, String style) { mxGraph graph = graphComponent.getGraph(); sourceState = startState; startPoint = transformScreenPoint(startState.getCenterX(), startState.getCenterY()); Object cell = createCell(startState, style); graph.getView().validateCell(cell); previewState = graph.getView().getState(cell); fireEvent(new mxEventObject(mxEvent.START, "event", e, "state", previewState)); }
/** * Returns the error message or an empty string if the connection for the * given source target pair is not valid. Otherwise it returns null. */ public String validateConnection(Object source, Object target) { if (target == null && createTarget) { return null; } if (!isValidTarget(target)) { return ""; } return graphComponent.getGraph().getEdgeValidationError( connectPreview.getPreviewState().getCell(), source, target); }
fireEvent(new mxEventObject(mxEvent.STOP, "event", e, "commit", commit, "cell", (commit) ? result : null)); Rectangle dirty = getDirtyRect(); graph.getView().clear(cell, false, true); previewState = null;
public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } });
/** * Returns true if the source terminal has been clicked and a new * connection is currently being previewed. */ public boolean isConnecting() { return connectPreview.isActive(); }
canvas.setGraphics((Graphics2D) g); paintPreview(canvas);
geo.setTerminalPoint(transformScreenPoint(x, y), false); revalidate(previewState); fireEvent(new mxEventObject(mxEvent.CONTINUE, "event", e, "x", x, "y", y)); Rectangle tmp = getDirtyRect(dirty);
/** * Updates the style of the edge preview from the incoming edge */ public void start(MouseEvent e, mxCellState startState, String style) { mxGraph graph = graphComponent.getGraph(); sourceState = startState; startPoint = transformScreenPoint(startState.getCenterX(), startState.getCenterY()); Object cell = createCell(startState, style); graph.getView().validateCell(cell); previewState = graph.getView().getState(cell); fireEvent(new mxEventObject(mxEvent.START, "event", e, "state", previewState)); }
/** * Returns the error message or an empty string if the connection for the * given source target pair is not valid. Otherwise it returns null. */ public String validateConnection(Object source, Object target) { if (target == null && createTarget) { return null; } if (!isValidTarget(target)) { return ""; } return graphComponent.getGraph().getEdgeValidationError( connectPreview.getPreviewState().getCell(), source, target); }
fireEvent(new mxEventObject(mxEvent.STOP, "event", e, "commit", commit, "cell", (commit) ? result : null)); Rectangle dirty = getDirtyRect(); graph.getView().clear(cell, false, true); previewState = null;
public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } });
/** * Returns true if the source terminal has been clicked and a new * connection is currently being previewed. */ public boolean isConnecting() { return connectPreview.isActive(); }