com.mindfusion.diagramming
Class RemoveItemCmd

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

public final class RemoveItemCmd
extends Command

Represents an action that removes an item from the diagram.


Constructor Summary
RemoveItemCmd(DiagramItem item)
          Initializes a new RemoveItemCmd instance.
 
Method Summary
 void execute()
          Removes the item from the diagram.
 void execute(boolean undoEnabled)
          This method is called internally by JDiagram when removing an item.
 DiagramItem getItem()
          Gets the item removed by this command.
 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, adopt, 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

RemoveItemCmd

public RemoveItemCmd(DiagramItem item)
Initializes a new RemoveItemCmd instance.

Parameters:
item - The DiagramItem removed from the diagram by this command.
Method Detail

execute

public void execute()
Removes the item from the diagram.


execute

public void execute(boolean undoEnabled)
This method is called internally by JDiagram when removing an item.

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

getItem

public DiagramItem getItem()
Gets the item removed by this command.

Returns:
An DiagramItem -derived object.