src/main/java/com/mxgraph/swing/handler/mxMovePreview.java
public void update(MouseEvent e, double dx, double dy, boolean clone)
	{
		mxGraph graph = graphComponent.getGraph();

		if (placeholder != null)
		{
			Rectangle tmp = new Rectangle(placeholder);
			placeholder.x = initialPlaceholder.x + (int) dx;
			placeholder.y = initialPlaceholder.x + (int) dy;
			tmp.add(placeholder);
			graphComponent.getGraphControl().repaint(tmp);
		}
		else if (previewStates != null)
		{
			preview = createCellStatePreview();
			preview.setOpacity(graphComponent.getPreviewAlpha());

			// Combines the layout result with the move preview
			for (mxCellState previewState : previewStates)
			{
				preview.moveState(previewState, dx, dy, false, false);

				// FIXME: Move into show-handler?
				boolean visible = true;

				if ((dx != 0 || dy != 0) && clone && isContextPreview())
				{
					visible = false;
					Object tmp = previewState.getCell();

					while (!visible && tmp != null)
					{
						visible = graph.isCellSelected(tmp);
						tmp = graph.getModel().getParent(tmp);
					}
				}
			}

			mxRectangle dirty = lastDirty;

			lastDirty = preview.show();

			if (dirty != null)
			{
				dirty.add(lastDirty);
			}
			else
			{
				dirty = lastDirty;
			}

			if (dirty != null)
			{
				repaint(dirty);
			}
		}

		if (isHideSelectionHandler())
		{
			graphComponent.getSelectionCellsHandler().setVisible(false);
		}

		fireEvent(new mxEventObject(mxEvent.CONTINUE, "event", e, "dx", dx,
				"dy", dy));
	}
/**
	 * Sets the translation of the preview.
	 */
Sets the translation of the preview.
Sets the translation of the preview .
public void update(MouseEvent e, double dx, double dy, boolean clone)
	{
		mxGraph graph = graphComponent.getGraph();
		if (placeholder != null)
		{
			Rectangle tmp = new Rectangle(placeholder);
			placeholder.x = initialPlaceholder.x + (int) dx;
			placeholder.y = initialPlaceholder.x + (int) dy;
			tmp.add(placeholder);
			graphComponent.getGraphControl().repaint(tmp);
		}
		else if (previewStates != null)
		{
			preview = createCellStatePreview();
			preview.setOpacity(graphComponent.getPreviewAlpha());
			for (mxCellState previewState : previewStates)
			{
				preview.moveState(previewState, dx, dy, false, false);
				boolean visible = true;
				if ((dx != 0 || dy != 0) && clone && isContextPreview())
				{
					visible = false;
					Object tmp = previewState.getCell();
					while (!visible && tmp != null)
					{
						visible = graph.isCellSelected(tmp);
						tmp = graph.getModel().getParent(tmp);
					}
				}
			}
			mxRectangle dirty = lastDirty;
			lastDirty = preview.show();
			if (dirty != null)
			{
				dirty.add(lastDirty);
			}
			else
			{
				dirty = lastDirty;
			}
			if (dirty != null)
			{
				repaint(dirty);
			}
		}
		if (isHideSelectionHandler())
		{
			graphComponent.getSelectionCellsHandler().setVisible(false);
		}
		fireEvent(new mxEventObject(mxEvent.CONTINUE, "event", e, "dx", dx,
				"dy", dy));
	}
public void update ( MouseEvent e , double dx , double dy , boolean clone ) { mxGraph graph = graphComponent . getGraph ( ) ; if ( placeholder != null ) { Rectangle tmp = new Rectangle ( placeholder ) ; placeholder . x = initialPlaceholder . x + ( int ) dx ; placeholder . y = initialPlaceholder . x + ( int ) dy ; tmp . add ( placeholder ) ; graphComponent . getGraphControl ( ) . repaint ( tmp ) ; } else if ( previewStates != null ) { preview = createCellStatePreview ( ) ; preview . setOpacity ( graphComponent . getPreviewAlpha ( ) ) ; for ( mxCellState previewState : previewStates ) { preview . moveState ( previewState , dx , dy , false , false ) ; boolean visible = true ; if ( ( dx != 0 || dy != 0 ) && clone && isContextPreview ( ) ) { visible = false ; Object tmp = previewState . getCell ( ) ; while ( ! visible && tmp != null ) { visible = graph . isCellSelected ( tmp ) ; tmp = graph . getModel ( ) . getParent ( tmp ) ; } } } mxRectangle dirty = lastDirty ; lastDirty = preview . show ( ) ; if ( dirty != null ) { dirty . add ( lastDirty ) ; } else { dirty = lastDirty ; } if ( dirty != null ) { repaint ( dirty ) ; } } if ( isHideSelectionHandler ( ) ) { graphComponent . getSelectionCellsHandler ( ) . setVisible ( false ) ; } fireEvent ( new mxEventObject ( mxEvent . CONTINUE , "event" , e , "dx" , dx , "dy" , dy ) ) ; }
Sets the translation of the preview.
Sets the translation of the preview .
// Combines the layout result with the move preview // FIXME: Move into show-handler?