org.argouml.uml.diagram.sequence.ui
Class ModeCreateLink
java.lang.Object
org.tigris.gef.base.ModeImpl
org.tigris.gef.base.FigModifyingModeImpl
org.tigris.gef.base.ModeCreate
org.argouml.uml.diagram.sequence.ui.ModeCreateLink
- All Implemented Interfaces:
- java.util.EventListener, org.tigris.gef.base.FigModifyingMode, java.awt.event.KeyListener, org.tigris.gef.base.Mode, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.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 java.lang.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 java.lang.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 |
Method Summary |
org.tigris.gef.presentation.Fig |
createNewItem(java.awt.event.MouseEvent me,
int snapX,
int snapY)
|
java.lang.String |
instructions()
|
void |
mouseDragged(java.awt.event.MouseEvent me)
|
void |
mousePressed(java.awt.event.MouseEvent me)
On mousePressed determine what port the user is dragging from. |
void |
mouseReleased(java.awt.event.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 |
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 |
_startPort
private java.lang.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 java.lang.Object _newEdge
- The new NetEdge that is being created
ModeCreateLink
public ModeCreateLink()
ModeCreateLink
public ModeCreateLink(org.tigris.gef.base.Editor par)
createNewItem
public org.tigris.gef.presentation.Fig createNewItem(java.awt.event.MouseEvent me,
int snapX,
int snapY)
instructions
public java.lang.String instructions()
mousePressed
public void mousePressed(java.awt.event.MouseEvent me)
- On mousePressed determine what port the user is dragging from.
The mousePressed event is sent via ModeSelect.
mouseReleased
public void mouseReleased(java.awt.event.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.
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent me)