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

java.lang.Object
  extended by net.java.dev.joode.graphics2D.tool.CompositeTool
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, ViewTool, WorldStepListener

public class CompositeTool
extends java.lang.Object
implements ViewTool

allows multiple tools to appear as one atomic tool

Author:
s0570397

Constructor Summary
CompositeTool(java.lang.String label, javax.swing.Icon icon)
           
 
Method Summary
 void activate()
          Tells the tool that it has been activated (i.e.
 void addTool(ViewTool tool)
           
 void deactivate()
          Tells the tool that it has been deactivate (i.e.
 javax.swing.Icon getIcon()
          gets the tools icon for buttons etc.
 java.lang.String getLabel()
          returns the label that should be used for menus etc.
 void install(ViewTools toolsInterface)
          called once when the tool is added to the tools interface the object passed in can be queried to retreive information such as the space or world
 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
 

Constructor Detail

CompositeTool

public CompositeTool(java.lang.String label,
                     javax.swing.Icon icon)
Method Detail

addTool

public void addTool(ViewTool tool)

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

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

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

install

public void install(ViewTools toolsInterface)
Description copied from interface: ViewTool
called once when the tool is added to the tools interface the object passed in can be queried to retreive information such as the space or world

Specified by:
install in interface ViewTool

getLabel

public java.lang.String getLabel()
Description copied from interface: ViewTool
returns the label that should be used for menus etc.

Specified by:
getLabel in interface ViewTool
Returns:

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: ViewTool
gets the tools icon for buttons etc.

Specified by:
getIcon in interface ViewTool
Returns: