Modelers

org.topcased.modeler.commands
Class ReplaceNodeContainerCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by org.topcased.modeler.commands.ReplaceNodeContainerCommand

public class ReplaceNodeContainerCommand
extends org.eclipse.gef.commands.Command

The command to replace one object inside a new container. Because we treat with containment references, the deletion and the addition of objects from containers take place here. Any other treatment, such as supplementary feature modification, may be done by overriding the getOrphandChildenCommand() of a LayoutEditPolicy.

See Also:
LayoutEditPolicy

Constructor Summary
ReplaceNodeContainerCommand(GraphElement currentObject, GraphElement hostNode, org.eclipse.draw2d.geometry.Point position)
          Node ContainerCommand Constructor.
 
Method Summary
 boolean canExecute()
           
 void execute()
           
 void redo()
           
protected  void redoGraphics()
          Updates the diagram graphically
protected  void redoModel()
          Model modification made here
 void setSynchronization(boolean isSynchronized)
          Sets the parameter which says if model will refresh graphics automatically or not
 void undo()
           
protected  void undoGraphics()
          Undo any graphical modification made by redoGraphics() method
protected  void undoModel()
          Undo any model modification made by the redoModel() method
 
Methods inherited from class org.eclipse.gef.commands.Command
canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceNodeContainerCommand

public ReplaceNodeContainerCommand(GraphElement currentObject,
                                   GraphElement hostNode,
                                   org.eclipse.draw2d.geometry.Point position)
Node ContainerCommand Constructor. Creates a command to place the current object into the new host node

Parameters:
currentObject - The node being manipulated
hostNode - The node or container to contain the manipulated node
position - The position relative to the hostNode
Method Detail

canExecute

public boolean canExecute()
Overrides:
canExecute in class org.eclipse.gef.commands.Command
See Also:
Command.canExecute()

execute

public void execute()
Overrides:
execute in class org.eclipse.gef.commands.Command
See Also:
Command.execute()

redo

public void redo()
Overrides:
redo in class org.eclipse.gef.commands.Command
See Also:
Command.redo()

undo

public void undo()
Overrides:
undo in class org.eclipse.gef.commands.Command
See Also:
Command.undo()

setSynchronization

public void setSynchronization(boolean isSynchronized)
Sets the parameter which says if model will refresh graphics automatically or not

Parameters:
isSynchronized - True if model is synchronized The default value is false;

redoModel

protected void redoModel()
Model modification made here


redoGraphics

protected void redoGraphics()
Updates the diagram graphically


undoModel

protected void undoModel()
Undo any model modification made by the redoModel() method


undoGraphics

protected void undoGraphics()
Undo any graphical modification made by redoGraphics() method


Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.