net.java.dev.joode.graphics2D.tool
Class AbstractTool

java.lang.Object
  extended by net.java.dev.joode.graphics2D.tool.AbstractTool
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, ViewTool, WorldStepListener
Direct Known Subclasses:
CreateTool, ForceTool, MouseObjectMover, MouseZoomScroll

public abstract class AbstractTool
extends java.lang.Object
implements ViewTool

helper class for ViewTool implementers that provides concrete empty implementations of the event methods, so that subclasses do not necissarily need to define every one of them

Author:
s0570397

Field Summary
protected  ViewTools tools
           
 
Constructor Summary
AbstractTool()
           
 
Method Summary
 void activate()
          Tells the tool that it has been activated (i.e.
 void deactivate()
          Tells the tool that it has been deactivate (i.e.
 javax.swing.Icon getIcon()
          returns null, subclasses should probably overide this
 java.lang.String getLabel()
          uses the toString to produce a label
 void install(ViewTools tools)
          stores the reference for subclasses to use
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void notifyQuickStep(World w, float stepSize)
          the world has quickstepped
 void notifyStep(World w, float stepSize)
          the world has stepped
 void update()
          called if the world or space changes when a tool is active
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tools

protected ViewTools tools
Constructor Detail

AbstractTool

public AbstractTool()
Method Detail

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

notifyQuickStep

public void notifyQuickStep(World w,
                            float stepSize)
Description copied from interface: WorldStepListener
the world has quickstepped

Specified by:
notifyQuickStep in interface WorldStepListener

notifyStep

public void notifyStep(World w,
                       float stepSize)
Description copied from interface: WorldStepListener
the world has stepped

Specified by:
notifyStep in interface WorldStepListener

activate

public void activate()
Description copied from interface: ViewTool
Tells the tool that it has been activated (i.e. it is now the selected tool and should expect event notifications)

Specified by:
activate in interface ViewTool

update

public void update()
Description copied from interface: ViewTool
called if the world or space changes when a tool is active

Specified by:
update in interface ViewTool

deactivate

public void deactivate()
Description copied from interface: ViewTool
Tells the tool that it has been deactivate (i.e. another tool has been selected) The tool should reset its state at this point

Specified by:
deactivate in interface ViewTool

getLabel

public java.lang.String getLabel()
uses the toString to produce a label

Specified by:
getLabel in interface ViewTool
Returns:

getIcon

public javax.swing.Icon getIcon()
returns null, subclasses should probably overide this

Specified by:
getIcon in interface ViewTool
Returns:

install

public void install(ViewTools tools)
stores the reference for subclasses to use

Specified by:
install in interface ViewTool