synergynetframework.mtinput.simulator
Class AbstractMultiTouchSimulator

java.lang.Object
  extended by synergynetframework.mtinput.simulator.AbstractMultiTouchSimulator
All Implemented Interfaces:
IMultiTouchInputSource, IMultiTouchSimulator
Direct Known Subclasses:
AbstractDirectMultiTouchSimulator, JMETUIOSimulator

public abstract class AbstractMultiTouchSimulator
extends java.lang.Object
implements IMultiTouchSimulator, IMultiTouchInputSource

Default implementation of the jME simulator system. Left click to simulate a single finger. Right click, drag and release to simulate two fingers that can then be moved (mouse movement), rotated around their centre (using SHIFT) or scaled in and out (using CTRL).

Author:
ashatch

Constructor Summary
AbstractMultiTouchSimulator(int tableWidth, int tableHeight)
          Instantiates a new abstract multi touch simulator.
 
Method Summary
 void clearCursor()
          Clear cursor.
abstract  void deleteCursor(int id, float x, float y)
          Delete cursor.
abstract  void deleteTwoCursors(int id1, float x1, float y1, int id2, float x2, float y2)
          Delete two cursors.
 AbstractSimCursor getCurrentCursor()
          Gets the current cursor.
 int getNewCursorID()
          Gets the new cursor id.
 void keyPressed(java.lang.String key)
          Key pressed.
 void keyReleased(java.lang.String key)
          Key released.
 void mouseDragged(int x, int y, int button)
          Mouse dragged.
 void mouseMoved(int x, int y)
          Mouse moved.
 void mousePressed(int x, int y, int button)
          Mouse pressed.
 void mouseReleased(int x, int y, int button)
          Mouse released.
abstract  void newCursor(int id, float x, float y)
          New cursor.
 void registerMultiTouchEventListener(IMultiTouchEventListener listener)
          Register the listener to receive multi-touch events, as defined in IMultiTouchInputListener.
 void registerMultiTouchEventListener(IMultiTouchEventListener listener, int index)
          Register multi touch event listener.
 void setClickSensitivity(long time, float distance)
          Determines whether two successive cursor add/remove events constitute a 'click'.
 void start()
          Start.
 void stop()
          Stop.
 void unregisterMultiTouchEventListener(IMultiTouchEventListener listener)
          Stops the listener from receiving multi-touch events.
abstract  void updateCursor(int id, float x, float y)
          Update cursor.
abstract  void updateTwoCursors(int id1, float x, float y, int id2, float x2, float y2)
          Update two cursors.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface synergynetframework.mtinput.IMultiTouchInputSource
update
 

Constructor Detail

AbstractMultiTouchSimulator

public AbstractMultiTouchSimulator(int tableWidth,
                                   int tableHeight)
Instantiates a new abstract multi touch simulator.

Parameters:
tableWidth - the table width
tableHeight - the table height
Method Detail

clearCursor

public void clearCursor()
Description copied from interface: IMultiTouchSimulator
Clear cursor.

Specified by:
clearCursor in interface IMultiTouchSimulator

deleteCursor

public abstract void deleteCursor(int id,
                                  float x,
                                  float y)
Description copied from interface: IMultiTouchSimulator
Delete cursor.

Specified by:
deleteCursor in interface IMultiTouchSimulator
Parameters:
id - the id
x - the x
y - the y

deleteTwoCursors

public abstract void deleteTwoCursors(int id1,
                                      float x1,
                                      float y1,
                                      int id2,
                                      float x2,
                                      float y2)
Description copied from interface: IMultiTouchSimulator
Delete two cursors.

Specified by:
deleteTwoCursors in interface IMultiTouchSimulator
Parameters:
id1 - the id1
x1 - the x
y1 - the y
id2 - the id2
x2 - the x2
y2 - the y2

getCurrentCursor

public AbstractSimCursor getCurrentCursor()
Gets the current cursor.

Returns:
the current cursor

getNewCursorID

public int getNewCursorID()
Gets the new cursor id.

Returns:
the new cursor id

keyPressed

public void keyPressed(java.lang.String key)
Key pressed.

Parameters:
key - the key

keyReleased

public void keyReleased(java.lang.String key)
Key released.

Parameters:
key - the key

mouseDragged

public void mouseDragged(int x,
                         int y,
                         int button)
Mouse dragged.

Parameters:
x - the x
y - the y
button - the button

mouseMoved

public void mouseMoved(int x,
                       int y)
Mouse moved.

Parameters:
x - the x
y - the y

mousePressed

public void mousePressed(int x,
                         int y,
                         int button)
Mouse pressed.

Parameters:
x - the x
y - the y
button - the button

mouseReleased

public void mouseReleased(int x,
                          int y,
                          int button)
Mouse released.

Parameters:
x - the x
y - the y
button - the button

newCursor

public abstract void newCursor(int id,
                               float x,
                               float y)
Description copied from interface: IMultiTouchSimulator
New cursor.

Specified by:
newCursor in interface IMultiTouchSimulator
Parameters:
id - the id
x - the x
y - the y

registerMultiTouchEventListener

public void registerMultiTouchEventListener(IMultiTouchEventListener listener)
Description copied from interface: IMultiTouchInputSource
Register the listener to receive multi-touch events, as defined in IMultiTouchInputListener.

Specified by:
registerMultiTouchEventListener in interface IMultiTouchInputSource
Parameters:
listener - the listener

registerMultiTouchEventListener

public void registerMultiTouchEventListener(IMultiTouchEventListener listener,
                                            int index)
Description copied from interface: IMultiTouchInputSource
Register multi touch event listener.

Specified by:
registerMultiTouchEventListener in interface IMultiTouchInputSource
Parameters:
listener - the listener
index - the index

setClickSensitivity

public void setClickSensitivity(long time,
                                float distance)
Description copied from interface: IMultiTouchInputSource
Determines whether two successive cursor add/remove events constitute a 'click'. Determines how close together in both time (in milliseconds) and space (in coordinate mode distance).

Specified by:
setClickSensitivity in interface IMultiTouchInputSource
Parameters:
time - in milliseconds
distance - in coordinate space

start

public void start()
Start.


stop

public void stop()
Stop.


unregisterMultiTouchEventListener

public void unregisterMultiTouchEventListener(IMultiTouchEventListener listener)
Description copied from interface: IMultiTouchInputSource
Stops the listener from receiving multi-touch events.

Specified by:
unregisterMultiTouchEventListener in interface IMultiTouchInputSource
Parameters:
listener - the listener

updateCursor

public abstract void updateCursor(int id,
                                  float x,
                                  float y)
Description copied from interface: IMultiTouchSimulator
Update cursor.

Specified by:
updateCursor in interface IMultiTouchSimulator
Parameters:
id - the id
x - the x
y - the y

updateTwoCursors

public abstract void updateTwoCursors(int id1,
                                      float x,
                                      float y,
                                      int id2,
                                      float x2,
                                      float y2)
Description copied from interface: IMultiTouchSimulator
Update two cursors.

Specified by:
updateTwoCursors in interface IMultiTouchSimulator
Parameters:
id1 - the id1
x - the x
y - the y
id2 - the id2
x2 - the x2
y2 - the y2