All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.standard.SelectionTool

java.lang.Object
   |
   +----CH.ifa.draw.standard.AbstractTool
           |
           +----CH.ifa.draw.standard.SelectionTool

public class SelectionTool
extends AbstractTool
Tool to select and manipulate figures. A selection tool is in one of three states, e.g., background selection, figure selection, handle manipulation. The different states are handled by different child tools.
Design Patterns

 o State
SelectionTool is the StateContext and child is the State. The SelectionTool delegates state specific behavior to its current child tool.



Constructor Index

 o SelectionTool(DrawingView)

Method Index

 o createAreaTracker(DrawingView)
Factory method to create an area tracker.
 o createDragTracker(DrawingView, Figure)
Factory method to create a Drag tracker.
 o createHandleTracker(DrawingView, Handle)
Factory method to create a Handle tracker.
 o mouseDown(MouseEvent, int, int)
Handles mouse down events and starts the corresponding tracker.
 o mouseDrag(MouseEvent, int, int)
Handles mouse drag events.
 o mouseUp(MouseEvent, int, int)
Handles mouse up events.

Constructors

 o SelectionTool
 public SelectionTool(DrawingView view)

Methods

 o mouseDown
 public void mouseDown(MouseEvent e,
                       int x,
                       int y)
Handles mouse down events and starts the corresponding tracker.

Overrides:
mouseDown in class AbstractTool
 o mouseDrag
 public void mouseDrag(MouseEvent e,
                       int x,
                       int y)
Handles mouse drag events. The events are forwarded to the current tracker.

Overrides:
mouseDrag in class AbstractTool
 o mouseUp
 public void mouseUp(MouseEvent e,
                     int x,
                     int y)
Handles mouse up events. The events are forwarded to the current tracker.

Overrides:
mouseUp in class AbstractTool
 o createHandleTracker
 protected Tool createHandleTracker(DrawingView view,
                                    Handle handle)
Factory method to create a Handle tracker. It is used to track a handle.

 o createDragTracker
 protected Tool createDragTracker(DrawingView view,
                                  Figure f)
Factory method to create a Drag tracker. It is used to drag a figure.

 o createAreaTracker
 protected Tool createAreaTracker(DrawingView view)
Factory method to create an area tracker. It is used to select an area.


All Packages  Class Hierarchy  This Package  Previous  Next  Index