|
Parkinson Disease Database | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttablet.TabletPoint
public class TabletPoint
Class stores information about tablet packet/point.
Copyright: Copyright (c) 2005 Miroslav Skrbek, Jan Dolezel
Company: ÈVUT FEL, Prague
Field Summary | |
---|---|
static int |
BUTTON_1
1st button is pressed |
static int |
BUTTON_2
2nd button is pressed |
static int |
BUTTON_3
3rd button is pressed |
static int |
BUTTON_TOUCH
pen is touching a surface |
private int[] |
packet
packet with information about point |
static int |
PK_ALTITUDE
altitude of pen above surface |
static int |
PK_AZIMUTH
pen's slope |
static int |
PK_BUTTONS
pressed buttons |
static int |
PK_NORMAL_PRESSURE
pen's pressure |
static int |
PK_SERIAL_NUMBER
packet's serial number |
static int |
PK_TIME
packet's creation time |
static int |
PK_X
x coordinate of point |
static int |
PK_Y
y coordinate of point |
Constructor Summary | |
---|---|
TabletPoint(byte[] array)
creates new point from byte array when loading from file Format of byte array: 3 bytes - x coordinate 3 bytes - y coordinate 4 bytes - time 2 bytes - azimuth 2 bytes - altitude 2 bytes - pressure 1 byte - buttons 3 bytes - serial number |
|
TabletPoint(int[] packet)
creates new point from tablet packet Format of packet: 0 - x coordinate 1 - y coordinate 2 - buttons 3 - azimuth 4 - altitude 5 - pressure 6 - time 7 - serial number |
Method Summary | |
---|---|
int |
getAltitude()
returns altitude of pen above surface |
int |
getAzimuth()
returns slope of pen |
int |
getButtons()
returns pressed buttons |
int |
getNormalPressure()
returns pen's pressure |
int |
getSerialNumber()
returns serial number of packet |
long |
getTime()
returns time of packet's creation |
int |
getX()
returns x coordinate of point |
int |
getY()
returns y coordinate of point |
static java.lang.String |
header()
Header with information about text format of TabletPoint |
boolean |
isButtonPressed(int button)
tests whether is specified button pressed |
boolean |
isTouched()
|
void |
print(java.io.OutputStream out)
writes 20 bytes of information to output stream |
void |
print(java.io.PrintStream out)
writes text representation of point to print stream |
private byte[] |
toByte(int num,
int bytes)
converts int array of bytes |
private int |
toInt(byte[] array,
int bytes,
int position)
converts part of byte array to positive integer |
java.lang.String |
toString()
text representation of TabletPoint |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BUTTON_TOUCH
public static final int BUTTON_1
public static final int BUTTON_2
public static final int BUTTON_3
public static final int PK_X
public static final int PK_Y
public static final int PK_BUTTONS
public static final int PK_AZIMUTH
public static final int PK_ALTITUDE
public static final int PK_NORMAL_PRESSURE
public static final int PK_TIME
public static final int PK_SERIAL_NUMBER
private int[] packet
Constructor Detail |
---|
public TabletPoint(int[] packet)
Format of packet:
0 - x coordinate
1 - y coordinate
2 - buttons
3 - azimuth
4 - altitude
5 - pressure
6 - time
7 - serial number
public TabletPoint(byte[] array)
Format of byte array:
3 bytes - x coordinate
3 bytes - y coordinate
4 bytes - time
2 bytes - azimuth
2 bytes - altitude
2 bytes - pressure
1 byte - buttons
3 bytes - serial number
array
- 20 bytes of informationMethod Detail |
---|
public int getX()
public int getY()
public int getButtons()
public int getAzimuth()
public int getAltitude()
public int getNormalPressure()
public long getTime()
public int getSerialNumber()
public boolean isButtonPressed(int button)
public boolean isTouched()
public static java.lang.String header()
public java.lang.String toString()
toString
in class java.lang.Object
public void print(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void print(java.io.PrintStream out) throws java.io.IOException
java.io.IOException
private byte[] toByte(int num, int bytes)
num
- positive integer to convertbytes
- array length
private int toInt(byte[] array, int bytes, int position)
array
- byte array to convertbytes
- number of bytes to convertposition
- start position
|
Parkinson Disease Database | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |