|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.base.ModeImpl
org.tigris.gef.base.FigModifyingModeImpl
org.tigris.gef.base.ModeCreate
org.tigris.gef.base.ModeCreateEdgeAndNode
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.
Field Summary |
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 | |
ModeCreateEdgeAndNode()
The constructor. |
|
ModeCreateEdgeAndNode(Editor ed,
java.lang.Object edgeType,
java.lang.Object nodeType,
boolean post)
The constructor. |
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. |
void |
done()
When a Mode handles a certain event that indicates that the user wants to exit that Mode (e.g., a mouse up event after a drag in ModeCreateEdge) the Mode calls done to make switching to another Mode possible. |
java.lang.String |
instructions()
Reply a string of instructions that should be shown in the statusbar when this mode starts. |
void |
keyTyped(java.awt.event.KeyEvent ke)
|
void |
mouseDragged(java.awt.event.MouseEvent me)
On mouse drag, resize the new item as the user moves the mouse. |
void |
mouseMoved(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 destination port, ask the GraphModel to connect the two ports. |
protected void |
postProcessEdge()
|
void |
setup(org.tigris.gef.presentation.FigNode fignode,
java.lang.Object port,
int x,
int y,
boolean reverse)
|
Methods inherited from class org.tigris.gef.base.ModeCreate |
createFig, creationDrag, getInitialCursor, keyPressed, paint |
Methods inherited from class org.tigris.gef.base.FigModifyingModeImpl |
getEditor, isFigEnclosedIn, print, setCursor, setEditor |
Methods inherited from class org.tigris.gef.base.ModeImpl |
canExit, getArg, getArgs, init, keyReleased, leave, mouseClicked, mouseEntered, mouseExited, 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 |
Constructor Detail |
public ModeCreateEdgeAndNode()
public ModeCreateEdgeAndNode(Editor ed, java.lang.Object edgeType, java.lang.Object nodeType, boolean post)
ed
- the parent editor of this mode. Each Mode instance belongs to
exactly one Editor instance.edgeType
- the class of the edgenodeType
- the class of the nodepost
- if true, then the edge is postprocessed.
See postProcessEdge().Method Detail |
public void setup(org.tigris.gef.presentation.FigNode fignode, java.lang.Object port, int x, int y, boolean reverse)
fignode
- the source fignodeport
- the portx
- the x to start fromy
- the y to start fromreverse
- true if the direction is reversed, i.e.
from destination to sourcepublic java.lang.String instructions()
FigModifyingModeImpl
instructions
in interface FigModifyingMode
instructions
in class FigModifyingModeImpl
FigModifyingMode.instructions()
public org.tigris.gef.presentation.Fig createNewItem(java.awt.event.MouseEvent me, int snapX, int snapY)
createNewItem
in class ModeCreate
ModeCreate.createNewItem(
java.awt.event.MouseEvent, int, int)
public void done()
ModeImpl
done
in interface Mode
done
in class FigModifyingModeImpl
Mode.done()
public void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class ModeCreate
MouseListener.mousePressed(java.awt.event.MouseEvent)
public void mouseReleased(java.awt.event.MouseEvent me)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class ModeCreate
MouseListener.mouseReleased(java.awt.event.MouseEvent)
public void mouseMoved(java.awt.event.MouseEvent me)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class ModeImpl
MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)
public void mouseDragged(java.awt.event.MouseEvent me)
ModeCreate
Note: _newItem has not been added to any Layer yet. So you cannot use _newItem.damage(), instead use editor.damageAll(_newItem).
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class ModeCreate
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)
public void keyTyped(java.awt.event.KeyEvent ke)
keyTyped
in interface java.awt.event.KeyListener
keyTyped
in class ModeImpl
KeyListener.keyTyped(java.awt.event.KeyEvent)
protected void postProcessEdge()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |