Class PickMouseBehavior
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Leaf
javax.media.j3d.Behavior
com.sun.j3d.utils.pickfast.behaviors.PickMouseBehavior
- Direct Known Subclasses:
PickRotateBehavior
,PickTranslateBehavior
,PickZoomBehavior
Base class that allows users to adding picking and mouse manipulation to
the scene graph (see PickDragBehavior for an example of how to extend
this base class). This class is useful for interactive apps.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected WakeupCriterion[]
protected TransformGroup
protected static final boolean
protected MouseEvent
protected PickCanvas
protected WakeupOr
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_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
-
Constructor Summary
ConstructorsConstructorDescriptionPickMouseBehavior
(Canvas3D canvas, BranchGroup root, Bounds bounds) Creates a PickMouseBehavior given current canvas, root of the tree to operate on, and the bounds. -
Method Summary
Modifier and TypeMethodDescriptionint
getMode()
Returns the pickModefloat
Returns the pick tolerancevoid
Initialize this behavior.void
processStimulus
(Enumeration criteria) Process a stimulus meant for this behavior.void
setMode
(int pickMode) Sets the pick modevoid
setTolerance
(float tolerance) Sets the pick toleranceabstract void
updateScene
(int xpos, int ypos) Subclasses shall implement this update functionMethods inherited from class javax.media.j3d.Behavior
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
Methods inherited from class javax.media.j3d.Node
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
-
Field Details
-
pickCanvas
-
conditions
-
wakeupCondition
-
buttonPress
protected boolean buttonPress -
currGrp
-
debug
protected static final boolean debug- See Also:
-
mevent
-
-
Constructor Details
-
PickMouseBehavior
Creates a PickMouseBehavior given current canvas, root of the tree to operate on, and the bounds.
-
-
Method Details
-
setMode
public void setMode(int pickMode) Sets the pick mode- See Also:
-
getMode
public int getMode()Returns the pickMode- See Also:
-
setTolerance
public void setTolerance(float tolerance) Sets the pick tolerance- See Also:
-
getTolerance
public float getTolerance()Returns the pick tolerance- See Also:
-
initialize
public void initialize()Description copied from class:Behavior
Initialize this behavior. Classes that extend Behavior must provide their own initialize method.
NOTE: Applications should not call this method. It is called by the Java 3D behavior scheduler.- Specified by:
initialize
in classBehavior
-
processStimulus
Description copied from class:Behavior
Process a stimulus meant for this behavior. This method is invoked if the Behavior's wakeup criteria are satisfied and an active ViewPlatform's activation volume intersects with the Behavior's scheduling region. Classes that extend Behavior must provide their own processStimulus method.
NOTE: Applications should not call this method. It is called by the Java 3D behavior scheduler.- Specified by:
processStimulus
in classBehavior
- Parameters:
criteria
- an enumeration of triggered wakeup criteria for this behavior
-
updateScene
public abstract void updateScene(int xpos, int ypos) Subclasses shall implement this update function
-