|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractHandle
org.jhotdraw.standard.LocatorHandle
org.jhotdraw.standard.ConnectionHandle
A handle to connect figures. The connection object to be created is specified by a prototype.
Prototype
ConnectionHandle creates the connection by cloning a prototype.
ConnectionFigure
,
Object.clone()
Field Summary |
Fields inherited from class org.jhotdraw.standard.AbstractHandle |
HANDLESIZE |
Constructor Summary | |
ConnectionHandle(Figure owner,
Locator l,
ConnectionFigure prototype)
Constructs a handle with the given owner, locator, and connection prototype |
Method Summary | |
protected ConnectionFigure |
createConnection()
Creates the ConnectionFigure. |
protected Undoable |
createUndoActivity(DrawingView view)
Factory method for undo activity. |
void |
draw(java.awt.Graphics g)
Draws the connection handle, by default the outline of a blue circle. |
protected Connector |
findConnectionTarget(int x,
int y,
Drawing drawing)
Finds a connection end figure. |
protected Connector |
findConnector(int x,
int y,
Figure f)
|
protected ConnectionFigure |
getConnection()
|
Cursor |
getCursor()
Returns the preferred Cursor for this Handle. |
protected Figure |
getTargetFigure()
|
void |
invokeEnd(int x,
int y,
int anchorX,
int anchorY,
DrawingView view)
Connects the figures if the mouse is released over another figure. |
void |
invokeStart(int x,
int y,
DrawingView view)
Creates the connection |
void |
invokeStep(int x,
int y,
int anchorX,
int anchorY,
DrawingView view)
Tracks the connection. |
protected void |
setConnection(ConnectionFigure newConnection)
|
protected void |
setTargetFigure(Figure newTargetFigure)
|
Methods inherited from class org.jhotdraw.standard.LocatorHandle |
getLocator, locate |
Methods inherited from class org.jhotdraw.standard.AbstractHandle |
containsPoint, displayBox, getUndoActivity, invokeEnd, invokeStart, invokeStep, owner, setUndoActivity |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConnectionHandle(Figure owner, Locator l, ConnectionFigure prototype)
Method Detail |
public void invokeStart(int x, int y, DrawingView view)
invokeStart
in interface Handle
invokeStart
in class AbstractHandle
x
- the x position where the interaction startedy
- the y position where the interaction startedview
- the handles containerHandle.invokeStart(int, int, org.jhotdraw.framework.DrawingView)
public void invokeStep(int x, int y, int anchorX, int anchorY, DrawingView view)
invokeStep
in interface Handle
invokeStep
in class AbstractHandle
x
- the current x positiony
- the current y positionanchorX
- the x position where the interaction startedanchorY
- the y position where the interaction startedHandle.invokeStep(int, int, int, int, org.jhotdraw.framework.DrawingView)
public void invokeEnd(int x, int y, int anchorX, int anchorY, DrawingView view)
invokeEnd
in interface Handle
invokeEnd
in class AbstractHandle
x
- the current x positiony
- the current y positionanchorX
- the x position where the interaction startedanchorY
- the y position where the interaction startedHandle.invokeEnd(int, int, int, int, org.jhotdraw.framework.DrawingView)
protected ConnectionFigure createConnection()
protected Undoable createUndoActivity(DrawingView view)
protected Connector findConnectionTarget(int x, int y, Drawing drawing)
protected Connector findConnector(int x, int y, Figure f)
public void draw(java.awt.Graphics g)
draw
in interface Handle
draw
in class AbstractHandle
Handle.draw(java.awt.Graphics)
protected void setConnection(ConnectionFigure newConnection)
protected ConnectionFigure getConnection()
protected Figure getTargetFigure()
protected void setTargetFigure(Figure newTargetFigure)
public Cursor getCursor()
Handle
getCursor
in interface Handle
getCursor
in class LocatorHandle
Handle.getCursor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |