UML

org.topcased.modeler.uml.sequencediagram.commands.reconnect
Class GraphEdgeMoveCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by org.topcased.modeler.uml.sequencediagram.commands.reconnect.GraphEdgeMoveCommand
Direct Known Subclasses:
MessageMoveCommand

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

Command that moves a graph edge


Constructor Summary
GraphEdgeMoveCommand(GraphEdgeEditPart edgeEdit, org.eclipse.draw2d.geometry.Point initialPos, org.eclipse.draw2d.geometry.Point newPos)
          Constructor
 
Method Summary
 void execute()
          Get the old values then set the new values
 GraphEdgeEditPart getGraphEdgeEdit()
          Return the edit part of the graph edge
 org.eclipse.draw2d.geometry.Point getNewSourcePosition()
          Return the new position of the source
 org.eclipse.draw2d.geometry.Point getNewTargetPosition()
          Return the new position of the target
protected  void getValues()
          Get the old and new values
 void redo()
          Set the new values
protected  void setModelValues()
          Set the values on the model.
protected  void setValues()
          Set the values on the edge
protected  void switchValues()
          Swicth between the new and old values
 void undo()
          Set the old values
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, 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

GraphEdgeMoveCommand

public GraphEdgeMoveCommand(GraphEdgeEditPart edgeEdit,
                            org.eclipse.draw2d.geometry.Point initialPos,
                            org.eclipse.draw2d.geometry.Point newPos)
Constructor

Parameters:
edgeEdit - the edit part of the graph edge to move
initialPos - the initial position of the connection
newPos - the new position of the connection
Method Detail

getGraphEdgeEdit

public GraphEdgeEditPart getGraphEdgeEdit()
Return the edit part of the graph edge

Returns:
the edit part of the graph edge

getNewSourcePosition

public org.eclipse.draw2d.geometry.Point getNewSourcePosition()
Return the new position of the source

Returns:
the new position of the source

getNewTargetPosition

public org.eclipse.draw2d.geometry.Point getNewTargetPosition()
Return the new position of the target

Returns:
the new position of the target

getValues

protected void getValues()
Get the old and new values


setValues

protected void setValues()
Set the values on the edge


switchValues

protected void switchValues()
Swicth between the new and old values


setModelValues

protected void setModelValues()
Set the values on the model. Should be overrided by sub classes


execute

public void execute()
Get the old values then set the new values

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

redo

public void redo()
Set the new values

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

undo

public void undo()
Set the old values

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

UML

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