public class DragTracker extends AbstractTool implements Tool
editor, fAnchorX, fAnchorY
Constructor and Description |
---|
DragTracker(DrawingEditor editor,
Figure figure) |
Modifier and Type | Method and Description |
---|---|
void |
keyDown(java.awt.event.KeyEvent evt,
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).
|
editor, mouseMove, mouseUp
public DragTracker(DrawingEditor editor, Figure figure)
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)
Tool
mouseDown
in interface Tool
mouseDown
in class AbstractTool
e
- the original mouse event from AWTx
- the x coordinate of the mouse cursory
- the y coordinate of the mouse cursorpublic void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
Tool
mouseDrag
in interface Tool
mouseDrag
in class AbstractTool
e
- the original mouse event from AWTx
- the x coordinate of the mouse cursory
- the y coordinate of the mouse cursorpublic void keyDown(java.awt.event.KeyEvent evt, int key)
Tool
keyDown
in interface Tool
keyDown
in class AbstractTool
evt
- 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