PQSDKMultiTouch
Class PQMTClient

java.lang.Object
  extended by PQSDKMultiTouch.PQMTClient

public abstract class PQMTClient
extends java.lang.Object

This class contains all method you need to interact with Multi-Touch server subclass PQMTClient to use it.


Constructor Summary
PQMTClient()
           
 
Method Summary
 int ConnectServer()
          Connect the Multi-Touch server with default ip and port
 int ConnectServer(java.lang.String ip, int port)
          Connect the Multi-Touch server
 int DisconnectServer()
           
static java.lang.String GetGestureName(TouchGesture tg)
          gets the touch gesture name of the touch gesture.
 int GetServerResolution()
          gets the display resolution of multi-touch server.
static java.util.UUID GetTrialAppID()
          UUID is an sole id of your application.
 int OnGetResolution(int max_x, int max_y)
          This method is called when GetServerResolution returns.
 int OnReceiveError(int err_code)
          This method is called when an error is received from server.
 int OnServerBreak()
          This method is called on server break.
 int OnTouchFrame(int frame_id, int time_stamp, java.util.Vector<TouchPoint> point_list)
          This method is called whenever a touch point is received from server.
 int OnTouchGesture(TouchGesture touch_gesture)
          This method is called whenever a gesture is received from server.
 int SendRequest(TouchClientRequest client_request)
          Sends your request to the server after connect the multi-touch server successfully.
 int SendThreshold(int move_threshold)
          By default the server will send out the moving touch points to client with a tolerance so that some “still” touch points, which is closed to its last move position, will be filtered.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PQMTClient

public PQMTClient()
Method Detail

ConnectServer

public int ConnectServer()
                  throws java.lang.Exception
Connect the Multi-Touch server with default ip and port

Returns:
PQMTClientConstant.PQ_MT_SUCESS on success, or an error code upon error
Throws:
java.lang.Exception
See Also:
PQMTClientConstant

ConnectServer

public int ConnectServer(java.lang.String ip,
                         int port)
                  throws java.net.UnknownHostException,
                         java.io.IOException
Connect the Multi-Touch server

Parameters:
ip - ip address of server in String
port - port number in int
Returns:
PQMTClientConstant.PQ_MT_SUCESS on success, or an error code upon error
Throws:
java.net.UnknownHostException
java.io.IOException
See Also:
PQMTClientConstant

SendRequest

public int SendRequest(TouchClientRequest client_request)
                throws java.io.IOException
Sends your request to the server after connect the multi-touch server successfully. The request tell the server which service you’d like to enjoy

Throws:
java.io.IOException
See Also:
TouchClientRequest

DisconnectServer

public int DisconnectServer()
                     throws java.io.IOException
Throws:
java.io.IOException

SendThreshold

public int SendThreshold(int move_threshold)
                  throws java.io.IOException
By default the server will send out the moving touch points to client with a tolerance so that some “still” touch points, which is closed to its last move position, will be filtered. If you need all the touch points or you want to filter more “still” touch points, you can send specified move threshold to the server, the move threshold is in pixel.

Parameters:
move_threshold - the move threshold that will filter some points not move in pixel(the pixel in the coordinate of server), 0 for highest sensitivity in server;
Throws:
java.io.IOException

GetServerResolution

public int GetServerResolution()
                        throws java.io.IOException
gets the display resolution of multi-touch server. There is no need to get the resolution information of server if client is working on the same host, but when the client is working at another PC different with server, the

Throws:
java.io.IOException

GetGestureName

public static java.lang.String GetGestureName(TouchGesture tg)
gets the touch gesture name of the touch gesture.

Parameters:
tg - the TouchGesture object
Returns:
gesture name in String
See Also:
TouchGesture

GetTrialAppID

public static java.util.UUID GetTrialAppID()
UUID is an sole id of your application. This method returns a UUID for trial, it’s reserved at present

Returns:
a reserved UUID object

OnTouchGesture

public int OnTouchGesture(TouchGesture touch_gesture)
This method is called whenever a gesture is received from server. Overwrite this method to handle gestures in your application To receive gesture, the TouchClientRequest.type should contain PQMTClientConstant.RQST_GESTURE_INSIDE or PQMTClientConstant.RQST_GESTURE_ALL

See Also:
SendRequest(TouchClientRequest)

OnTouchFrame

public int OnTouchFrame(int frame_id,
                        int time_stamp,
                        java.util.Vector<TouchPoint> point_list)
This method is called whenever a touch point is received from server. Overwrite this method to handle raw touch point in your application To receive gesture, the TouchClientRequest.type should contain PQMTClientConstant.RQST_ROWDATA_INSIDE , PQMTClientConstant.RQST_ROWDATA_INSIDE_ONLY or PQMTClientConstant.RQST_RAWDATA_ALL

See Also:
OnTouchGesture(TouchGesture), SendRequest(TouchClientRequest)

OnGetResolution

public int OnGetResolution(int max_x,
                           int max_y)
This method is called when GetServerResolution returns. Overwrite this method to calculating the point position and width/height for client

See Also:
GetServerResolution()

OnServerBreak

public int OnServerBreak()
This method is called on server break. Overwrite this method to handle server break gracefully


OnReceiveError

public int OnReceiveError(int err_code)
This method is called when an error is received from server. Overwrite this method to handle errors gracefully