org.argouml.uml.diagram.ui
Class SelectionRerouteEdge

java.lang.Object
  |
  +--SelectionReshape
        |
        +--org.argouml.uml.diagram.ui.SelectionEdgeClarifiers
              |
              +--org.argouml.uml.diagram.ui.SelectionRerouteEdge

public class SelectionRerouteEdge
extends SelectionEdgeClarifiers

A general class for rerouting edges, achieved by delegating the re-routing logic to the graphmodels; extends functionality in SelectionEdgeClarifiers.

If a gragphmodel does not override canChangeConnectedNode() then rerouting is not possible and argo should behave as if rerouting had never been implemented.

Since:
0.13.2
See Also:
Serialized Form

Field Summary
private  boolean armed
          the re-routing capability it armed if the mouse was previously dragged.
private  FigNodeModelElement destFig
          used to determine if the association is now to self, in which case The association needs automatic layout.
private  int pointIndex
          the index of the point on the line of the message.
private  FigNodeModelElement sourceFig
          used to determine if the association is now to self, in which case The association needs automatic layout.
 
Constructor Summary
SelectionRerouteEdge(FigEdgeModelElement feme)
          Creates a new instance of SelectionRerouteEdge
 
Method Summary
 void mouseDragged(java.awt.event.MouseEvent me)
          need to 'arm' the rerouting capability with mouseDragged().
 void mousePressed(java.awt.event.MouseEvent me)
          set up for re-routing.
 void mouseReleased(java.awt.event.MouseEvent me)
          perform re-routing if src/dest nodes have changed.
 
Methods inherited from class org.argouml.uml.diagram.ui.SelectionEdgeClarifiers
paint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceFig

private FigNodeModelElement sourceFig
used to determine if the association is now to self, in which case The association needs automatic layout.


destFig

private FigNodeModelElement destFig
used to determine if the association is now to self, in which case The association needs automatic layout.


armed

private boolean armed

the re-routing capability it armed if the mouse was previously dragged.

prevents just selecting the message then clicking somewhere else on the diagram,


pointIndex

private int pointIndex

the index of the point on the line of the message.

0 = sender end

1..* = receiver end

Constructor Detail

SelectionRerouteEdge

public SelectionRerouteEdge(FigEdgeModelElement feme)
Creates a new instance of SelectionRerouteEdge

Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
set up for re-routing.


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)

need to 'arm' the rerouting capability with mouseDragged().

don't arm if the edtior's current mode is a figedge create mode, because once a new edge has been created it is not deselected, therefore on the next create an unwanted reroute is performed.


mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)

perform re-routing if src/dest nodes have changed.

this method needs to be 'armed' by a previous mouseDragged() to avoid the situation where the user just clicks on the message then clicks on some unrelated Fig, without moving the association...

TODO: improve the fig finding algorithm to find the top most fig in the layer. will be useful for nested states in a statechart.



ArgoUML © 1996-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook