com.pnp.xfeature.commands
Class RemoveCardinalityCommand

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

public class RemoveCardinalityCommand
extends Command

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

Author:
Ondrej Rohlik, created on 13.4.2005

Constructor Summary
RemoveCardinalityCommand(FeatureDiagramModel diagram, FeatureNodeModel node)
          Creates command that removes a cardinality from node
 
Method Summary
 void execute()
          calls the removeCardinality() method of the FeatureDiagramModel class that saves the position of the cardinality node and removes it from its parent node and refresh canvas afterwards
 int getNodeLastPosition()
          returns the last position of the cardinality node in the list of child nodes of its parent
 void redo()
          calls execute() method
 void undo()
          calls returnCardinality() method of FeatureDiagramModel class that inserts the cardinality 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

RemoveCardinalityCommand

public RemoveCardinalityCommand(FeatureDiagramModel diagram,
                                FeatureNodeModel node)
Creates command that removes a cardinality from node

Parameters:
diagram - feature model
node - parent node with the cardinality to be removed
Method Detail

execute

public void execute()
calls the removeCardinality() method of the FeatureDiagramModel class that saves the position of the cardinality 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 returnCardinality() method of FeatureDiagramModel class that inserts the cardinality node to its original position in the DOM model and refresh canvas afterwards

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

getNodeLastPosition

public int getNodeLastPosition()
returns the last position of the cardinality node in the list of child nodes of its parent

Returns:
nodeLastPosition


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