org.xith3d.selection
Class SelectionManager

java.lang.Object
  extended by org.xith3d.selection.SelectionManager
All Implemented Interfaces:
org.jagatoo.input.listeners.MouseListener, AllPickListener, PickListenerBase, HUDPickMissedListener

public class SelectionManager
extends java.lang.Object
implements org.jagatoo.input.listeners.MouseListener, AllPickListener, HUDPickMissedListener


Field Summary
static int HUD_PICK_MISSED_MASK
           
 
Constructor Summary
SelectionManager()
           
 
Method Summary
 void addSelectionListener(SelectionListener listener)
           
 void bind(BranchGroup pickableBranch, Canvas3D canvas)
           
 void bind(BranchGroup pickableBranch, RenderPassConfig rpc, Canvas3D canvas)
           
protected  void changeSelection(Selectable selectable, boolean replace)
           
 ContextMenuProvider getContextMenuProvider()
           
 org.jagatoo.input.devices.components.MouseButton getContextMenuTrigger()
           
 org.openmali.vecmath2.Point2i getLastMouseCoords()
           
 org.openmali.vecmath2.Point3f getLastPosition()
           
 MovementConstraints getMovementConstraints()
           
 org.jagatoo.input.devices.components.MouseButton getMovementTrigger()
           
 BranchGroup getSelectionLayer()
           
 org.jagatoo.input.devices.components.MouseButton getSelectionTrigger()
           
 boolean isBound()
           
 void onHUDPickMissed(org.jagatoo.input.devices.components.MouseButton button, int x, int y, HUDPickResult.HUDPickReason pickReason, long when, long meta)
          This event is fired, if no a mouse button was pressed or released and not Widget was hit.
 void onMouseButtonClicked(org.jagatoo.input.events.MouseButtonClickedEvent e, org.jagatoo.input.devices.components.MouseButton button, int clickCount)
           
 void onMouseButtonPressed(org.jagatoo.input.events.MouseButtonPressedEvent e, org.jagatoo.input.devices.components.MouseButton button)
           
 void onMouseButtonReleased(org.jagatoo.input.events.MouseButtonReleasedEvent e, org.jagatoo.input.devices.components.MouseButton button)
           
 void onMouseButtonStateChanged(org.jagatoo.input.events.MouseButtonEvent e, org.jagatoo.input.devices.components.MouseButton button, boolean state)
           
 void onMouseMoved(org.jagatoo.input.events.MouseMovedEvent e, int x, int y, int dx, int dy)
           
 void onMouseWheelMoved(org.jagatoo.input.events.MouseWheelEvent e, int wheelDelta)
           
 void onObjectsPicked(java.util.List<PickResult> pickResults, java.lang.Object userObject, long pickTime)
          This event is fired when a picking was successful.
 void onPickingMissed(java.lang.Object userObject, long pickTime)
          this Event is fired when a pickray didn't hit any node
 boolean removeSelectionListener(SelectionListener listener)
           
 void setContextMenuProvider(ContextMenuProvider provider)
           
 void setContextMenuTrigger(org.jagatoo.input.devices.components.MouseButton contextMenuTrigger)
           
 void setMovementConstraints(MovementConstraints movementConstraints)
           
 void setMovementTrigger(org.jagatoo.input.devices.components.MouseButton movementTrigger)
           
 void setSelectionTrigger(org.jagatoo.input.devices.components.MouseButton selectionTrigger)
           
 boolean testIntersectionsInWorldSpaceForPicking()
          By default this method should return false.
 void unbind()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HUD_PICK_MISSED_MASK

public static final int HUD_PICK_MISSED_MASK
Constructor Detail

SelectionManager

public SelectionManager()
Method Detail

getLastMouseCoords

public org.openmali.vecmath2.Point2i getLastMouseCoords()

getLastPosition

public org.openmali.vecmath2.Point3f getLastPosition()

getContextMenuTrigger

public org.jagatoo.input.devices.components.MouseButton getContextMenuTrigger()

setContextMenuTrigger

public void setContextMenuTrigger(org.jagatoo.input.devices.components.MouseButton contextMenuTrigger)

getSelectionTrigger

public org.jagatoo.input.devices.components.MouseButton getSelectionTrigger()

setSelectionTrigger

public void setSelectionTrigger(org.jagatoo.input.devices.components.MouseButton selectionTrigger)

getSelectionLayer

public BranchGroup getSelectionLayer()

getMovementTrigger

public org.jagatoo.input.devices.components.MouseButton getMovementTrigger()

