/** * */ protected mxMovePreview createMovePreview() { return new mxMovePreview(graphComponent); }
/** * 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)); }
preview = createCellStatePreview(); preview.setOpacity(graphComponent.getPreviewAlpha()); if ((dx != 0 || dy != 0) && clone && isContextPreview()) repaint(dirty); if (isHideSelectionHandler()) fireEvent(new mxEventObject(mxEvent.CONTINUE, "event", e, "dx", dx, "dy", dy));
/** * */ public Object[] stop(boolean commit, MouseEvent e, double dx, double dy, boolean clone, Object target) { Object[] cells = movingCells; reset(); mxGraph graph = graphComponent.getGraph(); graph.getModel().beginUpdate(); try { if (commit) { double s = graph.getView().getScale(); cells = graph.moveCells(cells, dx / s, dy / s, clone, target, e.getPoint()); } fireEvent(new mxEventObject(mxEvent.STOP, "event", e, "commit", commit)); } finally { graph.getModel().endUpdate(); } return cells; }
if (isHideSelectionHandler()) if (!isClonePreview() && previewStates != null)
protected float getOpacityForCell(Object cell) { if (isCellOpaque(cell)) { return 1; } return super.getOpacityForCell(cell); } };
/** * */ public mxCellStatePreview createCellStatePreview() { return new mxCellStatePreview(graphComponent, isClonePreview()) { protected float getOpacityForCell(Object cell) { if (isCellOpaque(cell)) { return 1; } return super.getOpacityForCell(cell); } }; }
preview = createCellStatePreview(); preview.setOpacity(graphComponent.getPreviewAlpha()); if ((dx != 0 || dy != 0) && clone && isContextPreview()) repaint(dirty); if (isHideSelectionHandler()) fireEvent(new mxEventObject(mxEvent.CONTINUE, "event", e, "dx", dx, "dy", dy));
/** * */ public Object[] stop(boolean commit, MouseEvent e, double dx, double dy, boolean clone, Object target) { Object[] cells = movingCells; reset(); mxGraph graph = graphComponent.getGraph(); graph.getModel().beginUpdate(); try { if (commit) { double s = graph.getView().getScale(); cells = graph.moveCells(cells, dx / s, dy / s, clone, target, e.getPoint()); } fireEvent(new mxEventObject(mxEvent.STOP, "event", e, "commit", commit)); } finally { graph.getModel().endUpdate(); } return cells; }
if (isHideSelectionHandler()) if (!isClonePreview() && previewStates != null)
protected float getOpacityForCell(Object cell) { if (isCellOpaque(cell)) { return 1; } return super.getOpacityForCell(cell); } };
/** * */ public mxCellStatePreview createCellStatePreview() { return new mxCellStatePreview(graphComponent, isClonePreview()) { protected float getOpacityForCell(Object cell) { if (isCellOpaque(cell)) { return 1; } return super.getOpacityForCell(cell); } }; }
/** * 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)); }
/** * */ protected mxMovePreview createMovePreview() { return new mxMovePreview(graphComponent); }