org.argouml.uml.diagram.ui
Class SelectionRerouteEdge

java.lang.Object
  |
  +--org.tigris.gef.base.Selection
        |
        +--org.tigris.gef.base.SelectionReshape
              |
              +--org.argouml.uml.diagram.ui.SelectionEdgeClarifiers
                    |
                    +--org.argouml.uml.diagram.ui.SelectionRerouteEdge
All Implemented Interfaces:
java.util.EventListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

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

Fields inherited from class org.tigris.gef.base.SelectionReshape
_selectedHandle
 
Fields inherited from class org.tigris.gef.base.Selection
_content, BORDER_WIDTH, HAND_SIZE
 
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 org.tigris.gef.base.SelectionReshape
dragHandle, hitHandle, keyPressed, keyReleased, keyTyped, updateEdgeEnds
 
Methods inherited from class org.tigris.gef.base.Selection
contains, contains, contains, damage, delete, dispose, endTrans, getBounds, getContent, getContentBounds, getLocation, getLocked, hit, hitHandle, mouseClicked, mouseEntered, mouseExited, mouseMoved, print, reorder, setcontent, startTrans, stuffBounds, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.
Overrides:
mousePressed in class org.tigris.gef.base.Selection

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.

Overrides:
mouseDragged in class org.tigris.gef.base.Selection

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.

Overrides:
mouseReleased in class org.tigris.gef.base.Selection


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook