public class KeyNavigatorBehavior extends Behavior implements java.awt.event.KeyListener
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING| Constructor and Description |
|---|
KeyNavigatorBehavior(java.awt.Component c,
TransformGroup targetTG)
Constructs a key navigator behavior that uses AWT listeners
and behavior posts rather than WakeupOnAWTEvent.
|
KeyNavigatorBehavior(TransformGroup targetTG)
Constructs a new key navigator behavior node that operates
on the specified transform group.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(java.awt.Component c)
Adds this behavior as a KeyListener to the specified component.
|
void |
initialize()
Override Behavior's initialize method to setup wakeup criteria.
|
void |
keyPressed(java.awt.event.KeyEvent evt) |
void |
keyReleased(java.awt.event.KeyEvent evt) |
void |
keyTyped(java.awt.event.KeyEvent evt) |
void |
processStimulus(java.util.Enumeration criteria)
Override Behavior's stimulus method to handle the event.
|
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOncloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickableclearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toStringpublic KeyNavigatorBehavior(TransformGroup targetTG)
targetTG - the target transform grouppublic KeyNavigatorBehavior(java.awt.Component c,
TransformGroup targetTG)
c - The component to add the KeyListener to.targetTG - The target transform group.public void initialize()
initialize in class Behaviorpublic void processStimulus(java.util.Enumeration criteria)
processStimulus in class Behaviorcriteria - an enumeration of triggered wakeup criteria for this
behaviorpublic void addListener(java.awt.Component c)
c - The component to add the KeyListener to.java.lang.IllegalStateException - if the behavior was not created
as a listenerpublic void keyPressed(java.awt.event.KeyEvent evt)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent evt)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent evt)
keyTyped in interface java.awt.event.KeyListenerCopyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.