net.officefloor.eclipse.common.editpolicies.layout
Class MovePositionalModelCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by net.officefloor.eclipse.common.editpolicies.layout.MovePositionalModelCommand

public class MovePositionalModelCommand
extends org.eclipse.gef.commands.Command

Moves a figure.

Author:
Daniel Sagenschneider

Field Summary
protected  AbstractOfficeFloorEditPart<?,?,?> editPart
          Edit part to be moved.
protected  org.eclipse.draw2d.geometry.Point newLocation
          New position for the figure.
protected  org.eclipse.draw2d.geometry.Point oldLocation
          Current (old) position for the edit part.
 
Constructor Summary
MovePositionalModelCommand(AbstractOfficeFloorEditPart<?,?,?> editPart, org.eclipse.draw2d.geometry.Point location)
          Initiate to move a position model.
 
Method Summary
 void execute()
           
protected  void move(org.eclipse.draw2d.geometry.Point location)
          Moves the edit part.
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, canUndo, chain, dispose, getDebugLabel, getLabel, redo, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

editPart

protected final AbstractOfficeFloorEditPart<?,?,?> editPart
Edit part to be moved.


newLocation

protected final org.eclipse.draw2d.geometry.Point newLocation
New position for the figure.


oldLocation

protected final org.eclipse.draw2d.geometry.Point oldLocation
Current (old) position for the edit part.

Constructor Detail

MovePositionalModelCommand

public MovePositionalModelCommand(AbstractOfficeFloorEditPart<?,?,?> editPart,
                                  org.eclipse.draw2d.geometry.Point location)
Initiate to move a position model.

Parameters:
editPart - Edit part to move.
location - Location to move the edit part.
Method Detail

execute

public void execute()
Overrides:
execute in class org.eclipse.gef.commands.Command

undo

public void undo()
Overrides:
undo in class org.eclipse.gef.commands.Command

move

protected void move(org.eclipse.draw2d.geometry.Point location)
Moves the edit part.

Parameters:
constraints - Constraints for the edit part.


Copyright © 2005-2013. All Rights Reserved.