|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cello.tablet.JTabletCursor
public class JTabletCursor
Object representation of a physical cursor on the tablet.
For each input of a stylus, mouse, airbrush, etc. on the tablet, a separate JTabletCursor object is created. The same stylus could have multiple JTabletCursor objects associated. They should have the same physicalId, assuming the tablet supports this feature.
For example, the pen tip, and eraser will be separate JTabletCursor objects, but getPhysicalId() on both will return the same value.
if (jtablet.hasCursor()) { JTabletCursor cursor = jtablet.getCursor(); setPosition(cursor.getData(JTabletCursor.DATA_X), cursor.getData(JTabletCursor.DATA_Y)); }
JTablet
,
JTabletException
Field Summary | |
---|---|
static int |
DATA_ARRAY_SIZE
Data type ID for getting the maximum number of data types. |
static int |
DATA_BUTTONS
Data type ID for getting the bitmask of buttons for this cursor. |
static int |
DATA_CURSOR
Data type ID for getting the cursor id of this cursor. |
static int |
DATA_ORIENTATION_ALTITUDE
Data type ID for getting orientation altitude angle for this cursor (between 90 and 0 degrees, although physical range may be less). |
static int |
DATA_ORIENTATION_AZIMUTH
Data type ID for getting orientation azimuth for this cursor (full 360 degrees clockwise rotation about the z axis). |
static int |
DATA_ORIENTATION_TWIST
Data type ID for getting orientation twist angle for this cursor (clockwise rotation about the cursor's major access). |
static int |
DATA_PRESSURE
Data type ID for getting pressure value for this cursor. |
static int |
DATA_ROTATION_PITCH
Data type ID for getting orientation rotation pitch (currently unsupported). |
static int |
DATA_ROTATION_ROLL
Data type ID for getting orientation rotation roll (currently unsupported). |
static int |
DATA_ROTATION_YAW
Data type ID for getting orientation rotation yaw (currently unsupported). |
static int |
DATA_TANGENT_PRESSURE
Data type ID for getting the tangent pressure for this cursor (airbrush fingerwheel). |
static int |
DATA_X
Data type ID for getting x position for this cursor. |
static int |
DATA_Y
Data type ID for getting y position for this cursor. |
static int |
DATA_Z
Data type ID for getting z position for this cursor. |
static int |
TYPE_4DMOUSE
4-D Mouse specific cursor type. |
static int |
TYPE_AIRBRUSH
Airbrush specific cursor type. |
static int |
TYPE_LENS_CURSOR
2D Mouse specific cursor type. |
static int |
TYPE_PEN_ERASER
Pen eraser cursor type. |
static int |
TYPE_PEN_TIP
Pen tip cursor type. |
static int |
TYPE_PUCK
Puck cursor type. |
static int |
TYPE_STYLUS
Stylus specific cursor type. |
static int |
TYPE_UNKNOWN
Unknown Cursor Type. |
Method Summary | |
---|---|
long |
getCursorTime()
Retrieves the time of the last poll. |
int |
getCursorType()
Retrieves the general type of this cursor. |
int |
getCursorTypeSpecific()
Retrieves the specific type of this cursor. |
int |
getData(int type)
Retrieves the raw integer data for the specified DATA_XXX type. |
float |
getDataFloat(int type)
A helper function that returns a percentage based on minimum, maximum, and current value. |
int |
getDataMaximum(int type)
Retrieves the tablet's maximum value for the specified data type. |
int |
getDataMinimum(int type)
Retrieves the tablet's minimum value for the specified data type. |
java.lang.String |
getName()
Retrieves the name generated by the tablet driver. |
int |
getPhysicalId()
Retrieves the 32bit physicalId of this cursor from tablet driver. |
int |
getPressure()
A helper function that returns the translated raw pressure. |
int |
getPressureExtent()
A helper function that returns the maximum pressure. |
float |
getPressureFloat()
A helper function that returns a percentage based pressure range. |
boolean |
isDataSupported(int type)
Returns if a specified data type is supported by the cursor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DATA_CURSOR
public static final int DATA_BUTTONS
public static final int DATA_X
public static final int DATA_Y
public static final int DATA_Z
public static final int DATA_PRESSURE
public static final int DATA_TANGENT_PRESSURE
public static final int DATA_ORIENTATION_AZIMUTH
public static final int DATA_ORIENTATION_ALTITUDE
public static final int DATA_ORIENTATION_TWIST
public static final int DATA_ROTATION_PITCH
public static final int DATA_ROTATION_ROLL
public static final int DATA_ROTATION_YAW
public static final int DATA_ARRAY_SIZE
public static final int TYPE_UNKNOWN
getCursorType()
,
getCursorTypeSpecific()
,
Constant Field Valuespublic static final int TYPE_PEN_TIP
getCursorType()
,
Constant Field Valuespublic static final int TYPE_PEN_ERASER
getCursorType()
,
Constant Field Valuespublic static final int TYPE_PUCK
getCursorType()
,
Constant Field Valuespublic static final int TYPE_STYLUS
getCursorTypeSpecific()
,
Constant Field Valuespublic static final int TYPE_AIRBRUSH
getCursorTypeSpecific()
,
Constant Field Valuespublic static final int TYPE_4DMOUSE
getCursorTypeSpecific()
,
Constant Field Valuespublic static final int TYPE_LENS_CURSOR
getCursorTypeSpecific()
,
Constant Field ValuesMethod Detail |
---|
public java.lang.String getName()
public int getPhysicalId()
public int getCursorType()
public int getCursorTypeSpecific()
public long getCursorTime()
System.currentTimeMillis()
.
public int getData(int type)
type
- A JTabletCursor.DATA_XXX... constant.
getDataMaximum(int)
,
getDataMinimum(int)
public int getDataMaximum(int type)
type
- A JTabletCursor.DATA_XXX... constant.
public int getDataMinimum(int type)
type
- A JTabletCursor.DATA_XXX... constant.
public boolean isDataSupported(int type)
type
- A JTabletCursor.DATA_XXX... constant.
public final int getPressure()
getData(DATA_PRESSURE)-getDataMinimum(DATA_PRESSURE)
getPressureFloat()
,
getPressureExtent()
public final int getPressureExtent()
getDataMaximum(DATA_PRESSURE)-getDataMinimum(DATA_PRESSURE)
getPressure()
public final float getPressureFloat()
((float)getPressure())/getPressureExtent();
getPressure()
,
getPressureExtent()
public final float getDataFloat(int type)
type
- A JTabletCursor.DATA_XXX... constant.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |