|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.datecs.api.universalreader.TouchEvent
public final class TouchEvent
This class is used to report single touch event from touch screen peripherals.
| Field Summary | |
|---|---|
static int |
ACTION_DOWN
A pressed gesture has started, the touch event contains a valid location of event. |
static int |
ACTION_UP
A pressed gesture has finished, the touch event does not contains a valid location. |
| Constructor Summary | |
|---|---|
TouchEvent(int x,
int y,
int pressure,
int elapse)
Constructs a TouchEvent, filling in all of the basic values
that define the touch. |
|
| Method Summary | |
|---|---|
int |
getAction()
Gets the kind of action being performed. |
int |
getElapse()
Gets the time between this event and the previous one. |
int |
getPressure()
Gets the current pressure of this event. |
int |
getX()
Gets the X coordinate of this event. |
int |
getY()
Gets the Y coordinate of this event. |
static TouchEvent[] |
obtainArray(byte[] data)
Constructs a new instance of this class from a given byte array. |
java.lang.String |
toString()
Returns the string representation of object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ACTION_DOWN
public static final int ACTION_UP
| Constructor Detail |
|---|
public TouchEvent(int x,
int y,
int pressure,
int elapse)
TouchEvent, filling in all of the basic values
that define the touch.
x - the X coordinate of this event.y - the Y coordinate of this event.pressure - the current pressure of this event.elapse - the time (in ms) between this event and the previous one.| Method Detail |
|---|
public static TouchEvent[] obtainArray(byte[] data)
Every touch event in array must be defined in block of 4 bytes, in format: X coordinate, Y coordinate, pressure, elapse (4 ms units).
If data is null, a NullPointerException is
thrown.
If (data.length % 4) != 0, a IllegalArgumentException is
thrown.
data - the byte array contains blocks with touch events.
TouchEvent[].public int getX()
public int getY()
public int getPressure()
public int getElapse()
public int getAction()
ACTION_DOWN or ACTION_UP.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||