public interface Tool
Modifier and Type | Method and Description |
---|---|
void |
keyDown(java.awt.event.KeyEvent e,
int key)
Handles key down events in the drawing view (KEY_PRESSED events).
|
void |
mouseDown(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse down events in the drawing view.
|
void |
mouseDrag(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse drag events in the drawing view (while mouse button is down).
|
void |
mouseMove(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse moves (while the mouse button is up).
|
void |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse up in the drawing view.
|
void mouseDown(java.awt.event.MouseEvent e, int x, int y)
e
- the original mouse event from AWTx
- the x coordinate of the mouse cursory
- the y coordinate of the mouse cursorvoid mouseDrag(java.awt.event.MouseEvent e, int x, int y)
e
- the original mouse event from AWTx
- the x coordinate of the mouse cursory
- the y coordinate of the mouse cursorvoid mouseUp(java.awt.event.MouseEvent e, int x, int y)
e
- the original mouse event from AWTx
- the x coordinate of the mouse cursory
- the y coordinate of the mouse cursorvoid mouseMove(java.awt.event.MouseEvent e, int x, int y)
e
- the original mouse event from AWTx
- the x coordinate of the mouse cursory
- the y coordinate of the mouse cursorvoid keyDown(java.awt.event.KeyEvent e, int key)
e
- the original key event from AWTkey
- the AWT keycode, the integer code for the actual key on the
keyboard; consultFrom the book: Flexible, Reliable Software, © CRC Press 2010. Author: Henrik B. Christensen, Aarhus University, Denmark