|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.media.j3d.SceneGraphObject
|
+--javax.media.j3d.Node
|
+--javax.media.j3d.Leaf
|
+--javax.media.j3d.Behavior
|
+--com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior
|
+--com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior
Abstract class which implements much of the event tracking and state updating in a thread safe manner. AWT Events are captured and placed in a queue. While there are pending events or motion the behavior will wake up every frame, call processAWTEvents and integrateTransforms.
| Field Summary | |
protected WakeupOnElapsedFrames |
frameWakeup
The different criterion for the behavior to wakeup |
static int |
KEY_LISTENER
Flag indicating Behavior should listen for Key Events |
protected boolean |
motion
Boolean for whether the mouse is in motion |
static int |
MOUSE_LISTENER
Flag indicating Behavior should listen for Mouse Events |
static int |
MOUSE_MOTION_LISTENER
Flag indicating Behavior should listen for Mouse Motion Events |
protected static int |
POST_ID
Behavior PostId used in this behavior |
protected WakeupOnBehaviorPost |
postWakeup
The Or of the different criterion for the behavior to wakeup |
protected Transform3D |
targetTransform
The target Transform3D for this behavior |
| Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
targetTG, vp |
| Fields inherited from class javax.media.j3d.Node |
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_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
| Constructor Summary | |
ViewPlatformAWTBehavior(Canvas3D c,
int listenerFlags)
Constructs a new ViewPlatformAWTBehavior |
|
| Method Summary | |
void |
initialize()
Initializes the behavior. |
protected abstract void |
integrateTransforms()
Called once per frame (if the view is moving) to calculate the new view platform transform |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
protected abstract void |
processAWTEvents(java.awt.AWTEvent[] events)
This is called once per frame if there are any AWT events to process. |
void |
processStimulus(java.util.Enumeration enum)
Process a stimulus meant for this behavior. |
protected void |
queueAWTEvent(java.awt.AWTEvent e)
Queue AWTEvents in a thread safe manner. |
void |
setEnable(boolean state)
Overload setEnable from Behavior. |
void |
setViewingPlatform(ViewingPlatform vp)
Sets the ViewingPlatform for this behavior. |
| Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
getViewingPlatform |
| Methods inherited from class javax.media.j3d.Behavior |
getEnable, getSchedulingBoundingLeaf, getSchedulingBounds, getView, postId, setSchedulingBoundingLeaf, setSchedulingBounds, updateNodeReferences, wakeupOn |
| Methods inherited from class javax.media.j3d.Node |
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
| Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int POST_ID
protected WakeupOnElapsedFrames frameWakeup
protected WakeupOnBehaviorPost postWakeup
protected Transform3D targetTransform
protected boolean motion
public static final int MOUSE_LISTENER
public static final int MOUSE_MOTION_LISTENER
public static final int KEY_LISTENER
| Constructor Detail |
public ViewPlatformAWTBehavior(Canvas3D c,
int listenerFlags)
c - The Canvas3D on which to listen for events. If this is null a
NullPointerException will be thrown.listenerFlags - Indicates which listener should be registered,
one or more of MOUSE_LISTENER, MOUSE_MOTION_LISTENER, KEY_LISTENER| Method Detail |
public void initialize()
initialize in class Behaviorpublic void processStimulus(java.util.Enumeration enum)
processStimulus in class Behaviorjavax.media.j3d.Behaviorcriteria - an enumeration of triggered wakeup criteria for this
behaviorpublic void setEnable(boolean state)
setEnable in class Behaviorjavax.media.j3d.Behaviorstate - true or false to enable or disable this Behaviorpublic void setViewingPlatform(ViewingPlatform vp)
setViewingPlatform in class ViewPlatformBehaviorprotected abstract void processAWTEvents(java.awt.AWTEvent[] events)
motion variable will be true when the method
is called. If it is true when the method returns integrateTransforms
will be called immediately.
The AWTEvents are presented in the array in the order in which they
arrived from AWT.protected abstract void integrateTransforms()
protected void queueAWTEvent(java.awt.AWTEvent e)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||