UML

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

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

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

Comand to reconnect the graph edge


Constructor Summary
GraphEdgeReconnectCommand(BaseEditPart newEdit, MessageEditPart edgeEdit, boolean isStart, org.eclipse.draw2d.geometry.Point newP)
          Constructor
 
Method Summary
 void execute()
          get the old values and set the new ones
 GraphEdge getGraphEdge()
          Get the graph edge
 GraphEdgeEditPart getGraphEdgeEdit()
          Get the edit part of the edge
 GraphNode getNewNode()
          Get the new node
 BaseEditPart getNewNodeEdit()
          Get the edit part of the new node
 org.eclipse.draw2d.geometry.Point getNewPos()
          Get the new position
 GraphNode getOldNode()
          Get the old graph node
 BaseEditPart getOldNodeEdit()
          Get the edit part of the old node
 org.eclipse.draw2d.geometry.Point getOldPos()
          Get the old position
protected  void getOldValues()
          Get the old values
 boolean isMovingStartAnchor()
          Return if this is start anchor which is moved
 void redo()
          Graphically reconnect the message
protected  void setModelValues()
          Set the values on the model.
 void setNewPos(org.eclipse.draw2d.geometry.Point newP)
          Set the new position
protected  void setValues()
          Set the new values
protected  void switchValues()
          Swicth bewteen the old and new values
 void undo()
          Undo the reconnection graphically
 
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

GraphEdgeReconnectCommand

public GraphEdgeReconnectCommand(BaseEditPart newEdit,
                                 MessageEditPart edgeEdit,
                                 boolean isStart,
                                 org.eclipse.draw2d.geometry.Point newP)
Constructor

Parameters:
newEdit - the edit part of the new receiving node
edgeEdit - the edit part of the graph edge
isStart - set it to true if the source is reconnected
newP - the new position of the connector
Method Detail

isMovingStartAnchor

public boolean isMovingStartAnchor()
Return if this is start anchor which is moved

Returns:
true if the start anchor is moved

getGraphEdge

public GraphEdge getGraphEdge()
Get the graph edge

Returns:
the graph edge

getNewNode

public GraphNode getNewNode()
Get the new node

Returns:
the new graph node

getNewNodeEdit

public BaseEditPart getNewNodeEdit()
Get the edit part of the new node

Returns:
the edit part of the new node

getOldNode

public GraphNode getOldNode()
Get the old graph node

Returns:
the old node

getOldNodeEdit

public BaseEditPart getOldNodeEdit()
Get the edit part of the old node

Returns:
the edit part of the old node

getGraphEdgeEdit

public GraphEdgeEditPart getGraphEdgeEdit()
Get the edit part of the edge

Returns:
the edit part of the edge

getNewPos

public org.eclipse.draw2d.geometry.Point getNewPos()
Get the new position

Returns:
the new position

setNewPos

public void setNewPos(org.eclipse.draw2d.geometry.Point newP)
Set the new position

Parameters:
newP - the new position

getOldPos

public org.eclipse.draw2d.geometry.Point getOldPos()
Get the old position

Returns:
the old position

getOldValues

protected void getOldValues()
Get the old values


setValues

protected void setValues()
Set the new values


setModelValues

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


switchValues

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


execute

public void execute()
get the old values and set the new ones

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

redo

public void redo()
Graphically reconnect the message

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

undo

public void undo()
Undo the reconnection graphically

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

UML

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