com.croftsoft.apps.tag3d
Class Tag3DKeyListener

java.lang.Object
  extended by com.croftsoft.apps.tag3d.Tag3DKeyListener
All Implemented Interfaces:
KeyListener, EventListener

public class Tag3DKeyListener
extends Object
implements KeyListener

Handles keyboard events from the Canvas3D.

Version:
1999-02-07
Author:
David W. Croft

Field Summary
protected  double deltaRotation
           
protected  double deltaTranslation
           
protected  String id
           
protected  StateMulticaster stateMulticaster
           
protected  javax.media.j3d.TransformGroup viewTransformGroup
           
 
Constructor Summary
Tag3DKeyListener(double deltaRotation, double deltaTranslation, String id, StateMulticaster stateMulticaster, javax.media.j3d.TransformGroup viewTransformGroup)
          How keyboard input view effects and where the updates are broadcast.
 
Method Summary
 void keyPressed(KeyEvent keyEvent)
          Interprets view transform inputs and broadcasts the updates.
 void keyReleased(KeyEvent keyEvent)
           
 void keyTyped(KeyEvent keyEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deltaRotation

protected double deltaRotation

deltaTranslation

protected double deltaTranslation

id

protected String id

stateMulticaster

protected StateMulticaster stateMulticaster

viewTransformGroup

protected javax.media.j3d.TransformGroup viewTransformGroup
Constructor Detail

Tag3DKeyListener

public Tag3DKeyListener(double deltaRotation,
                        double deltaTranslation,
                        String id,
                        StateMulticaster stateMulticaster,
                        javax.media.j3d.TransformGroup viewTransformGroup)
How keyboard input view effects and where the updates are broadcast.

Parameters:
deltaRotation - The number of radians to rotate the view upon a keyboard input.
deltaTranslation - The distance to translate the view upon a keyboard input.
id - The unique identifier for the object controlled by the keyboard.
stateMulticaster - Destination for Transform3DState updates for this view.
viewTransformGroup - Contains the current view transform for the object controlled.
Method Detail

keyPressed

public void keyPressed(KeyEvent keyEvent)
Interprets view transform inputs and broadcasts the updates.

Specified by:
keyPressed in interface KeyListener
Parameters:
keyEvent - Arrow keys in combination with no other key, the Shift key, or the Alt key will rotate or translate the transform about the relative X, Y, and Z axes respectively for 6 degrees of freedom.

keyReleased

public void keyReleased(KeyEvent keyEvent)
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent keyEvent)
Specified by:
keyTyped in interface KeyListener

CroftSoft Javadoc

CroftSoft Apps Javadoc (2008-09-28 21:15:07)