CH.ifa.draw.contrib
Class PolygonTool

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractTool
      extended by CH.ifa.draw.contrib.PolygonTool
All Implemented Interfaces:
Tool

public class PolygonTool
extends AbstractTool


Field Summary
 
Fields inherited from class CH.ifa.draw.standard.AbstractTool
fAnchorX, fAnchorY, fView
 
Constructor Summary
PolygonTool(DrawingView view)
           
 
Method Summary
 void activate()
          Activates the tool for the given view.
 void deactivate()
          Deactivates the tool.
 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.
 void mouseMove(java.awt.event.MouseEvent e, int x, int y)
          Handles mouse moves (if the mouse button is up).
 void mouseUp(java.awt.event.MouseEvent e, int x, int y)
          Handles mouse up in the drawing view.
 
Methods inherited from class CH.ifa.draw.standard.AbstractTool
drawing, editor, keyDown, view
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonTool

public PolygonTool(DrawingView view)
Method Detail

activate

public void activate()
Description copied from class: AbstractTool
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.

Specified by:
activate in interface Tool
Overrides:
activate in class AbstractTool

deactivate

public void deactivate()
Description copied from class: AbstractTool
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.

Specified by:
deactivate in interface Tool
Overrides:
deactivate in class AbstractTool

mouseDown

public void mouseDown(java.awt.event.MouseEvent e,
                      int x,
                      int y)
Description copied from class: AbstractTool
Handles mouse down events in the drawing view.

Specified by:
mouseDown in interface Tool
Overrides:
mouseDown in class AbstractTool

mouseMove

public void mouseMove(java.awt.event.MouseEvent e,
                      int x,
                      int y)
Description copied from class: AbstractTool
Handles mouse moves (if the mouse button is up).

Specified by:
mouseMove in interface Tool
Overrides:
mouseMove in class AbstractTool

mouseDrag

public void mouseDrag(java.awt.event.MouseEvent e,
                      int x,
                      int y)
Description copied from class: AbstractTool
Handles mouse drag events in the drawing view.

Specified by:
mouseDrag in interface Tool
Overrides:
mouseDrag in class AbstractTool

mouseUp

public void mouseUp(java.awt.event.MouseEvent e,
                    int x,
                    int y)
Description copied from class: AbstractTool
Handles mouse up in the drawing view.

Specified by:
mouseUp in interface Tool
Overrides:
mouseUp in class AbstractTool