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.Iterator<WakeupCriterion> criteria)
Override Behavior's stimulus method to handle the event.
|
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
clearCapability, clearCapabilityIsFrequent, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
public 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 Behavior
public void processStimulus(java.util.Iterator<WakeupCriterion> criteria)
processStimulus
in class Behavior
criteria
- an iterator 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.KeyListener
public void keyReleased(java.awt.event.KeyEvent evt)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent evt)
keyTyped
in interface java.awt.event.KeyListener