de.uka.algo.algovis3d
Class Controller

java.lang.Object
  extended by de.uka.algo.algovis3d.Controller
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

public class Controller
extends java.lang.Object
implements java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.ActionListener

This class provides a controller for camera steering in a Java3D universe. To use it, simply create an Controller instance and add it to the corresponding Canvas3D as a key listener. Ideas/Todos: - new public method (i.e. getControlDescription) to show a description of the key configuration (auto-generated from the constants for the key controlled events below at best)

Author:
ITI, Universitaet Karlsruhe (TH) - Florian Boehl

Constructor Summary
Controller(com.sun.j3d.utils.universe.SimpleUniverse universe)
          Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Event handler for ActionEvent events.
 void keyPressed(java.awt.event.KeyEvent e)
          Event handler for KeyPressed events.
 void keyReleased(java.awt.event.KeyEvent e)
          Event handler for KeyReleased events.
 void keyTyped(java.awt.event.KeyEvent e)
          Event handler for KeyTyped events.
 void mouseClicked(java.awt.event.MouseEvent e)
          Event handler for MouseClicked events.
 void mouseDragged(java.awt.event.MouseEvent e)
          Event handler for MouseDragged events.
 void mouseEntered(java.awt.event.MouseEvent e)
          Event handler for MouseEntered events.
 void mouseExited(java.awt.event.MouseEvent e)
          Event handler for MouseExited events.
 void mouseMoved(java.awt.event.MouseEvent e)
          Event handler for MouseMoved events.
 void mousePressed(java.awt.event.MouseEvent e)
          Event handler for MousePressed events.
 void mouseReleased(java.awt.event.MouseEvent e)
          Event handler for MouseReleased events.
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
          Event handler for MouseWheelMoved events.
 void resetCameraHeading()
          Resets the cameras heading and updates the camera transform group.
 void resetCameraPosition()
          Resets the cameras position and updates the camera transform group.
 void resetCameraRotation()
          Resets the camera rotation.
 void setInitialHeadingRotationX(double angle)
          Sets the initial heading x-rotation
 void setInitialHeadingRotationY(double angle)
          Sets the initial heading y-rotation
 void setInitialPosition(javax.vecmath.Vector3d position)
          Sets the initial position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller(com.sun.j3d.utils.universe.SimpleUniverse universe)
Constructor

Parameters:
universe - The target of this controller - a Java3D universe.
Method Detail

resetCameraRotation

public void resetCameraRotation()
Resets the camera rotation.


resetCameraHeading

public void resetCameraHeading()
Resets the cameras heading and updates the camera transform group.


resetCameraPosition

public void resetCameraPosition()
Resets the cameras position and updates the camera transform group.


setInitialPosition

public void setInitialPosition(javax.vecmath.Vector3d position)
Sets the initial position.

Parameters:
position - The new initial position.

setInitialHeadingRotationX

public void setInitialHeadingRotationX(double angle)
Sets the initial heading x-rotation

Parameters:
angle - The angle for the new initial x-rotation.

setInitialHeadingRotationY

public void setInitialHeadingRotationY(double angle)
Sets the initial heading y-rotation

Parameters:
angle - The angle for the new initial y-rotation.

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Event handler for KeyTyped events.

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Event handler for KeyPressed events.

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Event handler for KeyReleased events.

Specified by:
keyReleased in interface java.awt.event.KeyListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Event handler for MouseClicked events.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Event handler for MousePressed events.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Event handler for MouseReleased events.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Event handler for MouseEntered events.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Event handler for MouseExited events.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Event handler for MouseMoved events.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Event handler for MouseDragged events.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Event handler for MouseWheelMoved events.

Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Event handler for ActionEvent events.

Specified by:
actionPerformed in interface java.awt.event.ActionListener