com.bonevich.erj.ui
Class ModeCreateForeignKey
java.lang.Object
|
+--org.tigris.gef.base.ModeImpl
|
+--org.tigris.gef.base.FigModifyingModeImpl
|
+--org.tigris.gef.base.ModeCreate
|
+--com.bonevich.erj.ui.ModeCreateForeignKey
- 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 ModeCreateForeignKey
- extends org.tigris.gef.base.ModeCreate
A Mode to interpret user input while creating an edge. Basically
mouse down starts creating an edge from a source port Fig, mouse
motion paints a rubberband line, mouse up finds the destination port
and finishes creating the edge and makes an FigEdge and sends
it to the back of the Layer.
The argument "edgeClass" determines the type if edge to suggest
that the Editor's GraphModel construct. The GraphModel is
responsible for acutally making an edge in the underlying model
and connecting it to other model elements.
- See Also:
- Serialized Form
| 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)
Create the new item that will be drawn. |
java.lang.String |
instructions()
|
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 destination port, ask the GraphModel
to connect the two ports. |
| Methods inherited from class org.tigris.gef.base.ModeCreate |
creationDrag, getInitialCursor, mouseDragged, 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, keyPressed, keyReleased, keyTyped, 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 |
ModeCreateForeignKey
public ModeCreateForeignKey()
ModeCreateForeignKey
public ModeCreateForeignKey(org.tigris.gef.base.Editor par)
instructions
public java.lang.String instructions()
- Specified by:
instructions in interface org.tigris.gef.base.FigModifyingMode- Overrides:
instructions in class org.tigris.gef.base.FigModifyingModeImpl
createNewItem
public org.tigris.gef.presentation.Fig createNewItem(java.awt.event.MouseEvent me,
int snapX,
int snapY)
- Create the new item that will be drawn. In this case I would
rather create the FigEdge when I am done. Here I just
create a rubberband FigLine to show during dragging.
- Specified by:
createNewItem in class org.tigris.gef.base.ModeCreate
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.
- Specified by:
mousePressed in interface java.awt.event.MouseListener- Overrides:
mousePressed in class org.tigris.gef.base.ModeCreate
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent me)
- On mouseReleased, find the destination port, 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.
- Specified by:
mouseReleased in interface java.awt.event.MouseListener- Overrides:
mouseReleased in class org.tigris.gef.base.ModeCreate
Copyright © 2001-2003 bonevich.com. All Rights Reserved.