org.argouml.uml.diagram.sequence.ui
Class ModeCreateLink

java.lang.Object
  extended byorg.tigris.gef.base.ModeImpl
      extended byorg.tigris.gef.base.FigModifyingModeImpl
          extended byorg.tigris.gef.base.ModeCreate
              extended byorg.argouml.uml.diagram.sequence.ui.ModeCreateLink
All Implemented Interfaces:
EventListener, org.tigris.gef.base.FigModifyingMode, KeyListener, org.tigris.gef.base.Mode, MouseListener, MouseMotionListener, Serializable

public class ModeCreateLink
extends org.tigris.gef.base.ModeCreate

Mode to create a link between two figobjects. This mode extends ModeCreate and not ModeCreateEdge because ModeCreateEdge hides its variables a bit too much...

See Also:
Serialized Form

Field Summary
private static Logger LOG
           
private  Object newEdge
          The new NetEdge that is being created
private  org.tigris.gef.presentation.FigNode sourceFigNode
          The FigNode on the NetNode that owns the start port
private  Object startPort
          The NetPort where the arc is paintn from
private  org.tigris.gef.presentation.Fig startPortFig
          The Fig that presents the starting NetPort
 
Fields inherited from class org.tigris.gef.base.ModeCreate
_defaultHeight, _defaultWidth, _newItem, anchorX, anchorY
 
Fields inherited from class org.tigris.gef.base.FigModifyingModeImpl
editor
 
Fields inherited from class org.tigris.gef.base.ModeImpl
_args
 
Constructor Summary
ModeCreateLink()
          The constructor.
ModeCreateLink(org.tigris.gef.base.Editor par)
          The constructor.
 
Method Summary
 org.tigris.gef.presentation.Fig createNewItem(MouseEvent me, int snapX, int snapY)
           
 String instructions()
           
 void mouseDragged(MouseEvent me)
           
 void mousePressed(MouseEvent me)
          On mousePressed determine what port the user is dragging from.
 void mouseReleased(MouseEvent me)
          On mouseReleased, find the port in the destination node that's on the same height as the source port fig, ask the GraphModel to connect the two ports.
 
Methods inherited from class org.tigris.gef.base.ModeCreate
createFig, creationDrag, getInitialCursor, keyPressed, paint
 
Methods inherited from class org.tigris.gef.base.FigModifyingModeImpl
done, getEditor, isFigEnclosedIn, print, setCursor, setEditor
 
Methods inherited from class org.tigris.gef.base.ModeImpl
canExit, getArg, getArgs, init, keyReleased, keyTyped, leave, mouseClicked, mouseEntered, mouseExited, mouseMoved, setArg, setArgs, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.tigris.gef.base.Mode
canExit, getArg, getArgs, init, setArg, setArgs, start
 

Field Detail

LOG

private static final Logger LOG

startPort

private Object startPort
The NetPort where the arc is paintn from


startPortFig

private org.tigris.gef.presentation.Fig startPortFig
The Fig that presents the starting NetPort


sourceFigNode

private org.tigris.gef.presentation.FigNode sourceFigNode
The FigNode on the NetNode that owns the start port


newEdge

private Object newEdge
The new NetEdge that is being created

Constructor Detail

ModeCreateLink

public ModeCreateLink()
The constructor.


ModeCreateLink

public ModeCreateLink(org.tigris.gef.base.Editor par)
The constructor.

Parameters:
par - the editor
Method Detail

createNewItem

public org.tigris.gef.presentation.Fig createNewItem(MouseEvent me,
                                                     int snapX,
                                                     int snapY)
See Also:
ModeCreate.createNewItem( java.awt.event.MouseEvent, int, int)

instructions

public String instructions()
See Also:
FigModifyingMode.instructions()

mousePressed

public void mousePressed(MouseEvent me)
On mousePressed determine what port the user is dragging from. The mousePressed event is sent via ModeSelect.

See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseReleased

public void mouseReleased(MouseEvent me)
On mouseReleased, find the port in the destination node that's on the same height as the source port fig, ask the GraphModel to connect the two ports. If that connection is allowed, then construct a new FigEdge and add it to the Layer and send it to the back.

See Also:
MouseListener.mouseReleased(java.awt.event.MouseEvent)

mouseDragged

public void mouseDragged(MouseEvent me)
See Also:
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)


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