|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
A tool defines a mode of the drawing view, intendid to be set over a tool bar. An example of a tool is the construction of new figures. Whenever a new tool is activated or deactivated, the corresponding methods are called. This can be used to e.g. adjust the mouse cursor depending on the current tool.
All input events targeted to the drawing view are forwarded to its current tool.
Figure| Method Summary | |
void |
activate()
Activates the tool for the given view. |
void |
deactivate()
Deactivates the tool. |
void |
mouseDown(int x,
int y,
java.awt.event.MouseEvent e)
Handles mouse down events in the drawing view. |
void |
mouseDrag(int x,
int y,
java.awt.event.MouseEvent e)
Handles mouse drag events in the drawing view. |
void |
mouseUp(int x,
int y,
java.awt.event.MouseEvent e)
Handles mouse up in the drawing view. |
| Method Detail |
public void activate()
public void deactivate()
public void mouseDown(int x,
int y,
java.awt.event.MouseEvent e)
x - x coordinate of mouse positiony - y coordinate of mouse positione - mouse event, contains state of modifiers
public void mouseDrag(int x,
int y,
java.awt.event.MouseEvent e)
x - x coordinate of mouse positiony - y coordinate of mouse positione - mouse event, contains state of modifiers
public void mouseUp(int x,
int y,
java.awt.event.MouseEvent e)
x - x coordinate of mouse positiony - y coordinate of mouse positione - mouse event, contains state of modifiers
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||