setMovementTrigger

public void setMovementTrigger(org.jagatoo.input.devices.components.MouseButton movementTrigger)

addSelectionListener

public void addSelectionListener(SelectionListener listener)

removeSelectionListener

public boolean removeSelectionListener(SelectionListener listener)

setContextMenuProvider

public void setContextMenuProvider(ContextMenuProvider provider)

getContextMenuProvider

public ContextMenuProvider getContextMenuProvider()

getMovementConstraints

public MovementConstraints getMovementConstraints()

setMovementConstraints

public void setMovementConstraints(MovementConstraints movementConstraints)

bind

public void bind(BranchGroup pickableBranch,
                 RenderPassConfig rpc,
                 Canvas3D canvas)

bind

public void bind(BranchGroup pickableBranch,
                 Canvas3D canvas)

unbind

public void unbind()

changeSelection

protected void changeSelection(Selectable selectable,
                               boolean replace)

isBound

public boolean isBound()

onMouseButtonPressed

public void onMouseButtonPressed(org.jagatoo.input.events.MouseButtonPressedEvent e,
                                 org.jagatoo.input.devices.components.MouseButton button)
Specified by:
onMouseButtonPressed in interface org.jagatoo.input.listeners.MouseListener

onHUDPickMissed

public void onHUDPickMissed(org.jagatoo.input.devices.components.MouseButton button,
                            int x,
                            int y,
                            HUDPickResult.HUDPickReason pickReason,
                            long when,
                            long meta)
Description copied from interface: HUDPickMissedListener
This event is fired, if no a mouse button was pressed or released and not Widget was hit.

Specified by:
onHUDPickMissed in interface HUDPickMissedListener
Parameters:
button - the mouse button, that was pressed or released
x - the canvas x-coordinate
y - the canvas y-coordinate

onMouseButtonReleased

public void onMouseButtonReleased(org.jagatoo.input.events.MouseButtonReleasedEvent e,
                                  org.jagatoo.input.devices.components.MouseButton button)
Specified by:
onMouseButtonReleased in interface org.jagatoo.input.listeners.MouseListener

onMouseButtonClicked

public void onMouseButtonClicked(org.jagatoo.input.events.MouseButtonClickedEvent e,
                                 org.jagatoo.input.devices.components.MouseButton button,
                                 int clickCount)
Specified by:
onMouseButtonClicked in interface org.jagatoo.input.listeners.MouseListener

onMouseButtonStateChanged

public void onMouseButtonStateChanged(org.jagatoo.input.events.MouseButtonEvent e,
                                      org.jagatoo.input.devices.components.MouseButton button,
                                      boolean state)
Specified by:
onMouseButtonStateChanged in interface org.jagatoo.input.listeners.MouseListener

onMouseMoved

public void onMouseMoved(org.jagatoo.input.events.MouseMovedEvent e,
                         int x,
                         int y,
                         int dx,
                         int dy)
Specified by:
onMouseMoved in interface org.jagatoo.input.listeners.MouseListener

onMouseWheelMoved

public void onMouseWheelMoved(org.jagatoo.input.events.MouseWheelEvent e,
                              int wheelDelta)
Specified by:
onMouseWheelMoved in interface org.jagatoo.input.listeners.MouseListener

testIntersectionsInWorldSpaceForPicking

public boolean testIntersectionsInWorldSpaceForPicking()
Description copied from interface: PickListenerBase
By default this method should return false.
If it returns true, ray triangle intersections are tested in world space instead of object space.

Specified by:
testIntersectionsInWorldSpaceForPicking in interface PickListenerBase
Returns:
whether or not to test picking intersections in world space

onPickingMissed

public void onPickingMissed(java.lang.Object userObject,
                            long pickTime)
Description copied from interface: PickListenerBase
this Event is fired when a pickray didn't hit any node

Specified by:
onPickingMissed in interface PickListenerBase
Parameters:
userObject - this userObject is passed to the Picker and back to this method
pickTime - the needed time to do this picking

onObjectsPicked

public void onObjectsPicked(java.util.List<PickResult> pickResults,
                            java.lang.Object userObject,
                            long pickTime)
Description copied from interface: AllPickListener
This event is fired when a picking was successful.
It is very important to be aware of the fact, that the List of PickResults is not guaranteed to be valid after this method has been left.

Specified by:
onObjectsPicked in interface AllPickListener
Parameters:
pickResults - all PickResults from this picking operation
userObject - this userObject is passed to the Picker and back to this method
pickTime - the needed time to do this picking