com.pnp.xfeature.commands
Class AddCommand

java.lang.Object
  extended by Command
      extended by com.pnp.xfeature.commands.AddCommand
Direct Known Subclasses:
AddCardinalityCommand, AddConstraintCommand, AddNodeCommand, AddPropertyCommand, AddPropertySetCommand

public class AddCommand
extends Command

A base class of all commands used to add a new XML elements to a feature model diagram or a global constraints file

Author:
Ondrej Rohlik, created on 20.3.2004

Constructor Summary
AddCommand(FeatureDiagramModel diagram, FeatureNodeModel parent, java.lang.String childNodeType, int nodePosition)
          Creates command that adds new (generic) element to the feature model
 
Method Summary
 void execute()
          This method is to be overridden in subclasses
 int getNodePosition()
          getter method for nodePosition attribute
 void redo()
          This method is to be overridden in subclasses
 void undo()
          This method is to be overridden in subclasses
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddCommand

public AddCommand(FeatureDiagramModel diagram,
                  FeatureNodeModel parent,
                  java.lang.String childNodeType,
                  int nodePosition)
Creates command that adds new (generic) element to the feature model

Parameters:
diagram - the feature model
parent - the parent node
childNodeType - the type o node that is to be added
nodePosition - position where the new element is to be inserted (among other siblings)
Method Detail

execute

public void execute()
This method is to be overridden in subclasses

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

redo

public void redo()
This method is to be overridden in subclasses

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

undo

public void undo()
This method is to be overridden in subclasses

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

getNodePosition

public int getNodePosition()
getter method for nodePosition attribute



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