com.pnp.xfeature.commands
Class CutCommand

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

public class CutCommand
extends Command

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

Author:
Ondrej Rohlik, 21.4.2005

Constructor Summary
CutCommand(FeatureDiagramModel diagram, FeatureNodeModel node, Clipboard cb)
          Creates command that cuts a node from feature model and saves it to the clipboard
 
Method Summary
 void execute()
          calls cutSubtree() method of the FeatureDiagramModel that cuts the node (and its whole subtree) element to DOM model and consequently updates the canvas
 void redo()
          calls execute() method
 void undo()
          calls uncutSubtree() method of the FeatureDiagramModel that returns the node to the list of nodes of its former parent to the right position and consequently updates the canvas
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CutCommand

public CutCommand(FeatureDiagramModel diagram,
                  FeatureNodeModel node,
                  Clipboard cb)
Creates command that cuts a node from feature model and saves it to the clipboard

Parameters:
diagram - the feature model
node - the parent node ToDo: rename node to parent
Method Detail

execute

public void execute()
calls cutSubtree() method of the FeatureDiagramModel that cuts the node (and its whole subtree) element to DOM model and consequently updates the canvas

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 uncutSubtree() method of the FeatureDiagramModel that returns the node to the list of nodes of its former parent to the right position and consequently updates the canvas

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


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