© 2006-2007 ETH Zurich

org.ximtec.igesture.io.tuio
Class TuioReader2D

java.lang.Object
  extended by org.ximtec.igesture.io.AbstractGestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>
      extended by org.ximtec.igesture.io.tuio.TuioReader2D
All Implemented Interfaces:
Device, GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>, ITuioReader, TuioListener

public class TuioReader2D
extends AbstractGestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>
implements ITuioReader

Reader that initializes the TuioConnection and handles the events caused by the TuioConnection. There are three ways to use the TuioReader. 1) Manually After performing the gesture, you can get the gesture with getGesture() and do the recognition. 2) GestureEventListener interface Register with the TuioReader as a GestureEventListener, it will notify you when a gesture was performed. The recognition of the performed gesture can then be done. 3) Configure the TuioReader with a Recogniser When a gesture was performed, the recogniser will automatically try to recognise the gesture and notify GestureHandlers. General steps to use: 1. create the TuioReader 2. connect to a tuio service 3. In case of GestureEventListener : register as a listener In case of Recogniser : set this TuioReaders recogniser

Author:
Bjorn Puype, bpuype@gmail.com
See Also:
TuioConnection

Constructor Summary
TuioReader2D()
          Default Constructor
TuioReader2D(Integer port)
          Constructor
 
Method Summary
 void addTuioCursor(AbstractTuioCursor atcur)
          This callback method is invoked by the TuioClient when a new TuioCursor is added to the session.
 void addTuioObject(AbstractTuioObject atobj)
          This callback method is invoked by the TuioClient when a new TuioObject is added to the session.
 void clear()
          Deletes the current gesture.
 void connect()
          Connect the device.
 void disconnect()
          Disconnect the device.
 void dispose()
          Disposes the device.
 List<org.sigtec.ink.Point> getChunks()
          Returns chunks of a gesture while drawing it.
 Gesture<org.sigtec.ink.Note> getGesture()
          Returns the gestures.
 TuioReaderPanel getPanel()
           
 TuioReaderPanel getPanel(Dimension dimension)
           
 void init()
          Initializes the device.
 void refresh(TuioTime ftime)
          This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle.
 void removeTuioCursor(AbstractTuioCursor atcur)
          This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session.
 void removeTuioObject(AbstractTuioObject atobj)
          This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session.
 void setRecogniser(Recogniser recogniser)
          Set the recogniser to use.
 void updateTuioCursor(AbstractTuioCursor atcur)
          This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session.
 void updateTuioObject(AbstractTuioObject atobj)
          This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session.
 
Methods inherited from class org.ximtec.igesture.io.AbstractGestureDevice
addGestureHandler, fireGestureEvent, getConnectionType, getDeviceClass, getDeviceID, getDeviceType, getName, isConnectable, isConnected, isDefaultDevice, isDisconnectable, removeAllGestureHandler, removeAllListener, removeGestureHandler, setConnectionType, setDefaultDevice, setDeviceID, setDeviceType, setIsConnected, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TuioReader2D

public TuioReader2D()
Default Constructor


TuioReader2D

public TuioReader2D(Integer port)
Constructor

Parameters:
port - Port to listen to.
Method Detail

setRecogniser

public void setRecogniser(Recogniser recogniser)
Set the recogniser to use.

Parameters:
recogniser - Recogniser to use.

connect

public void connect()
Description copied from interface: Device
Connect the device.

Specified by:
connect in interface Device
Specified by:
connect in class AbstractGestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

disconnect

public void disconnect()
Description copied from interface: Device
Disconnect the device.

Specified by:
disconnect in interface Device
Specified by:
disconnect in class AbstractGestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

clear

public void clear()
Description copied from interface: GestureDevice
Deletes the current gesture.

Specified by:
clear in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

dispose

public void dispose()
Description copied from interface: GestureDevice
Disposes the device. After executing this method, gestures are not captured anymore and all dependent resources are released.

Specified by:
dispose in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

getChunks

public List<org.sigtec.ink.Point> getChunks()
Description copied from interface: GestureDevice
Returns chunks of a gesture while drawing it.

Specified by:
getChunks in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>
Returns:
chunks of a gesture.

getGesture

public Gesture<org.sigtec.ink.Note> getGesture()
Description copied from interface: GestureDevice
Returns the gestures. This method should block, if no gesture is available.

Specified by:
getGesture in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>
Returns:
the gesture.

init

public void init()
Description copied from interface: GestureDevice
Initializes the device. After executing this method, gestures can be captured.

Specified by:
init in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

addTuioCursor

public void addTuioCursor(AbstractTuioCursor atcur)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when a new TuioCursor is added to the session.

Specified by:
addTuioCursor in interface TuioListener
Parameters:
atcur - the TuioCursor reference associated to the addTuioCursor event

addTuioObject

public void addTuioObject(AbstractTuioObject atobj)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when a new TuioObject is added to the session.

Specified by:
addTuioObject in interface TuioListener
Parameters:
atobj - the TuioObject reference associated to the addTuioObject event

refresh

public void refresh(TuioTime ftime)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle.

Specified by:
refresh in interface TuioListener
Parameters:
ftime - the TuioTime associated to the current TUIO message bundle

removeTuioCursor

public void removeTuioCursor(AbstractTuioCursor atcur)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session.

Specified by:
removeTuioCursor in interface TuioListener
Parameters:
atcur - the TuioCursor reference associated to the removeTuioCursor event

removeTuioObject

public void removeTuioObject(AbstractTuioObject atobj)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session.

Specified by:
removeTuioObject in interface TuioListener
Parameters:
atobj - the TuioObject reference associated to the removeTuioObject event

updateTuioCursor

public void updateTuioCursor(AbstractTuioCursor atcur)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session.

Specified by:
updateTuioCursor in interface TuioListener
Parameters:
atcur - the TuioCursor reference associated to the updateTuioCursor event

updateTuioObject

public void updateTuioObject(AbstractTuioObject atobj)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session.

Specified by:
updateTuioObject in interface TuioListener
Parameters:
atobj - the TuioObject reference associated to the updateTuioObject event

getPanel

public TuioReaderPanel getPanel()
Specified by:
getPanel in interface ITuioReader

getPanel

public TuioReaderPanel getPanel(Dimension dimension)
Specified by:
getPanel in interface ITuioReader

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.