|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
Base class for all mouse manipulators (see MouseRotate, MouseZoom and MouseTranslate for examples of how to extend this base class).
Field Summary | |
protected boolean |
buttonPress
|
protected Transform3D |
currXform
|
protected boolean |
enable
|
protected int |
flags
|
protected boolean |
invert
|
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 WakeupOr |
mouseCriterion
|
protected WakeupCriterion[] |
mouseEvents
|
protected java.util.LinkedList |
mouseq
|
protected boolean |
reset
|
protected TransformGroup |
transformGroup
|
protected Transform3D |
transformX
|
protected Transform3D |
transformY
|
protected boolean |
wakeUp
|
protected int |
x
|
protected int |
x_last
|
protected int |
y
|
protected int |
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_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
Constructor Summary | |
MouseBehavior(java.awt.Component c,
int format)
Creates a mouse behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent. |
|
MouseBehavior(java.awt.Component c,
TransformGroup transformGroup)
Creates a mouse behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent. |
|
MouseBehavior(int format)
Initializes standard fields. |
|
MouseBehavior(TransformGroup transformGroup)
Creates a mouse behavior object with a given transform group. |
Method Summary | |
void |
addListener(java.awt.Component c)
Adds this behavior as a MouseListener and MouseMotionListener to the specified component. |
TransformGroup |
getTransformGroup()
Return the transformGroup on which this node is operating |
void |
initialize()
Initializes the behavior. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
processMouseEvent(java.awt.event.MouseEvent evt)
Handles mouse events |
abstract void |
processStimulus(java.util.Enumeration criteria)
All mouse manipulators must implement this. |
void |
setEnable(boolean state)
Enables or disables this Behavior. |
void |
setTransformGroup(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, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn |
Methods inherited from class javax.media.j3d.Node |
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected WakeupCriterion[] mouseEvents
protected WakeupOr mouseCriterion
protected int x
protected int y
protected int x_last
protected int y_last
protected TransformGroup transformGroup
protected Transform3D transformX
protected Transform3D transformY
protected Transform3D currXform
protected boolean buttonPress
protected boolean reset
protected boolean invert
protected boolean wakeUp
protected int flags
protected java.util.LinkedList mouseq
protected boolean enable
public static final int MANUAL_WAKEUP
public static final int INVERT_INPUT
Constructor Detail |
public MouseBehavior(TransformGroup transformGroup)
transformGroup
- The transform group to be manipulated.public MouseBehavior(int format)
format
- flagspublic MouseBehavior(java.awt.Component c, TransformGroup transformGroup)
c
- The Component to add the MouseListener and
MouseMotionListener to.transformGroup
- The TransformGroup to operate on.public MouseBehavior(java.awt.Component c, int format)
Method Detail |
public void setTransformGroup(TransformGroup transformGroup)
transformGroup
- The *new* transform group to be manipulated.public TransformGroup getTransformGroup()
public void initialize()
initialize
in class Behavior
public void wakeup()
public void processMouseEvent(java.awt.event.MouseEvent evt)
public abstract void processStimulus(java.util.Enumeration criteria)
processStimulus
in class Behavior
criteria
- an enumeration of triggered wakeup criteria for this
behaviorpublic void addListener(java.awt.Component c)
c
- The component to add the MouseListener and
MouseMotionListener to.
java.lang.IllegalStateException
- if the behavior was not created
as a listenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void setEnable(boolean state)
Behavior
setEnable
in class Behavior
state
- true or false to enable or disable this Behavior
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |