Package sim.display3d
Class SelectionBehavior
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Leaf
javax.media.j3d.Behavior
com.sun.j3d.utils.behaviors.mouse.MouseBehavior
sim.display3d.SelectionBehavior
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
public class SelectionBehavior
extends com.sun.j3d.utils.behaviors.mouse.MouseBehavior
A behavior added to Display3Ds which enables Portrayal3Ds to be selected (via Java3D picking).
Portions of this software is based on the file ColorCube.java, available as part of the Java3D Developer Kit examples, and falls under the license that came with that example. The license is listed at the end of this file. The remainder of the file falls under the standard license for this library.
-
Field Summary
Fields inherited from class com.sun.j3d.utils.behaviors.mouse.MouseBehavior
buttonPress, currXform, enable, flags, invert, INVERT_INPUT, MANUAL_WAKEUP, mouseCriterion, mouseEvents, mouseq, reset, transformGroup, transformX, transformY, wakeUp, x, x_last, y, y_last
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
ConstructorDescriptionSelectionBehavior
(javax.media.j3d.Canvas3D canvas, javax.media.j3d.BranchGroup root, javax.media.j3d.Bounds bounds, GUIState guiState) -
Method Summary
Modifier and TypeMethodDescriptionvoid
detach()
Detaches the Selection Behavior from the Canvas properly, so leaks don't occur.void
mouseClicked
(MouseEvent evt) void
processStimulus
(Enumeration criteria) void
setSelectsAll
(boolean selection, boolean inspection) Sets whether mouse-clicking results in selecting all picked elements (true) or just the closest one (false).void
setTolerance
(double tolerance) Methods inherited from class com.sun.j3d.utils.behaviors.mouse.MouseBehavior
addListener, getTransformGroup, initialize, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, processMouseEvent, setEnable, setTransformGroup, wakeup
Methods inherited from class javax.media.j3d.Behavior
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, 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
-
Constructor Details
-
SelectionBehavior
public SelectionBehavior(javax.media.j3d.Canvas3D canvas, javax.media.j3d.BranchGroup root, javax.media.j3d.Bounds bounds, GUIState guiState)
-
-
Method Details
-
setTolerance
public void setTolerance(double tolerance) -
detach
public void detach()Detaches the Selection Behavior from the Canvas properly, so leaks don't occur. -
setSelectsAll
public void setSelectsAll(boolean selection, boolean inspection) Sets whether mouse-clicking results in selecting all picked elements (true) or just the closest one (false). This can be done independently of selection and inspection. -
processStimulus
- Specified by:
processStimulus
in classcom.sun.j3d.utils.behaviors.mouse.MouseBehavior
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
- Overrides:
mouseClicked
in classcom.sun.j3d.utils.behaviors.mouse.MouseBehavior
-