net.java.dev.joode.graphics2D.tool
Class MouseObjectMover
java.lang.Object
net.java.dev.joode.graphics2D.tool.AbstractTool
net.java.dev.joode.graphics2D.tool.MouseObjectMover
- All Implemented Interfaces:
- java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, ViewTool, WorldStepListener
public class MouseObjectMover
- extends AbstractTool
Allows objects to be moved around the world
left click and drag to move the object around.
objects tied to bodies can be thrown by releasing left mosue while cursor is moving
- Author:
- tom larkworthy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MouseObjectMover
public MouseObjectMover()
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
step
public void step()
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener- Overrides:
mouseDragged in class AbstractTool
notifyQuickStep
public void notifyQuickStep(World w,
float stepSize)
- Description copied from interface:
WorldStepListener
- the world has quickstepped
- Specified by:
notifyQuickStep in interface WorldStepListener- Overrides:
notifyQuickStep in class AbstractTool
notifyStep
public void notifyStep(World w,
float stepSize)
- Description copied from interface:
WorldStepListener
- the world has stepped
- Specified by:
notifyStep in interface WorldStepListener- Overrides:
notifyStep 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