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

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

public class MouseZoomScroll
extends AbstractTool

allows a 2D view to be interacted with using an intuative cartesian interface left click and holding moves the view around, right click dragging zooms in and out

Author:
tom larkworthy

Field Summary
 
Fields inherited from class net.java.dev.joode.graphics2D.tool.AbstractTool
tools
 
Constructor Summary
MouseZoomScroll()
           
 
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.
 double getZoomSpeed()
           
 boolean isIsotropicZoom()
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void setIsotropicZoom(boolean isotropicZoom)
          flag so keep the zoom factor the same in both dimensions
 void setZoomSpeed(double zoomSpeed)
          fspeed fo the zooming, the nearer to 1 the slower the speed
 void update()
          updates the views view
 
Methods inherited from class net.java.dev.joode.graphics2D.tool.AbstractTool
getIcon, getLabel, install, mouseClicked, mouseEntered, mouseExited, mouseMoved, notifyQuickStep, notifyStep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseZoomScroll

public MouseZoomScroll()
Method Detail

isIsotropicZoom

public boolean isIsotropicZoom()

setIsotropicZoom

public void setIsotropicZoom(boolean isotropicZoom)
flag so keep the zoom factor the same in both dimensions


getZoomSpeed

public double getZoomSpeed()

setZoomSpeed

public void setZoomSpeed(double zoomSpeed)
fspeed fo the zooming, the nearer to 1 the slower the speed


update

public void update()
updates the views view

Specified by:
update in interface ViewTool
Overrides:
update in class AbstractTool

mousePressed

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

mouseReleased

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

mouseDragged

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

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
Overrides:
activate in class AbstractTool

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
Overrides:
deactivate in class AbstractTool