Class MouseBehavior
- java.lang.Object
-
- javax.media.j3d.SceneGraphObject
-
- javax.media.j3d.Node
-
- javax.media.j3d.Leaf
-
- javax.media.j3d.Behavior
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.rfaview.mouse.MouseBehavior
-
- Direct Known Subclasses:
MouseOrbit
,MouseProperties
,MouseRotate
,MouseSelection
,MouseTranslate
,MouseTranslation
,MouseZoom
,MouseZoomBehavior
public abstract class MouseBehavior extends javax.media.j3d.Behavior
Title: MouseBehavior
Description: Base class for all mouse manipulators (see MouseRotate, MouseZoom and MouseTranslate for examples of how to extend this base class). Added protected TransformGroup ViewerTG to hold the viewers position
-
-
Field Summary
Fields Modifier and Type Field Description boolean
behaviorfix
DOCUMENT ME!protected boolean
buttonPress
DOCUMENT ME!protected javax.media.j3d.Transform3D
currXform
DOCUMENT ME!protected int
flags
DOCUMENT ME!protected boolean
invert
DOCUMENT ME!static int
INVERT_INPUT
Set this flag if you want to invert the inputs.static int
MANUAL_WAKEUP
Set this flag if you want to manually wakeup the behavior.protected javax.media.j3d.WakeupOr
mouseCriterion
DOCUMENT ME!protected javax.media.j3d.WakeupCriterion[]
mouseEvents
DOCUMENT ME!protected boolean
reset
DOCUMENT ME!protected javax.media.j3d.TransformGroup
transformGroup
DOCUMENT ME!protected javax.media.j3d.Transform3D
transformX
DOCUMENT ME!protected javax.media.j3d.Transform3D
transformY
DOCUMENT ME!protected javax.media.j3d.TransformGroup
ViewerTG
DOCUMENT ME!protected boolean
wakeUp
DOCUMENT ME!protected int
x
DOCUMENT ME!protected int
x_last
DOCUMENT ME!protected int
y
DOCUMENT ME!protected int
y_last
DOCUMENT ME!-
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 MouseBehavior(int format)
Initializes standard fields.MouseBehavior(int format, boolean behaviorfix)
Same as constructor above but with behaviorfix.MouseBehavior(int format, javax.media.j3d.TransformGroup VPTG, boolean behaviorfix)
Creates a new MouseBehavior object.MouseBehavior(javax.media.j3d.TransformGroup transformGroup)
Creates a mouse behavior object with a given transform group.MouseBehavior(javax.media.j3d.TransformGroup transformGroup, javax.media.j3d.TransformGroup VPTG, boolean behaviorfix)
Creates a new MouseBehavior object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
initialize()
Initializes the behavior.void
processMouseEvent(java.awt.event.MouseEvent evt)
Handles mouse events.abstract void
processStimulus(java.util.Enumeration criteria)
All mouse manipulators must implement this.void
setTransformGroup(javax.media.j3d.TransformGroup transformGroup)
Swap a new transformGroup replacing the old one.void
wakeup()
Manually wake up the behavior.-
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
-
-
-
-
Field Detail
-
MANUAL_WAKEUP
public static final int MANUAL_WAKEUP
Set this flag if you want to manually wakeup the behavior.- See Also:
- Constant Field Values
-
INVERT_INPUT
public static final int INVERT_INPUT
Set this flag if you want to invert the inputs. This is useful when the transform for the view platform is being changed instead of the transform for the object.- See Also:
- Constant Field Values
-
behaviorfix
public boolean behaviorfix
DOCUMENT ME!
-
buttonPress
protected boolean buttonPress
DOCUMENT ME!
-
currXform
protected javax.media.j3d.Transform3D currXform
DOCUMENT ME!
-
flags
protected int flags
DOCUMENT ME!
-
invert
protected boolean invert
DOCUMENT ME!
-
mouseCriterion
protected javax.media.j3d.WakeupOr mouseCriterion
DOCUMENT ME!
-
mouseEvents
protected javax.media.j3d.WakeupCriterion[] mouseEvents
DOCUMENT ME!
-
reset
protected boolean reset
DOCUMENT ME!
-
transformGroup
protected javax.media.j3d.TransformGroup transformGroup
DOCUMENT ME!
-
transformX
protected javax.media.j3d.Transform3D transformX
DOCUMENT ME!
-
transformY
protected javax.media.j3d.Transform3D transformY
DOCUMENT ME!
-
ViewerTG
protected javax.media.j3d.TransformGroup ViewerTG
DOCUMENT ME!
-
wakeUp
protected boolean wakeUp
DOCUMENT ME!
-
x
protected int x
DOCUMENT ME!
-
y
protected int y
DOCUMENT ME!
-
x_last
protected int x_last
DOCUMENT ME!
-
y_last
protected int y_last
DOCUMENT ME!
-
-
Constructor Detail
-
MouseBehavior
public MouseBehavior(javax.media.j3d.TransformGroup transformGroup)
Creates a mouse behavior object with a given transform group.- Parameters:
transformGroup
- The transform group to be manipulated.
-
MouseBehavior
public MouseBehavior(int format)
Initializes standard fields. Note that this behavior still needs a transform group to work on (use setTransformGroup(tg)) and the transform group must add this behavior.- Parameters:
format
- flags
-
MouseBehavior
public MouseBehavior(int format, boolean behaviorfix)
Same as constructor above but with behaviorfix.- Parameters:
format
- DOCUMENT ME!behaviorfix
- DOCUMENT ME!
-
MouseBehavior
public MouseBehavior(int format, javax.media.j3d.TransformGroup VPTG, boolean behaviorfix)
Creates a new MouseBehavior object.- Parameters:
format
- DOCUMENT ME!VPTG
- DOCUMENT ME!behaviorfix
- DOCUMENT ME!
-
MouseBehavior
public MouseBehavior(javax.media.j3d.TransformGroup transformGroup, javax.media.j3d.TransformGroup VPTG, boolean behaviorfix)
Creates a new MouseBehavior object.- Parameters:
transformGroup
- DOCUMENT ME!VPTG
- DOCUMENT ME!behaviorfix
- DOCUMENT ME!
-
-
Method Detail
-
processStimulus
public abstract void processStimulus(java.util.Enumeration criteria)
All mouse manipulators must implement this.- Specified by:
processStimulus
in classjavax.media.j3d.Behavior
- Parameters:
criteria
- DOCUMENT ME!
-
initialize
public void initialize()
Initializes the behavior.- Specified by:
initialize
in classjavax.media.j3d.Behavior
-
processMouseEvent
public void processMouseEvent(java.awt.event.MouseEvent evt)
Handles mouse events.- Parameters:
evt
- DOCUMENT ME!
-
setTransformGroup
public void setTransformGroup(javax.media.j3d.TransformGroup transformGroup)
Swap a new transformGroup replacing the old one. This allows manipulators to operate on different nodes.- Parameters:
transformGroup
- The *new* transform group to be manipulated.
-
wakeup
public void wakeup()
Manually wake up the behavior. If MANUAL_WAKEUP flag was set upon creation, you must wake up this behavior each time it is handled.
-
-