com.threerings.opengl.camera
Class MouseOrbiter

java.lang.Object
  extended by com.threerings.opengl.camera.MouseOrbiter
All Implemented Interfaces:
ComponentListener, MouseMotionListener, MouseWheelListener, EventListener

public class MouseOrbiter
extends Object
implements MouseMotionListener, MouseWheelListener, MouseMotionListener, MouseWheelListener

Provides a means of manipulating an OrbitCameraHandler using the mouse.


Field Summary
protected  OrbitCameraHandler _camhand
          The camera handler we're controlling.
protected  int _lx
          The last x and y position recorded.
protected  int _ly
          The last x and y position recorded.
protected  boolean _panXY
          Whether or not to restrict panning to the XY plane.
protected  float _radiansPerPixel
          The angular scale.
protected  float _unitsPerClick
          The wheel scale.
protected  float _unitsPerPixel
          The linear scale.
 
Constructor Summary
MouseOrbiter(OrbitCameraHandler camhand)
          Creates new mouse orbiter for the specified camera handler.
MouseOrbiter(OrbitCameraHandler camhand, boolean panXY)
          Creates a new mouse orbiter for the specified camera handler.
 
Method Summary
 void addTo(Component comp)
          Adds the orbiter to the specified component.
protected  void mouseDragged(int x, int y, boolean b1, boolean b2, boolean b3)
          Notes that the mouse has been dragged.
 void mouseDragged(MouseEvent event)
           
 void mouseDragged(MouseEvent event)
          Dispatched when the mouse is moved after a button having been pressed within the bounds of the target component.
protected  void mouseMoved(int x, int y)
          Notes that the mouse has moved.
 void mouseMoved(MouseEvent event)
           
 void mouseMoved(MouseEvent event)
          Dispatched when the mouse is moved within the bounds of the target component.
 void mouseWheeled(MouseEvent event)
          Dispatched when the mouse wheel is rotated within the bounds of the target component.
protected  void mouseWheelMoved(int delta)
          Notes that the mouse wheel has moved.
 void mouseWheelMoved(MouseWheelEvent event)
           
 void removeFrom(Component comp)
          Removes the orbiter from the specified component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_camhand

protected OrbitCameraHandler _camhand
The camera handler we're controlling.


_radiansPerPixel

protected float _radiansPerPixel
The angular scale.


_unitsPerPixel

protected float _unitsPerPixel
The linear scale.


_unitsPerClick

protected float _unitsPerClick
The wheel scale.


_panXY

protected boolean _panXY
Whether or not to restrict panning to the XY plane.


_lx

protected int _lx
The last x and y position recorded.


_ly

protected int _ly
The last x and y position recorded.

Constructor Detail

MouseOrbiter

public MouseOrbiter(OrbitCameraHandler camhand)
Creates new mouse orbiter for the specified camera handler.


MouseOrbiter

public MouseOrbiter(OrbitCameraHandler camhand,
                    boolean panXY)
Creates a new mouse orbiter for the specified camera handler.

Parameters:
panXY - if true, limit panning to the XY plane.
Method Detail

addTo

public void addTo(Component comp)
Adds the orbiter to the specified component.


removeFrom

public void removeFrom(Component comp)
Removes the orbiter from the specified component.


mouseDragged

public void mouseDragged(MouseEvent event)

mouseMoved

public void mouseMoved(MouseEvent event)

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent event)

mouseMoved

public void mouseMoved(MouseEvent event)
Description copied from interface: MouseMotionListener
Dispatched when the mouse is moved within the bounds of the target component.

Specified by:
mouseMoved in interface MouseMotionListener

mouseDragged

public void mouseDragged(MouseEvent event)
Description copied from interface: MouseMotionListener
Dispatched when the mouse is moved after a button having been pressed within the bounds of the target component.

Specified by:
mouseDragged in interface MouseMotionListener

mouseWheeled

public void mouseWheeled(MouseEvent event)
Description copied from interface: MouseWheelListener
Dispatched when the mouse wheel is rotated within the bounds of the target component.

Specified by:
mouseWheeled in interface MouseWheelListener

mouseDragged

protected void mouseDragged(int x,
                            int y,
                            boolean b1,
                            boolean b2,
                            boolean b3)
Notes that the mouse has been dragged.


mouseMoved

protected void mouseMoved(int x,
                          int y)
Notes that the mouse has moved.


mouseWheelMoved

protected void mouseWheelMoved(int delta)
Notes that the mouse wheel has moved.