public class SelectionToolSample
extends java.lang.Object
SelectionTool
works.
Internally, the SelectionTool
uses three smaller tools
(named as 'Tracker') to fulfill its task. If the user presses the mouse
button over an empty area of a drawing, the SelectAreaTracker
comes into action. If the user presses the mouse button over a figure, the
DragTracker
comes into action. If the user presses the mouse
button over a handle, the HandleTracker
comes into action.
You need to edit the source code as marked below.
With this program you can:
SelectionTool
interacts with a
LineFigure
.SelectAreaTracker
interacts with a
LineFigure
.DragTracker
interacts with a
LineFigure
.HandleTracker
interacts with a
LineFigure
.Constructor and Description |
---|
SelectionToolSample()
Creates a new instance of SelectionToolSample
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args) |