public class KeyNavigatorBehavior extends Behavior implements 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(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(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(KeyEvent evt) |
void |
keyReleased(KeyEvent evt) |
void |
keyTyped(KeyEvent evt) |
void |
processStimulus(Enumeration criteria)
Override Behavior's stimulus method to handle the event.
|
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
public KeyNavigatorBehavior(TransformGroup targetTG)
targetTG
- the target transform grouppublic KeyNavigatorBehavior(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(Enumeration criteria)
processStimulus
in class Behavior
criteria
- an enumeration of triggered wakeup criteria for this
behaviorpublic void addListener(Component c)
c
- The component to add the KeyListener to.IllegalStateException
- if the behavior was not created
as a listenerpublic void keyPressed(KeyEvent evt)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent evt)
keyReleased
in interface KeyListener
public void keyTyped(KeyEvent evt)
keyTyped
in interface KeyListener
Copyright © 2016–2022 SciJava. All rights reserved.