com.pnp.xfeature.commands
Class ChangeConstraintCommand

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

public class ChangeConstraintCommand
extends Command

The Command class used to move/reposition/rescale a node of a feature model diagram

Author:
Kamil Ekstein, created on 20.11.2004, updated on 14.3.2005 by Ondrej Rohlik

Constructor Summary
ChangeConstraintCommand()
          default constructor, calls the superclass constructor
ChangeConstraintCommand(java.lang.String label)
          default constructor, calls the superclass constructor
 
Method Summary
 void execute()
          sets the new position of the node via call of setConstraintOffset() method of FeatureNodeModel class
 boolean isAttachedParentSelected()
          getter method for attachedParentSelected
 void redo()
          sets the new position of the node via call of setConstraintOffset() method of FeatureNodeModel class
 void setAttachedParentSelected(boolean attachedParentSelected)
          setter method for attachedParentSelected
 void setConstraint(Rectangle rect)
          sets the contstraint value to the internal private variable
 void setModel(java.lang.Object model)
          sets the model of the processed node to the internal private variable and gets the current value of constraints
 void undo()
          sets the old position of the node via call of setConstraintOffset() method of FeatureNodeModel class
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeConstraintCommand

public ChangeConstraintCommand()
default constructor, calls the superclass constructor


ChangeConstraintCommand

public ChangeConstraintCommand(java.lang.String label)
default constructor, calls the superclass constructor

Parameters:
label - new name of the feature
Method Detail

setConstraint

public void setConstraint(Rectangle rect)
sets the contstraint value to the internal private variable

Parameters:
rect -

setModel

public void setModel(java.lang.Object model)
sets the model of the processed node to the internal private variable and gets the current value of constraints

Parameters:
model -

execute

public void execute()
sets the new position of the node via call of setConstraintOffset() method of FeatureNodeModel class

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

undo

public void undo()
sets the old position of the node via call of setConstraintOffset() method of FeatureNodeModel class

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

redo

public void redo()
sets the new position of the node via call of setConstraintOffset() method of FeatureNodeModel class

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

isAttachedParentSelected

public boolean isAttachedParentSelected()
getter method for attachedParentSelected

Returns:
value of attachedParentSelected

setAttachedParentSelected

public void setAttachedParentSelected(boolean attachedParentSelected)
setter method for attachedParentSelected

Parameters:
attachedParentSelected - specifies whether the selected node is atached to its parent


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