com.rolemodelsoft.drawlet.shapes.lines
Class ConnectingLinePointHandle
java.lang.Object
|
+--com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler
|
+--com.rolemodelsoft.drawlet.basics.CanvasHandle
|
+--com.rolemodelsoft.drawlet.basics.SquareCanvasHandle
|
+--com.rolemodelsoft.drawlet.shapes.lines.LinePointHandle
|
+--com.rolemodelsoft.drawlet.shapes.lines.ConnectingLinePointHandle
- public class ConnectingLinePointHandle
- extends LinePointHandle
This class provides a handle that shows up at a particular Locator on a line
and reshapes the figure accordingly as it is dragged, potentially turning
the specific locator into one relative to another figure.
|
Constructor Summary |
ConnectingLinePointHandle(LineFigure figure,
int index)
Constructs and initializes a new instance of a handle which can
affect the the position of a particular point defining a line and
connect that point to a figure if appropriate. |
|
Method Summary |
protected boolean |
isConnected()
Answer whether the handle's locator is connected to a figure (or about
to request it). |
void |
mouseReleased(java.awt.event.MouseEvent evt)
Called if the mouse goes up. |
void |
paint(java.awt.Graphics g)
Paints the 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 java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ConnectingLinePointHandle
public ConnectingLinePointHandle(LineFigure figure,
int index)
- Constructs and initializes a new instance of a handle which can
affect the the position of a particular point defining a line and
connect that point to a figure if appropriate.
- Parameters:
figure - the figure whose point (vertex) we may wish to modify.index - the identifying index of the point of interest.
isConnected
protected boolean isConnected()
- Answer whether the handle's locator is connected to a figure (or about
to request it).
- Returns:
- boolean value of
true if the handle's locator is
connected to a figure (or about to request it);
false otherwise.
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent evt)
- Called if the mouse goes up.
If there is a figure at the given point, connect to it if possible before
giving up control.
- Overrides:
- mouseReleased in class LinePointHandle
- Parameters:
evt - the event
paint
public void paint(java.awt.Graphics g)
- Paints the handle.
- Overrides:
- paint in class SquareCanvasHandle
- Parameters:
g - the specified Graphics window