org.xith3d.picking
Class ScheduledPicker

java.lang.Object
  extended by org.xith3d.loop.opscheduler.impl.ScheduledOperationImpl
      extended by org.xith3d.picking.ScheduledPicker
All Implemented Interfaces:
ScheduledOperation, Updatable

public class ScheduledPicker
extends ScheduledOperationImpl

Since picking is done by the render thread (RenderLoop) an instance of this class is put into the RenderLoop's scheduler. When picking is done, the PickListener is notified.

See Also:
PickListener

Constructor Summary
ScheduledPicker()
          Generates a new ScheduledPicker instance.
ScheduledPicker(GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, AllPickListener pl)
          Generates a new ScheduledPicker instance.
ScheduledPicker(GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, AllPickListener pl, java.lang.Object userObject)
          Generates a new ScheduledPicker instance.
ScheduledPicker(GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, NearestPickListener pl)
          Generates a new ScheduledPicker instance.
ScheduledPicker(GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, NearestPickListener pl, java.lang.Object userObject)
          Generates a new ScheduledPicker instance.
ScheduledPicker(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, AllPickListener pl)
          Generates a new ScheduledPicker instance.
ScheduledPicker(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, AllPickListener pl, java.lang.Object userObject)
          Generates a new ScheduledPicker instance.
ScheduledPicker(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, NearestPickListener pl)
          Generates a new ScheduledPicker instance.
ScheduledPicker(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, NearestPickListener pl, java.lang.Object userObject)
          Generates a new ScheduledPicker instance.
 
Method Summary
 AllPickListener getAllPickListener()
           
 Canvas3D getCanvas()
           
 int getMouseX()
           
 int getMouseY()
           
 NearestPickListener getNearestPickListener()
           
 java.lang.Object getUserObject()
           
 void init(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, AllPickListener pl, java.lang.Object userObject)
          Generates a new ScheduledPicker instance.
 void init(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int mouseX, int mouseY, NearestPickListener pl, java.lang.Object userObject)
          Generates a new ScheduledPicker instance.
 void setUserObject(java.lang.Object userObject)
          Assotiotes a new user object with this instance.
 void update(long gameTime, long frameTime, UpdatingThread.TimingMode timingMode)
          Updates this Updatable object.
 
Methods inherited from class org.xith3d.loop.opscheduler.impl.ScheduledOperationImpl
isAlive, isPersistent, setAlive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduledPicker

public ScheduledPicker()
Generates a new ScheduledPicker instance.


ScheduledPicker

public ScheduledPicker(java.util.List<? extends GroupNode> groups,
                       Canvas3D canvas,
                       org.jagatoo.input.devices.components.MouseButton button,
                       int mouseX,
                       int mouseY,
                       AllPickListener pl,
                       java.lang.Object userObject)
Generates a new ScheduledPicker instance.

Parameters:
groups - the Groups to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done
userObject - this user object is passed back to the onNodePicked() method

ScheduledPicker

public ScheduledPicker(GroupNode group,
                       Canvas3D canvas,
                       org.jagatoo.input.devices.components.MouseButton button,
                       int mouseX,
                       int mouseY,
                       AllPickListener pl,
                       java.lang.Object userObject)
Generates a new ScheduledPicker instance.

Parameters:
group - the Groups to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done
userObject - this user object is passed back to the onObjectPicked() method of the PickListener

ScheduledPicker

public ScheduledPicker(java.util.List<? extends GroupNode> groups,
                       Canvas3D canvas,
                       org.jagatoo.input.devices.components.MouseButton button,
                       int mouseX,
                       int mouseY,
                       AllPickListener pl)
Generates a new ScheduledPicker instance.

Parameters:
groups - the Groups to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done

ScheduledPicker

public ScheduledPicker(GroupNode group,
                       Canvas3D canvas,
                       org.jagatoo.input.devices.components.MouseButton button,
                       int mouseX,
                       int mouseY,
                       AllPickListener pl)
Generates a new ScheduledPicker instance.

Parameters:
group - the Groups to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done

ScheduledPicker

public ScheduledPicker(java.util.List<? extends GroupNode> groups,
                       Canvas3D canvas,
                       org.jagatoo.input.devices.components.MouseButton button,
                       int mouseX,
                       int mouseY,
                       NearestPickListener pl,
                       java.lang.Object userObject)
Generates a new ScheduledPicker instance.

Parameters:
groups - the Groups to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done
userObject - this user object is passed back to the onNodePicked() method

ScheduledPicker

public ScheduledPicker(GroupNode group,
                       Canvas3D canvas,
                       org.jagatoo.input.devices.components.MouseButton button,
                       int mouseX,
                       int mouseY,
                       NearestPickListener pl,
                       java.lang.Object userObject)
Generates a new ScheduledPicker instance.

Parameters:
group - the Groups to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done
userObject - this user object is passed back to the onObjectPicked() method of the PickListener

ScheduledPicker

public ScheduledPicker(java.util.List<? extends GroupNode> groups,
                       Canvas3D canvas,
                       org.jagatoo.input.devices.components.MouseButton button,
                       int mouseX,
                       int mouseY,
                       NearestPickListener pl)
Generates a new ScheduledPicker instance.

Parameters:
groups - the Groups to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done

ScheduledPicker

public ScheduledPicker(GroupNode group,
                       Canvas3D canvas,
                       org.jagatoo.input.devices.components.MouseButton button,
                       int mouseX,
                       int mouseY,
                       NearestPickListener pl)
Generates a new ScheduledPicker instance.

Parameters:
group - the Groups to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done
Method Detail

getUserObject

public java.lang.Object getUserObject()
Returns:
the user object assotiated with this instance if any

setUserObject

public void setUserObject(java.lang.Object userObject)
Assotiotes a new user object with this instance.


getAllPickListener

public AllPickListener getAllPickListener()
Returns:
the Listener for the picking result

getNearestPickListener

public NearestPickListener getNearestPickListener()
Returns:
the Listener for the picking result

getCanvas

public Canvas3D getCanvas()
Returns:
the Canvas3D-instance on which the picking was done

getMouseX

public int getMouseX()
Returns:
the mouse-x coordinate whre the picking should be made

getMouseY

public int getMouseY()
Returns:
the mouse-x coordinate whre the picking should be made

update

public void update(long gameTime,
                   long frameTime,
                   UpdatingThread.TimingMode timingMode)
Updates this Updatable object.

Parameters:
gameTime - the gameTime in Milliseconds
frameTime - the frameTime in Milliseconds (needed time for the last frame)
timingMode - the TimingMode to use for frameTime.

init

public void init(java.util.List<? extends GroupNode> groups,
                 Canvas3D canvas,
                 org.jagatoo.input.devices.components.MouseButton button,
                 int mouseX,
                 int mouseY,
                 AllPickListener pl,
                 java.lang.Object userObject)
Generates a new ScheduledPicker instance.

Parameters:
groups - the List of GroupNodes to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done
userObject - this user object is passed back to the onNodePicked() method

init

public void init(java.util.List<? extends GroupNode> groups,
                 Canvas3D canvas,
                 org.jagatoo.input.devices.components.MouseButton button,
                 int mouseX,
                 int mouseY,
                 NearestPickListener pl,
                 java.lang.Object userObject)
Generates a new ScheduledPicker instance.

Parameters:
groups - the List of GroupNodes to do the picking on
canvas - the canvas to do the picking on
button - the mouse button, that was clicked
mouseX - the x-position of the mouse on the canvas
mouseY - the y-position of the mouse on the canvas
pl - the picklistener to use for callback when picking is done
userObject - this user object is passed back to the onNodePicked() method