com.mindfusion.diagramming
Class AddToContainerCmd

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

public class AddToContainerCmd
extends Command


Constructor Summary
protected AddToContainerCmd(ContainerNode container, DiagramNodeList nodes, boolean interactive)
          Intializes a new instance of the AddToContainerCmd class.
 
Method Summary
protected  boolean adopt(Command command)
          Merges adjacent commands in the history queue if they are related.
 void execute(boolean undoEnabled)
          Carries out the command action.
 ContainerNode getContainer()
          Gets the container node associated with the command.
 DiagramNodeList getNodes()
          Gets the item associated with the command.
protected  boolean isContainerOf(Command command)
          Determines whether a command has been initiated by this command and should be treated as a derivative.
 void redo()
          Redoes the command.
 void undo()
          Undoes the command.
 
Methods inherited from class com.mindfusion.diagramming.Command
addSubCmd, getContext, getSubCommands, getTitle, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddToContainerCmd

protected AddToContainerCmd(ContainerNode container,
                            DiagramNodeList nodes,
                            boolean interactive)
Intializes a new instance of the AddToContainerCmd class.

Method Detail

execute

public void execute(boolean undoEnabled)
Carries out the command action.

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

undo

public void undo()
Undoes the command.

Overrides:
undo in class Command

redo

public void redo()
Redoes the command.

Overrides:
redo in class Command

isContainerOf

protected boolean isContainerOf(Command command)
Determines whether a command has been initiated by this command and should be treated as a derivative.

Overrides:
isContainerOf in class Command
Parameters:
command - The Command for which to determine whether it is a derivative.
Returns:
true if the specified command should be considered a derivative; otherwise, false.

adopt

protected boolean adopt(Command 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.

getContainer

public ContainerNode getContainer()
Gets the container node associated with the command.


getNodes

public DiagramNodeList getNodes()
Gets the item associated with the command.