|
|||||||||
| 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.BoxSelectionHandle
A handle one can use to select figures on a canvas within a box. This would typically be used by some sort of SelectionTool, but there is nothing in the code that assumes that to be the case.
| Field Summary | |
protected int |
anchorX
The x coordinate at which the box is anchored. |
protected int |
anchorY
The y coordinate at which the box is anchored. |
protected java.awt.Rectangle |
box
The Rectangular area to search for figures. |
protected java.util.Vector |
surrounded
The figures that are surrounded. |
| Fields inherited from class com.rolemodelsoft.drawlet.basics.CanvasHandle |
canvas,
halfWidth,
HANDLE_SIZE,
previousTool |
| Constructor Summary | |
BoxSelectionHandle(int startX,
int startY,
int endX,
int endY)
Constructs and initializes a new instance with a box derived from two points. |
|
| Method Summary | |
boolean |
contains(int x,
int y)
Checks whether a specified x,y location is "inside" this handle, where x and y are defined to be relative to the coordinate system of this handle. |
java.awt.Rectangle |
getBounds()
Returns the current bounds of this handle. |
protected java.awt.Color |
getHighlightColor()
Answer the Color to use when highlighting. |
void |
mouseDragged(java.awt.event.MouseEvent evt)
Resize the selection area and make sure the ones inside are selected, and those newly outside are not. |
void |
paint(java.awt.Graphics g)
Paints the handle. |
void |
releaseControl(DrawingCanvas canvas)
Release control of the canvas and clean up if necessary. |
void |
takeControl(DrawingCanvas canvas)
Make the handle be the event handler for the canvas. |
protected void |
updateBox(int x,
int y)
Change the box of the receiver based on its anchor and a new x,y. |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.CanvasHandle |
defaultHandleSize,
finished,
getHandleHeight,
getHandleSize,
getHandleWidth,
getX,
getY,
intersects,
mouseReleased,
setHandleSize |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler |
keyPressed,
keyReleased,
keyTyped,
mouseClicked,
mouseDoubleClicked,
mouseEntered,
mouseExited,
mouseMoved,
mousePressed,
mouseSingleClicked |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.awt.Rectangle box
protected int anchorX
protected int anchorY
protected java.util.Vector surrounded
| Constructor Detail |
public BoxSelectionHandle(int startX,
int startY,
int endX,
int endY)
startX - the x coordinate of the anchor cornerstartY - the y coordinate of the anchor cornerendX - the x coordinate of the floating cornerendY - the y coordinate of the floating corner| Method Detail |
public boolean contains(int x,
int y)
x - the x coordinatey - the y coordinatetrue if the specified
x,y position is "inside this handle;
false otherwise.public java.awt.Rectangle getBounds()
protected java.awt.Color getHighlightColor()
public void mouseDragged(java.awt.event.MouseEvent evt)
evt - the eventpublic void paint(java.awt.Graphics g)
g - the specified Graphics windowpublic void releaseControl(DrawingCanvas canvas)
canvas - the canvas which the receiver is to release controlpublic void takeControl(DrawingCanvas canvas)
x - the x coordinatey - the y coordinate#locate
protected void updateBox(int x,
int y)
x - the x coordinatey - the y coordinate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||