All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.standard.AbstractTool

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

public class AbstractTool
extends Object
implements Tool
Default implementation support for Tools.

See Also:
DrawingView, Tool

Variable Index

 o fAnchorX
The position of the initial mouse down.
 o fAnchorY
The position of the initial mouse down.
 o fView

Constructor Index

 o AbstractTool(DrawingView)
Constructs a tool for the given view.

Method Index

 o activate()
Activates the tool for the given view.
 o deactivate()
Deactivates the tool.
 o drawing()
Gets the tool's drawing.
 o editor()
Gets the tool's editor.
 o keyDown(KeyEvent, int)
Handles key down events in the drawing view.
 o mouseDown(MouseEvent, int, int)
Handles mouse down events in the drawing view.
 o mouseDrag(MouseEvent, int, int)
Handles mouse drag events in the drawing view.
 o mouseMove(MouseEvent, int, int)
Handles mouse moves (if the mouse button is up).
 o mouseUp(MouseEvent, int, int)
Handles mouse up in the drawing view.
 o view()
Gets the tool's view.

Variables

 o fView
 protected DrawingView fView
 o fAnchorX
 protected int fAnchorX
The position of the initial mouse down.

 o fAnchorY
 protected int fAnchorY
The position of the initial mouse down.

Constructors

 o AbstractTool
 public AbstractTool(DrawingView itsView)
Constructs a tool for the given view.

Methods

 o activate
 public void activate()
Activates the tool for the given view. This method is called whenever the user switches to this tool. Use this method to reinitialize a tool.

 o deactivate
 public void deactivate()
Deactivates the tool. This method is called whenever the user switches to another tool. Use this method to do some clean-up when the tool is switched. Subclassers should always call super.deactivate.

 o mouseDown
 public void mouseDown(MouseEvent e,
                       int x,
                       int y)
Handles mouse down events in the drawing view.

 o mouseDrag
 public void mouseDrag(MouseEvent e,
                       int x,
                       int y)
Handles mouse drag events in the drawing view.

 o mouseUp
 public void mouseUp(MouseEvent e,
                     int x,
                     int y)
Handles mouse up in the drawing view.

 o mouseMove
 public void mouseMove(MouseEvent evt,
                       int x,
                       int y)
Handles mouse moves (if the mouse button is up).

 o keyDown
 public void keyDown(KeyEvent evt,
                     int key)
Handles key down events in the drawing view.

 o drawing
 public Drawing drawing()
Gets the tool's drawing.

 o editor
 public DrawingEditor editor()
Gets the tool's editor.

 o view
 public DrawingView view()
Gets the tool's view.


All Packages  Class Hierarchy  This Package  Previous  Next  Index