public class TuioClient
extends java.lang.Object
implements com.illposed.osc.OSCListener
TuioListener
interface.
In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events
which are broadcasted to all registered classes that implement the TuioListener
interface.
TuioClient client = new TuioClient();
client.addTuioListener(myTuioListener);
client.connect();
Constructor and Description |
---|
TuioClient()
The default constructor creates a client that listens to the default TUIO port 3333
|
TuioClient(int port)
This constructor creates a client that listens to the provided port
|
Modifier and Type | Method and Description |
---|---|
void |
acceptMessage(java.util.Date date,
com.illposed.osc.OSCMessage message)
The OSC callback method where all TUIO messages are received and decoded
and where the TUIO event callbacks are dispatched
|
void |
addTuioListener(TuioListener listener)
Adds the provided TuioListener to the list of registered TUIO event listeners
|
void |
connect()
The TuioClient starts listening to TUIO messages on the configured UDP port
All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners
|
void |
disconnect()
The TuioClient stops listening to TUIO messages on the configured UDP port
|
TuioBlob |
getTuioBlob(long s_id)
Returns the TuioBlob corresponding to the provided Session ID
or NULL if the Session ID does not refer to an active TuioBlob
|
java.util.ArrayList<TuioBlob> |
getTuioBlobList()
Returns an ArrayList of all currently active TuioBlobs
|
java.util.Vector<TuioBlob> |
getTuioBlobs()
Deprecated.
use
getTuioBlobList() instead. |
TuioCursor |
getTuioCursor(long s_id)
Returns the TuioCursor corresponding to the provided Session ID
or NULL if the Session ID does not refer to an active TuioCursor
|
java.util.ArrayList<TuioCursor> |
getTuioCursorList()
Returns an ArrayList of all currently active TuioCursors
|
java.util.Vector<TuioCursor> |
getTuioCursors()
Deprecated.
use
getTuioCursorList() instead. |
TuioObject |
getTuioObject(long s_id)
Returns the TuioObject corresponding to the provided Session ID
or NULL if the Session ID does not refer to an active TuioObject
|
java.util.ArrayList<TuioObject> |
getTuioObjectList()
Returns an ArrayList of all currently active TuioObjects
|
java.util.Vector<TuioObject> |
getTuioObjects()
Deprecated.
use
getTuioObjectList() instead. |
boolean |
isConnected()
Returns true if this TuioClient is currently connected.
|
void |
removeAllTuioListeners()
Removes all TuioListener from the list of registered TUIO event listeners
|
void |
removeTuioListener(TuioListener listener)
Removes the provided TuioListener from the list of registered TUIO event listeners
|
public TuioClient()
public TuioClient(int port)
port
- the listening port numberpublic void connect()
public void disconnect()
public boolean isConnected()
public void addTuioListener(TuioListener listener)
listener
- the TuioListener to addpublic void removeTuioListener(TuioListener listener)
listener
- the TuioListener to removepublic void removeAllTuioListeners()
@Deprecated public java.util.Vector<TuioObject> getTuioObjects()
getTuioObjectList()
instead.public java.util.ArrayList<TuioObject> getTuioObjectList()
@Deprecated public java.util.Vector<TuioCursor> getTuioCursors()
getTuioCursorList()
instead.public java.util.ArrayList<TuioCursor> getTuioCursorList()
@Deprecated public java.util.Vector<TuioBlob> getTuioBlobs()
getTuioBlobList()
instead.public java.util.ArrayList<TuioBlob> getTuioBlobList()
public TuioObject getTuioObject(long s_id)
s_id
- the Session ID of the required TuioObjectpublic TuioCursor getTuioCursor(long s_id)
s_id
- the Session ID of the required TuioCursorpublic TuioBlob getTuioBlob(long s_id)
s_id
- the Session ID of the required TuioBlobpublic void acceptMessage(java.util.Date date, com.illposed.osc.OSCMessage message)
acceptMessage
in interface com.illposed.osc.OSCListener
date
- the time stamp of the OSC bundlemessage
- the received OSC message