public abstract class ViewPlatformAWTBehavior extends ViewPlatformBehavior implements MouseListener, MouseMotionListener, KeyListener, MouseWheelListener
Modifier and Type | Field and Description |
---|---|
protected org.jogamp.java3d.Canvas3D[] |
canvases
The Canvas3Ds from which this Behavior gets AWT events
|
protected org.jogamp.java3d.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
|
static int |
MOUSE_WHEEL_LISTENER
Flag indicating Behavior should listen for MouseWheel Events
|
protected static int |
POST_ID
Behavior PostId used in this behavior
|
protected org.jogamp.java3d.WakeupOnBehaviorPost |
postWakeup
The Or of the different criterion for the behavior to wakeup
|
protected org.jogamp.java3d.Transform3D |
targetTransform
The target Transform3D for this behavior
|
homeTransform, targetTG, vp
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
Modifier | Constructor and Description |
---|---|
protected |
ViewPlatformAWTBehavior()
Parameterless constructor for this behavior, intended for use by
subclasses instantiated through ConfiguredUniverse.
|
|
ViewPlatformAWTBehavior(org.jogamp.java3d.Canvas3D c,
int listenerFlags)
Constructs a new ViewPlatformAWTBehavior.
|
protected |
ViewPlatformAWTBehavior(int listenerFlags)
Construct a behavior which listens for events specified by the given
flags, intended for use by subclasses instantiated through
ConfiguredUniverse.
|
Modifier and Type | Method and Description |
---|---|
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(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
mouseWheelMoved(MouseWheelEvent e) |
protected abstract void |
processAWTEvents(AWTEvent[] events)
This is called once per frame if there are any AWT events to
process.
|
void |
processStimulus(Iterator<org.jogamp.java3d.WakeupCriterion> behEnum)
Process a stimulus meant for this behavior.
|
protected void |
queueAWTEvent(AWTEvent e)
Queue AWTEvents in a thread safe manner.
|
void |
setEnable(boolean state)
Overload setEnable from Behavior.
|
protected void |
setListenerFlags(int listenerFlags)
Sets listener flags for this behavior.
|
void |
setViewingPlatform(ViewingPlatform vp)
Sets the ViewingPlatform for this behavior.
|
getHomeTransform, getViewingPlatform, goHome, setHomeTransform
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, 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
protected static final int POST_ID
protected org.jogamp.java3d.WakeupOnElapsedFrames frameWakeup
protected org.jogamp.java3d.WakeupOnBehaviorPost postWakeup
protected org.jogamp.java3d.Transform3D targetTransform
protected boolean motion
public static final int MOUSE_LISTENER
public static final int MOUSE_MOTION_LISTENER
public static final int KEY_LISTENER
public static final int MOUSE_WHEEL_LISTENER
protected org.jogamp.java3d.Canvas3D[] canvases
protected ViewPlatformAWTBehavior()
protected ViewPlatformAWTBehavior(int listenerFlags)
listenerFlags
- Indicates which listener should be registered,
one or more of MOUSE_LISTENER, MOUSE_MOTION_LISTENER, KEY_LISTENER, MOUSE_WHEEL_LISTENERpublic ViewPlatformAWTBehavior(org.jogamp.java3d.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, MOUSE_WHEEL_LISTENERprotected void setListenerFlags(int listenerFlags)
listenerFlags
- Indicates which listener should be registered,
one or more of MOUSE_LISTENER, MOUSE_MOTION_LISTENER, KEY_LISTENER, MOUSE_WHEEL_LISTENERpublic void initialize()
initialize
in class org.jogamp.java3d.Behavior
public void processStimulus(Iterator<org.jogamp.java3d.WakeupCriterion> behEnum)
processStimulus
in class org.jogamp.java3d.Behavior
public void setEnable(boolean state)
setEnable
in class org.jogamp.java3d.Behavior
public void setViewingPlatform(ViewingPlatform vp)
setViewingPlatform
in class ViewPlatformBehavior
vp
- the target ViewingPlatform for this behaviorprotected abstract void processAWTEvents(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(AWTEvent e)
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
Copyright © 2019. All rights reserved.