synergynetframework.jme.cursorsystem
Class MultiTouchElementRegistry

java.lang.Object
  extended by synergynetframework.jme.cursorsystem.MultiTouchElementRegistry

public class MultiTouchElementRegistry
extends java.lang.Object

Whenever a Spatial is to be interacted with, using the multitouch interface, a MultiTouchElement is created. Creating a MultiTouchElement, or any of its subclasses, will cause that element to be registered with MultiTouchElementRegistry. This registry is responsible for tracking registered elements, allowing for elements to be registered and de-registered. Further, this registry maintains state on which cursors are associated with a particular MultiTouchElement. For example, if two fingers are placed over a single Spatial object, then the cursor system will call associateCursorIDToName twice, for each cursor. getRegisteredElementsForCursorID will return the MultiTouchElements of all Spatials associated with a single cursor.

Author:
dcs0ah1

Method Summary
 void associateCursorIDToName(long id, java.lang.String name)
          Associate cursor id to name.
 void associateCursorIDToName(PickResultData pickResultData)
          Associate cursor id to name.
 MultiTouchElement getElementByTargetSpatial(com.jme.scene.Spatial s)
          Gets the element by target spatial.
static MultiTouchElementRegistry getInstance()
          Gets the single instance of MultiTouchElementRegistry.
 java.util.List<MultiTouchElement> getRegisteredElementsForCursorID(long id)
          Gets the registered elements for cursor id.
 boolean isRegistered(MultiTouchElement e)
          Checks if is registered.
 boolean isRegistered(com.jme.scene.Spatial s)
          Checks if is registered.
 void register(MultiTouchElement mrs)
          Register.
 void removeCursorIDToNamesAssociations(long id)
          Removes the cursor id to names associations.
 void unregister(MultiTouchElement e)
          Unregister.
 void unregisterElementsForSpatial(com.jme.scene.Spatial s)
          Unregister elements for spatial.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MultiTouchElementRegistry getInstance()
Gets the single instance of MultiTouchElementRegistry.

Returns:
single instance of MultiTouchElementRegistry

associateCursorIDToName

public void associateCursorIDToName(long id,
                                    java.lang.String name)
Associate cursor id to name.

Parameters:
id - the id
name - the name

associateCursorIDToName

public void associateCursorIDToName(PickResultData pickResultData)
Associate cursor id to name.

Parameters:
pickResultData - the pick result data

getElementByTargetSpatial

public MultiTouchElement getElementByTargetSpatial(com.jme.scene.Spatial s)
Gets the element by target spatial.

Parameters:
s - the s
Returns:
the element by target spatial

getRegisteredElementsForCursorID

public java.util.List<MultiTouchElement> getRegisteredElementsForCursorID(long id)
Gets the registered elements for cursor id.

Parameters:
id - the id
Returns:
the registered elements for cursor id

isRegistered

public boolean isRegistered(MultiTouchElement e)
Checks if is registered.

Parameters:
e - the e
Returns:
true, if is registered

isRegistered

public boolean isRegistered(com.jme.scene.Spatial s)
Checks if is registered.

Parameters:
s - the s
Returns:
true, if is registered

register

public void register(MultiTouchElement mrs)
Register.

Parameters:
mrs - the mrs

removeCursorIDToNamesAssociations

public void removeCursorIDToNamesAssociations(long id)
Removes the cursor id to names associations.

Parameters:
id - the id

unregister

public void unregister(MultiTouchElement e)
Unregister.

Parameters:
e - the e

unregisterElementsForSpatial

public void unregisterElementsForSpatial(com.jme.scene.Spatial s)
Unregister elements for spatial.

Parameters:
s - the s