public abstract class MouseBehavior extends Behavior implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener
| Modifier and Type | Field and Description |
|---|---|
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.
|
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(java.awt.Component c)
Adds this behavior as a MouseListener, mouseWheelListener 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 |
mouseWheelMoved(java.awt.event.MouseWheelEvent e) |
void |
processMouseEvent(java.awt.event.MouseEvent evt)
Handles mouse events
|
abstract void |
processStimulus(java.util.Iterator<WakeupCriterion> 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.
|
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, postId, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferencescloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickableclearCapability, clearCapabilityIsFrequent, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toStringpublic static final int MANUAL_WAKEUP
public static final int INVERT_INPUT
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)
format - interesting flags (wakeup conditions).public void setTransformGroup(TransformGroup transformGroup)
transformGroup - The *new* transform group to be manipulated.public TransformGroup getTransformGroup()
public void initialize()
initialize in class Behaviorpublic void wakeup()
public void processMouseEvent(java.awt.event.MouseEvent evt)
public abstract void processStimulus(java.util.Iterator<WakeupCriterion> criteria)
processStimulus in class Behaviorcriteria - an iterator of triggered wakeup criteria for this
behaviorpublic void addListener(java.awt.Component c)
c - The component to add the MouseListener, MouseWheelListener 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.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void setEnable(boolean state)
Behaviorpublic void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved in interface java.awt.event.MouseWheelListener