simbad.sim
Class MouseOrbiter

java.lang.Object
  extended bysimbad.sim.MouseOrbiter
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.MouseInputListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class MouseOrbiter
extends java.lang.Object
implements javax.swing.event.MouseInputListener

Manages changes of the view point view under the control of mouse movement. The mouse enables to modify lattitude and longitude of the viewpoint. This class is largely inspired from Sun's OrbitBehavior. It is intented to be used only with the main Canvas3d object (see World class).


Constructor Summary
MouseOrbiter(javax.media.j3d.Canvas3D c, javax.media.j3d.TransformGroup targetTransformGroup)
          Creates a new OrbitBehavior
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent arg0)
           
 void mouseDragged(java.awt.event.MouseEvent event)
           
 void mouseEntered(java.awt.event.MouseEvent arg0)
           
 void mouseExited(java.awt.event.MouseEvent arg0)
           
 void mouseMoved(java.awt.event.MouseEvent event)
           
 void mousePressed(java.awt.event.MouseEvent event)
           
 void mouseReleased(java.awt.event.MouseEvent event)
           
 void resetView()
          Reset the orientation and distance of this behavior to the current values in target Transform Group
 void setRotationCenter(javax.vecmath.Point3d center)
          Sets the center around which the View rotates.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseOrbiter

public MouseOrbiter(javax.media.j3d.Canvas3D c,
                    javax.media.j3d.TransformGroup targetTransformGroup)
Creates a new OrbitBehavior

Parameters:
c - The Canvas3D to add the behavior to
targetTransformGroup - The transformgroup affected by mouse movement
Method Detail

resetView

public void resetView()
Reset the orientation and distance of this behavior to the current values in target Transform Group


setRotationCenter

public void setRotationCenter(javax.vecmath.Point3d center)
Sets the center around which the View rotates. The default is (0,0,0).

Parameters:
center - The Point3d to set the center of rotation to

mouseClicked

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

mousePressed

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

mouseReleased

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

mouseEntered

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

mouseExited

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

mouseDragged

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

mouseMoved

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