Class MouseBehaviorRenderer
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.MouseBehaviorRenderer
- Direct Known Subclasses:
FlyBehaviorRenderer,PointerBehaviorRenderer
public abstract class MouseBehaviorRenderer
extends com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior
Abstract class which implements much of the event tracking and state updating shared between Fly and Pointer
behavior.
Canvas3D size changes are tracked
- Author:
- Paul Byrne
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected javax.media.j3d.WakeupOrAwt wake up condition .protected javax.media.j3d.WakeupOrwake up condition for awt, component and mouse.protected RectangleCanvas boundary.protected Point2D.FloatCanvas center.protected floatCanvas rescale factor.protected floatCanvas resacled X size.protected floatCanvs rescaled Y size.protected booleanflag to invoke the mouse motion event or not.protected floatMaxium rotation angle.protected floatMaxium rotation velocity.protected booleanMotion, standard, fly thrugh, point.protected com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallbackMouse behavior callback.protected javax.media.j3d.Transform3DNew target transform.protected JPanelViewJPanel view reference.protected floatRotation pitch angle.protected javax.media.j3d.Transform3DSpin transform.protected floatRotation row angle.protected javax.media.j3d.Transform3DRow transform.protected javax.media.j3d.TransformGroupTarget transform group.protected javax.media.j3d.Transform3DTarget transform.protected javax.vecmath.Vector3fVelocity vector.protected javax.media.j3d.Transform3DTransfrom velocity.protected floatRotation yaw angle.protected javax.media.j3d.Transform3DYaw transform.Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior
homeTransform, vpFields 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
ConstructorsConstructorDescriptionMouseBehaviorRenderer(JPanelView parent) Creates new parent class with the dialog set for easy access between the user and the behaviors. -
Method Summary
Modifier and TypeMethodDescriptionGets the canvas center.javax.media.j3d.TransformGroupReturns the TransformGroup this behavior acts on.private voidinit()Initializes wake up events.voidRequired to be a ViewPlatformBehavior.protected abstract voidCreates a new transform and sets it in the canvas.booleanIndicates whether or not the canvas is ignoring mouse events.private voidprocessAWTEvents(AWTEvent[] events) Processes an array of AWT events by calling processMouseEvent; or, if the user pressed ESC, disables certain behaviors.protected abstract voidProcess the mouse event.voidRequired to be a ViewPlatformBehavior.voidsetMaximumAngle(float angle) Sets the maximum angle of the mouse movement.voidsetMaximumVelocity(float max) Sets the maximum velocity of the mouse movement.voidsetTarget(javax.media.j3d.TransformGroup targetTG) Sets the TransformGroup on which this behavior acts.voidsetupCallback(com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback callback) Sets who the behavior calls back to.Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior
getHomeTransform, getViewingPlatform, goHome, setHomeTransform, setViewingPlatformMethods inherited from class javax.media.j3d.Behavior
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOnMethods 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, setPickableMethods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
-
Field Details
-
awtCondition
protected javax.media.j3d.WakeupOr awtConditionAwt wake up condition . -
bothCondition
protected javax.media.j3d.WakeupOr bothConditionwake up condition for awt, component and mouse. -
canvasBounds
Canvas boundary. -
canvasCenter
Canvas center. -
deadFactor
protected float deadFactorCanvas rescale factor. -
deadXSize
protected float deadXSizeCanvas resacled X size. -
deadYSize
protected float deadYSizeCanvs rescaled Y size. -
ignoreMouseMotion
protected boolean ignoreMouseMotionflag to invoke the mouse motion event or not. -
MAX_ANGLE
protected float MAX_ANGLEMaxium rotation angle. -
MAX_VELOCITY
protected float MAX_VELOCITYMaxium rotation velocity. -
motion
protected boolean motionMotion, standard, fly thrugh, point. -
mouseCallback
protected com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback mouseCallbackMouse behavior callback. -
newTargetTransform
protected javax.media.j3d.Transform3D newTargetTransformNew target transform. -
parent
JPanel view reference. -
pitchAngle
protected float pitchAngleRotation pitch angle. -
pitchTransform
protected javax.media.j3d.Transform3D pitchTransformSpin transform. -
spinAngle
protected float spinAngleRotation row angle. -
spinTransform
protected javax.media.j3d.Transform3D spinTransformRow transform. -
targetTG
protected javax.media.j3d.TransformGroup targetTGTarget transform group. -
targetTransform
protected javax.media.j3d.Transform3D targetTransformTarget transform. -
velocity
protected javax.vecmath.Vector3f velocityVelocity vector. -
velocityTransform
protected javax.media.j3d.Transform3D velocityTransformTransfrom velocity. -
yawAngle
protected float yawAngleRotation yaw angle. -
yawTransform
protected javax.media.j3d.Transform3D yawTransformYaw transform.
-
-
Constructor Details
-
MouseBehaviorRenderer
Creates new parent class with the dialog set for easy access between the user and the behaviors.- Parameters:
parent- Parent dialog.
-
-
Method Details
-
getCanvasCenter
Gets the canvas center. Needed for the mouse control buttons to properly set up the mouse event.- Returns:
- The canvas center.
-
getTarget
public javax.media.j3d.TransformGroup getTarget()Returns the TransformGroup this behavior acts on.- Returns:
- The transform group this behavior acts on.
-
initialize
public void initialize()Required to be a ViewPlatformBehavior. Creates new transforms and calls wakeupOn.- Specified by:
initializein classjavax.media.j3d.Behavior
-
isIgnoreMouseMotion
public boolean isIgnoreMouseMotion()Indicates whether or not the canvas is ignoring mouse events.- Returns:
trueindicates the canvas is ignoring mouse events,falsethat they should be processed as usual.
-
processStimulus
Required to be a ViewPlatformBehavior. Processes a list of events, passing them down to the processMouseEvent and integrateTransforms methods.- Specified by:
processStimulusin classjavax.media.j3d.Behavior- Parameters:
en- List of events to process.
-
setMaximumAngle
public void setMaximumAngle(float angle) Sets the maximum angle of the mouse movement.- Parameters:
angle- Angle to set maximum to.
-
setMaximumVelocity
public void setMaximumVelocity(float max) Sets the maximum velocity of the mouse movement.- Parameters:
max- Value to set maximum to.
-
setTarget
public void setTarget(javax.media.j3d.TransformGroup targetTG) Sets the TransformGroup on which this behavior acts.- Parameters:
targetTG- Target transform group to set to.
-
setupCallback
public void setupCallback(com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback callback) Sets who the behavior calls back to.- Parameters:
callback- Place to call back to.
-
integrateTransforms
protected abstract void integrateTransforms()Creates a new transform and sets it in the canvas. -
processMouseEvent
Process the mouse event. This is called every time an event arrives.- Parameters:
evt- Event to process.
-
init
private void init()Initializes wake up events. -
processAWTEvents
Processes an array of AWT events by calling processMouseEvent; or, if the user pressed ESC, disables certain behaviors.- Parameters:
events- List of AWT events to process.
-