| |
|
| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Behavior com.db.behaviors.PickViewerBehavior com.db.behaviors.StandardPickViewer
StandardPickViewer | public class StandardPickViewer extends PickViewerBehavior (Code) | | A mouse behavior that allows user to pick and minipulate scene graph objects.
Manipulations include translation, rotation and zoom.
The behavior maps mouse drags to different transforms depending
upon the mosue button held down:
Button 1 (left)
Translation of dragged object
Button 2 (middle)
Rotation of dragged object around itself
Button 3 (right)
Zoom of dragged object towards user
To support systems with 2 or 1 mouse buttons, the following
alternate mappings are supported while dragging with any mouse
button held down and zero or more keyboard modifiers held down:
No modifiers = Button 1
ALT = Button 2
Meta = Button 3
Control = Button 3
Common usage:
1. Create your scene graph.
2. Create this behavior with root and canvas.
StandardPickViewerBehavior behavior = new StandardPickViewerBehavior(canvas, root, bounds);
root.addChild(behavior);
The above behavior will monitor for any picking events on
the scene graph (below root node) and handle mouse drags on pick hits.
Note the root node can also be a subgraph node of the scene graph (rather
than the topmost).
|
Constructor Summary | |
public | StandardPickViewer() Construct a behavior that listens to mouse movement
and button presses to generate rotation and translation
transforms written into a transform group given later
with the setTransformGroup( ) method. | public | StandardPickViewer(Canvas3D parent) Construct a behavior that listens to mouse movement
and button presses to generate rotation and translation
transforms written into a transform group given later
with the setTransformGroup( ) method. | public | StandardPickViewer(BranchGroup branchGroup) Construct a behavior that listens to mouse movement
and button presses to generate rotation and translation
transforms written into the given transform group. | public | StandardPickViewer(BranchGroup branchGroup, Canvas3D parent, Bounds bounds) Construct a behavior that listens to mouse movement
and button presses to generate rotation and translation
transforms written into the given transform group. |
previousX | protected int previousX(Code) | | |
previousY | protected int previousY(Code) | | |
StandardPickViewer | public StandardPickViewer()(Code) | | Construct a behavior that listens to mouse movement
and button presses to generate rotation and translation
transforms written into a transform group given later
with the setTransformGroup( ) method.
|
StandardPickViewer | public StandardPickViewer(Canvas3D parent)(Code) | | Construct a behavior that listens to mouse movement
and button presses to generate rotation and translation
transforms written into a transform group given later
with the setTransformGroup( ) method.
Parameters: parent - The AWT Component that contains the areagenerating mouse events. |
StandardPickViewer | public StandardPickViewer(BranchGroup branchGroup)(Code) | | Construct a behavior that listens to mouse movement
and button presses to generate rotation and translation
transforms written into the given transform group.
Parameters: transformGroup - The transform group to be modifiedby the behavior. |
StandardPickViewer | public StandardPickViewer(BranchGroup branchGroup, Canvas3D parent, Bounds bounds)(Code) | | Construct a behavior that listens to mouse movement
and button presses to generate rotation and translation
transforms written into the given transform group.
Parameters: transformGroup - The transform group to be modifiedby the behavior. Parameters: parent - The AWT Component that contains the areagenerating mouse events. |
onButton1 | public void onButton1(MouseEvent mev)(Code) | | Respond to a button1 event (press, release, or drag).
Parameters: mouseEvent - A MouseEvent to respond to. |
onButton2 | public void onButton2(MouseEvent mev)(Code) | | Respond to a button2 event (press, release, or drag).
Parameters: mouseEvent - A MouseEvent to respond to. |
onButton3 | public void onButton3(MouseEvent mev)(Code) | | Respond to a button3 event (press, release, or drag).
Parameters: mouseEvent - A MouseEvent to respond to. |
onElapsedFrames | public void onElapsedFrames(WakeupOnElapsedFrames timeEvent)(Code) | | Respond to an elapsed frames event (assuming subclass has set up a
wakeup criterion for it).
Parameters: time - A WakeupOnElapsedFrames criterion to respond to. |
pickHighlightAndSetCursor | protected void pickHighlightAndSetCursor(int x, int y)(Code) | | |
revertMaterialAndCursor | protected void revertMaterialAndCursor()(Code) | | |
setupCallback | public void setupCallback(StandardPickViewerCallback callback)(Code) | | The transformChanged method in the callback class will
be called every time the transform is updated
|
|
|
|