|
|||||||||
| 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.SquareCanvasHandle
|
+--com.rolemodelsoft.drawlet.shapes.lines.ConnectedLineCreationHandle
This class provides a handle that creates connected lines from one figure to another.
| Field Summary | |
protected Figure |
figure
The figure to which the handle is attached. |
protected ConnectingLine |
line
The line being constructed. |
protected Locator |
locator
The location at which the handle is displayed which will also serve as a prototype of the starting point of any line. |
| Fields inherited from class com.rolemodelsoft.drawlet.basics.CanvasHandle |
canvas,
halfWidth,
HANDLE_SIZE,
previousTool |
| Constructor Summary | |
ConnectedLineCreationHandle(Figure figure)
Construct and initialize a handle that will create connecting lines from a figure to some other figure. |
|
ConnectedLineCreationHandle(Figure figure,
Locator locator)
Construct and initialize a handle that will create connecting lines from a figure to some other figure. |
|
| Method Summary | |
protected ConnectingLine |
basicNewLine(Locator point)
Answers a new ConnectingLine. |
protected int |
centerX()
Answer the x coordinate at the center of the handle. |
protected int |
centerY()
Answer the y coordinate at the center of the handle. |
protected Locator |
defaultLocator(Figure figure)
Answer the default/initial locator. |
Figure |
getFigure()
Returns the figure associated with this handle. |
protected void |
mouseDoubleClicked(java.awt.event.MouseEvent evt)
Called if the mouse is double-clicked. |
void |
mouseDragged(java.awt.event.MouseEvent evt)
Called if the mouse is dragged (the mouse button is down). |
void |
mouseMoved(java.awt.event.MouseEvent evt)
Called if the mouse is moved (the mouse button is up). |
void |
mousePressed(java.awt.event.MouseEvent evt)
Called when the mouse goes down. |
void |
mouseReleased(java.awt.event.MouseEvent evt)
Called if the mouse goes up. |
protected void |
movePoint(int pointIndex,
int x,
int y)
Move the identified point of the line. |
void |
paint(java.awt.Graphics g)
Paints the handle. |
void |
releaseControl(DrawingCanvas canvas)
Release control of the canvas and clean up if necessary. |
void |
setFigure(Figure figure)
Set the figure associated with this handle. |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.SquareCanvasHandle |
getBounds |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.CanvasHandle |
contains,
defaultHandleSize,
finished,
getHandleHeight,
getHandleSize,
getHandleWidth,
getX,
getY,
intersects,
setHandleSize,
takeControl |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler |
keyPressed,
keyReleased,
keyTyped,
mouseClicked,
mouseEntered,
mouseExited,
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 ConnectingLine line
| Constructor Detail |
public ConnectedLineCreationHandle(Figure figure)
figure - the figure to which the handle is attached.
public ConnectedLineCreationHandle(Figure figure,
Locator locator)
figure - the figure to which the handle is attached.locator - the locator at which to locate the handle and beginning of any lines.| Method Detail |
protected ConnectingLine basicNewLine(Locator point)
point - the point at which the new line should start.protected int centerX()
protected int centerY()
protected Locator defaultLocator(Figure figure)
figure - the Figure the Locator is to be relative to.public Figure getFigure()
protected void mouseDoubleClicked(java.awt.event.MouseEvent evt)
evt - the eventpublic void mouseDragged(java.awt.event.MouseEvent evt)
evt - the eventmovePoint(int, int, int)public void mouseMoved(java.awt.event.MouseEvent evt)
evt - the eventmovePoint(int, int, int)public void mousePressed(java.awt.event.MouseEvent evt)
evt - the eventpublic void mouseReleased(java.awt.event.MouseEvent evt)
evt - the event
protected void movePoint(int pointIndex,
int x,
int y)
pointIndex - the index of the point to move.x - the x coordinatey - the y coordinatepublic void paint(java.awt.Graphics g)
g - the specified Graphics windowpublic void releaseControl(DrawingCanvas canvas)
canvas - the canvas which the receiver is to release control of.public void setFigure(Figure figure)
figure - the Figure to associate with.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||