Class FlyBehavior
- 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
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.MouseBehavior
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.FlyBehavior
-
public class FlyBehavior extends MouseBehavior
This behavior is supposed to emulate a pilot directing an aircraft. The three mouse buttons act like a joystick. Rotation is controlled with the left mouse button and the middle mouse button. Zoom is controlled with the left mouse button; translation is controlled with the right mouse button.Here are the functions:
Left mouse button:
Up - zooms out
Down - zooms in
Right - spins to the left
Left - spins to the right
Right mouse button:
Up - translates down
Down - translates up
Right - translates left
Left - translates right
Middle mouse button:
Up - pitches up
Down - pitches down
Right - rolls right
Left - rolls left
A slider in the dialog controls the speed of these changes. Also, the further away from the center of the canvas the mouse event is, the faster it will occur. So if the user points the mouse with the left mouse button at the very top of the canvas, the image will zoom out quickly. If the user points the mouse with the left mouse button only slightly above the center of the canvas, the image will zoom out slowly.
-
-
Field Summary
-
Fields inherited from class gov.nih.mipav.view.renderer.J3D.surfaceview.MouseBehavior
awtCondition, bothCondition, canvasBounds, canvasCenter, deadFactor, deadXSize, deadYSize, ignoreMouseMotion, MAX_ANGLE, MAX_VELOCITY, motion, mouseCallback, newTargetTransform, parent, pitchAngle, pitchTransform, spinAngle, spinTransform, targetTG, targetTransform, velocity, velocityTransform, yawAngle, yawTransform
-
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
Constructors Constructor Description FlyBehavior(JPanelView parent)
Constructs new behavior and initializes wake up events.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
integrateTransforms()
Sets up the new transform by creating transforms from the determined pitch, yaw, and roll angles and multiplying these with the velocity.protected void
processMouseEvent(java.awt.event.MouseEvent event)
Processes the mouse event, setting yaw, pitch, roll, and velocity depending on mouse button and position.-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.surfaceview.MouseBehavior
getCanvasCenter, getTarget, initialize, isIgnoreMouseMotion, processStimulus, setMaximumAngle, setMaximumVelocity, setTarget, setupCallback
-
Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior
getHomeTransform, getViewingPlatform, goHome, setHomeTransform, setViewingPlatform
-
Methods 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
-
-
-
-
Constructor Detail
-
FlyBehavior
public FlyBehavior(JPanelView parent)
Constructs new behavior and initializes wake up events.- Parameters:
parent
- The dialog that called this behavior.
-
-
Method Detail
-
integrateTransforms
protected void integrateTransforms()
Sets up the new transform by creating transforms from the determined pitch, yaw, and roll angles and multiplying these with the velocity.- Specified by:
integrateTransforms
in classMouseBehavior
-
processMouseEvent
protected void processMouseEvent(java.awt.event.MouseEvent event)
Processes the mouse event, setting yaw, pitch, roll, and velocity depending on mouse button and position.- Specified by:
processMouseEvent
in classMouseBehavior
- Parameters:
event
- Mouse event to process.
-
-