|
|||||||||||
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.argouml.uml.diagram.ui.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 | |
private boolean |
destToSource
False if drawing from source and destination. |
private static int |
dragsToExisting
|
private static int |
dragsToNew
|
private org.tigris.gef.presentation.FigEdge |
fe
|
private org.tigris.gef.presentation.FigNode |
fn
|
private org.tigris.gef.presentation.Handle |
handle
The number of points added so far. |
private static Logger |
LOG
Logger. |
private Object |
newEdge
The new NetEdge that is being created. |
private boolean |
postProcessEdge
|
(package private) static long |
serialVersionUID
|
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 | |
ModeCreateEdgeAndNode()
The constructor. |
|
ModeCreateEdgeAndNode(org.tigris.gef.base.Editor ed,
Object edgeType,
Object nodeType,
boolean post)
The constructor. |
Method Summary | |
org.tigris.gef.presentation.Fig |
createNewItem(MouseEvent me,
int snapX,
int snapY)
Create the new item that will be drawn. |
void |
done()
|
String |
instructions()
|
void |
keyTyped(KeyEvent ke)
|
void |
mouseDragged(MouseEvent me)
|
void |
mouseMoved(MouseEvent me)
|
void |
mousePressed(MouseEvent me)
On mousePressed determine what port the user is dragging from. |
void |
mouseReleased(MouseEvent me)
On mouseReleased, find the destination port, ask the GraphModel to connect the two ports. |
private void |
postProcessEdge()
|
void |
setup(org.tigris.gef.presentation.FigNode fignode,
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 |
Field Detail |
private static final Logger LOG
private static int dragsToExisting
private static int dragsToNew
private Object startPort
private org.tigris.gef.presentation.Fig startPortFig
private org.tigris.gef.presentation.FigNode sourceFigNode
private Object newEdge
private boolean destToSource
private org.tigris.gef.presentation.Handle handle
private org.tigris.gef.presentation.FigNode fn
private org.tigris.gef.presentation.FigEdge fe
private boolean postProcessEdge
static final long serialVersionUID
Constructor Detail |
public ModeCreateEdgeAndNode()
public ModeCreateEdgeAndNode(org.tigris.gef.base.Editor ed, Object edgeType, 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, 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 String instructions()
FigModifyingMode.instructions()
public org.tigris.gef.presentation.Fig createNewItem(MouseEvent me, int snapX, int snapY)
ModeCreate.createNewItem(
java.awt.event.MouseEvent, int, int)
public void done()
Mode.done()
public void mousePressed(MouseEvent me)
MouseListener.mousePressed(java.awt.event.MouseEvent)
public void mouseReleased(MouseEvent me)
MouseListener.mouseReleased(java.awt.event.MouseEvent)
public void mouseMoved(MouseEvent me)
MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)
public void mouseDragged(MouseEvent me)
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)
public void keyTyped(KeyEvent ke)
KeyListener.keyTyped(java.awt.event.KeyEvent)
private void postProcessEdge()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |