com.mindfusion.diagramming
Class AddItemCmd

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

public final class AddItemCmd
extends Command

Implements creation of new diagram items.


Constructor Summary
AddItemCmd(DiagramItem item)
          Initializes a new AddItemCmd instance.
 
Method Summary
 void execute(boolean undoEnabled)
          This method is called internally by JDiagram when creating new items interactively or programmatically.
 DiagramItem getItem()
          Gets the item added to the flowchart 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

AddItemCmd

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

Parameters:
item - The item that is added to the diagram by this command.
Method Detail

execute

public void execute(boolean undoEnabled)
This method is called internally by JDiagram when creating new items interactively or programmatically.

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 added to the flowchart by this command.

Returns:
An instance of an DiagramItem -derived class.