synergynetframework.jme.cursorsystem
Class CursorRegistry

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

public class CursorRegistry
extends java.lang.Object

Utility class used predominantly by the cursor system to maintain a record of all currently active cursors. A singleton. The cursors are in JME screen coordinates.

Author:
dcs0ah1

Method Summary
 void addCursor(ScreenCursor cursor)
          Adds the cursor.
 boolean containsKey(long id)
          Contains key.
 java.util.List<ScreenCursor> getCurrentRegisteredCursors()
          Returns a cloned List whose contents are the current cursors at the time of asking.
 ScreenCursor getCursor(long id)
          Gets the cursor.
static CursorRegistry getInstance()
          Gets the single instance of CursorRegistry.
 int numCursors()
          Num cursors.
 void removeCursor(long id)
          Removes the cursor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

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

Returns:
single instance of CursorRegistry

addCursor

public void addCursor(ScreenCursor cursor)
Adds the cursor.

Parameters:
cursor - the cursor

containsKey

public boolean containsKey(long id)
Contains key.

Parameters:
id - the id
Returns:
true, if successful

getCurrentRegisteredCursors

public java.util.List<ScreenCursor> getCurrentRegisteredCursors()
Returns a cloned List whose contents are the current cursors at the time of asking.

Returns:
the current registered cursors

getCursor

public ScreenCursor getCursor(long id)
Gets the cursor.

Parameters:
id - the id
Returns:
the cursor

numCursors

public int numCursors()
Num cursors.

Returns:
the int

removeCursor

public void removeCursor(long id)
Removes the cursor.

Parameters:
id - the id

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object