public void mouseReleased(MouseEvent e) { if (translate.x != 0 || translate.y != 0) { translate = new Point(0, 0); repaint(); } } });
public void mouseReleased(MouseEvent e) { if (translate.x != 0 || translate.y != 0) { translate = new Point(0, 0); repaint(); } } });
/** * */ public void mouseDragged(MouseEvent e) { if (graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && first != null) { mxRectangle dirty = current; current = new mxRectangle(first.x, first.y, 0, 0); current.add(new mxRectangle(e.getX(), e.getY(), 0, 0)); if (dirty != null) { dirty.add(current); } else { dirty = current; } Rectangle tmp = dirty.getRectangle(); int b = (int) Math.ceil(lineWidth); graphComponent.getGraphControl().repaint(tmp.x - b, tmp.y - b, tmp.width + 2 * b, tmp.height + 2 * b); e.consume(); } }
/** * */ public void setBounds(Rectangle value) { if ((bounds == null && value != null) || (bounds != null && value == null) || (bounds != null && value != null && !bounds.equals(value))) { Rectangle tmp = bounds; if (tmp != null) { if (value != null) { tmp.add(value); } } else { tmp = value; } bounds = value; if (tmp != null) { graphComponent.getGraphControl().repaint(tmp); } } }
/** * */ public void reset() { if (handle.getParent() != null) { handle.getParent().remove(handle); } mxRectangle dirty = null; if (currentState != null && first != null) { dirty = mxUtils.getBoundingBox(currentState, currentAngle * mxConstants.DEG_PER_RAD); dirty.grow(1); } currentState = null; currentAngle = 0; first = null; if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } }
/** * */ public void reset() { if (handle.getParent() != null) { handle.getParent().remove(handle); } mxRectangle dirty = null; if (currentState != null && first != null) { dirty = mxUtils.getBoundingBox(currentState, currentAngle * mxConstants.DEG_PER_RAD); dirty.grow(1); } currentState = null; currentAngle = 0; first = null; if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } }
/** * */ public void reset() { Rectangle dirty = null; if (current != null) { dirty = current.getRectangle(); } current = null; first = null; if (dirty != null) { int b = (int) Math.ceil(lineWidth); graphComponent.getGraphControl().repaint(dirty.x - b, dirty.y - b, dirty.width + 2 * b, dirty.height + 2 * b); } }
/** * Shows the changes in the given mxCellStatePreview. */ protected void show(mxCellStatePreview preview) { if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } else { graphComponent.getGraphControl().repaint(); } dirty = preview.show(); if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } }
/** * Shows the changes in the given mxCellStatePreview. */ protected void show(mxCellStatePreview preview) { if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } else { graphComponent.getGraphControl().repaint(); } dirty = preview.show(); if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } }
/** * */ public void reset() { Rectangle dirty = null; if (current != null) { dirty = current.getRectangle(); } current = null; first = null; if (dirty != null) { int b = (int) Math.ceil(lineWidth); graphComponent.getGraphControl().repaint(dirty.x - b, dirty.y - b, dirty.width + 2 * b, dirty.height + 2 * b); } }
/** * Sets the translation of the preview. */ public void start(MouseEvent e, mxCellState state) { startState = state; movingCells = getCells(state); previewStates = (!placeholderPreview) ? getPreviewStates() : null; if (previewStates == null || previewStates.length >= threshold) { placeholder = getPlaceholderBounds(startState).getRectangle(); initialPlaceholder = new Rectangle(placeholder); graphComponent.getGraphControl().repaint(placeholder); } fireEvent(new mxEventObject(mxEvent.START, "event", e, "state", startState)); }
/** * Sets the translation of the preview. */ public void start(MouseEvent e, mxCellState state) { startState = state; movingCells = getCells(state); previewStates = (!placeholderPreview) ? getPreviewStates() : null; if (previewStates == null || previewStates.length >= threshold) { placeholder = getPlaceholderBounds(startState).getRectangle(); initialPlaceholder = new Rectangle(placeholder); graphComponent.getGraphControl().repaint(placeholder); } fireEvent(new mxEventObject(mxEvent.START, "event", e, "state", startState)); }
/** * */ public void stopAnimation() { graphComponent.getGraph().getView().revalidate(); super.stopAnimation(); preview = null; if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } }
/** * */ public void setVisible(boolean value) { if (visible != value) { visible = value; if (previewBounds != null) { graphComponent.getGraphControl().repaint(previewBounds); } } }
/** * */ public void stopAnimation() { graphComponent.getGraph().getView().revalidate(); super.stopAnimation(); preview = null; if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } }
/** * */ public void setVisible(boolean value) { if (visible != value) { visible = value; if (previewBounds != null) { graphComponent.getGraphControl().repaint(previewBounds); } } }
/** * Resets the rubberband selection without carrying out the selection. */ public void reset() { first = null; if (bounds != null) { graphComponent.getGraphControl().repaint(bounds); bounds = null; } }
/** * Resets the rubberband selection without carrying out the selection. */ public void reset() { first = null; if (bounds != null) { graphComponent.getGraphControl().repaint(bounds); bounds = null; } }