|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler
|
+--com.rolemodelsoft.drawlet.basics.CanvasHandle
|
+--com.rolemodelsoft.drawlet.basics.LocatorConnectionHandle
This class provides a handle that allows the corresponding figure to be connected to (or disconnected from) another figure (as a slave to its location). For example, this could be used to attach a label to another figure.
| Field Summary | |
protected int |
anchorX
The x coordinate at which the handle was first pressed. |
protected int |
anchorY
The y coordinate at which the handle was first pressed. |
protected Locator |
connection
The locator at which to show the current or pending connection (or null while there is none to be displayed). |
protected Figure |
figure
The figure we may connect/disconnect. |
protected Locator |
locator
The locator at which to visibly place the handle. |
| Fields inherited from class com.rolemodelsoft.drawlet.basics.CanvasHandle |
canvas,
halfWidth,
HANDLE_SIZE,
previousTool |
| Constructor Summary | |
LocatorConnectionHandle(Figure figure)
Constructs and initializes a new instance of a handle which can connect a Figure's location to another figure |
|
| Method Summary | |
protected java.awt.Color |
defaultConnectionColor()
Answer the default Color to use to draw the connection. |
protected Locator |
defaultLocator(Figure figure)
Answer the default/initial locator. |
java.awt.Rectangle |
getBounds()
Returns the current bounds of this handle. |
protected java.awt.Rectangle |
getConnectionBounds()
Returns the current bounds of the part of this handle that identifies to what the figure is connected. |
protected java.awt.Color |
getConnectionColor()
Answer the Color to use to draw the connection. |
Figure |
getFigure()
Returns the figure associated with this handle. |
protected java.awt.Rectangle |
getLocatorBounds()
Returns the current bounds of the part of this handle that identifies the point of connection to the figure. |
boolean |
isConnected()
Answer whether or not the figure is actually connected to something |
void |
mouseDragged(java.awt.event.MouseEvent evt)
Called if the mouse is dragged (the mouse button is down). |
void |
mousePressed(java.awt.event.MouseEvent evt)
Called if the mouse is down. |
void |
mouseReleased(java.awt.event.MouseEvent evt)
Called if the mouse is released. |
void |
paint(java.awt.Graphics g)
Paints the handle. |
void |
setFigure(Figure figure)
Set the figure associated with this handle. |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.CanvasHandle |
contains,
defaultHandleSize,
finished,
getHandleHeight,
getHandleSize,
getHandleWidth,
getX,
getY,
intersects,
releaseControl,
setHandleSize,
takeControl |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler |
keyPressed,
keyReleased,
keyTyped,
mouseClicked,
mouseDoubleClicked,
mouseEntered,
mouseExited,
mouseMoved,
mouseSingleClicked |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Figure figure
protected Locator locator
protected Locator connection
protected int anchorX
protected int anchorY
| Constructor Detail |
public LocatorConnectionHandle(Figure figure)
figure - the figure which we may wish to connect/disconnect/reconnect| Method Detail |
protected java.awt.Color defaultConnectionColor()
protected Locator defaultLocator(Figure figure)
figure - the figure to return the default locator forpublic java.awt.Rectangle getBounds()
protected java.awt.Rectangle getConnectionBounds()
protected java.awt.Color getConnectionColor()
public Figure getFigure()
protected java.awt.Rectangle getLocatorBounds()
public boolean isConnected()
true if the figure is actually
connected to something;
false otherwise.public void mouseDragged(java.awt.event.MouseEvent evt)
evt - the eventpublic void mousePressed(java.awt.event.MouseEvent evt)
evt - the eventpublic void mouseReleased(java.awt.event.MouseEvent evt)
evt - the eventpublic void paint(java.awt.Graphics g)
g - the specified Graphics windowpublic void setFigure(Figure figure)
figure - the Figure to hold
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||