com.mindfusion.diagramming
Class ModifyItemCmd

java.lang.Object
  extended by com.mindfusion.diagramming.Command
      extended by com.mindfusion.diagramming.ModifyItemCmd

public final class ModifyItemCmd
extends Command

Represents an action that changes the size or position of a diagram item.


Constructor Summary
ModifyItemCmd(DiagramItem item)
          Initializes a new instance of the ModifyItemCmd class.
 
Method Summary
protected  boolean adopt(Command command)
          Merges adjacent commands in the history queue if they are related.
 void execute(boolean undoEnabled)
          This method is called internally by JDiagram when saving item position and size for later undo/redo.
 DiagramItem getItem()
          Gets a reference to the modified item.
 void redo()
          This method is called by the UndoManager when redoing actions.
 void undo()
          This method is called by the UndoManager when undoing actions.
 
Methods inherited from class com.mindfusion.diagramming.Command
addSubCmd, getContext, getSubCommands, getTitle, isContainerOf, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModifyItemCmd

public ModifyItemCmd(DiagramItem item)
Initializes a new instance of the ModifyItemCmd class.

Parameters:
item - The item whose modification is represented by this command.
Method Detail

execute

public void execute(boolean undoEnabled)
This method is called internally by JDiagram when saving item position and size for later undo/redo.

Specified by:
execute in class Command
Parameters:
undoEnabled - true if the undo manager is enabled at this time, otherwise false.

undo

public void undo()
This method is called by the UndoManager when undoing actions.

Overrides:
undo in class Command

redo

public void redo()
This method is called by the UndoManager when redoing actions.

Overrides:
redo in class Command

adopt

protected boolean adopt(Command command)
Description copied from class: Command
Merges adjacent commands in the history queue if they are related.

Overrides:
adopt in class Command
Parameters:
command - The Command that might be adopted by this command.
Returns:
true if the specified command has been adopted; otherwise, false.

getItem

public DiagramItem getItem()
Gets a reference to the modified item.