public class SelectAreaTracker extends AbstractTool
Modifier and Type | Field and Description |
---|---|
protected RubberBandSelectionStrategy |
rubberBandSelectionStrategy |
editor, fAnchorX, fAnchorY
Constructor and Description |
---|
SelectAreaTracker(DrawingEditor editor) |
SelectAreaTracker(DrawingEditor editor,
RubberBandSelectionStrategy rbss)
define the selection area tracker.
|
Modifier and Type | Method and Description |
---|---|
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 |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse up in the drawing view.
|
editor, keyDown, mouseMove
protected RubberBandSelectionStrategy rubberBandSelectionStrategy
public SelectAreaTracker(DrawingEditor editor)
public SelectAreaTracker(DrawingEditor editor, RubberBandSelectionStrategy rbss)
editor
- the editor to be associated withrbss
- the selection strategy to usepublic 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 mouseUp(java.awt.event.MouseEvent e, int x, int y)
Tool
mouseUp
in interface Tool
mouseUp
in class AbstractTool
e
- the original mouse event from AWTx
- the x coordinate of the mouse cursory
- the y coordinate of the mouse cursorFrom the book: Flexible, Reliable Software, © CRC Press 2010. Author: Henrik B. Christensen, Aarhus University, Denmark