com.pnp.xfeature.commands
Class RemoveNodeCommand

java.lang.Object
  extended by Command
      extended by com.pnp.xfeature.commands.RemoveNodeCommand

public class RemoveNodeCommand
extends Command

The Command class used to remove a node from a feature model diagram

Author:
Kamil Ekstein, created on 13.11.2004, totally redesigned on 12.3.2005 by Ondrej Rohlik

Constructor Summary
RemoveNodeCommand(FeatureDiagramModel diagram, FeatureNodeModel node)
          Creates command that removes a node from its parent node
 
Method Summary
 void execute()
          calls the removeNode() method of the FeatureDiagramModel class that saves the position of the node and removes it from its parent node and refresh canvas afterwards
 void redo()
          calls execute() method
 void undo()
          calls returnNode() method of FeatureDiagramModel class that inserts the node to its original position in the DOM model and refresh canvas afterwards
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoveNodeCommand

public RemoveNodeCommand(FeatureDiagramModel diagram,
                         FeatureNodeModel node)
Creates command that removes a node from its parent node

Parameters:
diagram - feature model
node - node to be removed
Method Detail

execute

public void execute()
calls the removeNode() method of the FeatureDiagramModel class that saves the position of the node and removes it from its parent node and refresh canvas afterwards

See Also:
org.eclipse.gef.commands.Command#execute()

redo

public void redo()
calls execute() method

See Also:
org.eclipse.gef.commands.Command#redo()

undo

public void undo()
calls returnNode() method of FeatureDiagramModel class that inserts the node to its original position in the DOM model and refresh canvas afterwards

See Also:
org.eclipse.gef.commands.Command#undo()


Copyright © 2004 - 2008 ETH Zurich and P&P Software GmbH, All Rights Reserved.