PointerType.
The historical misleading class name may change in the future to PointerEvent.
http://www.w3.org/Submission/pointer-events/#pointerevent-interface
All pointer coordinates of this interface are represented in pixel units,
see NativeSurface and NativeWindow.
In case an instance represents a multiple-pointer event, i.e. getPointerCount() is > 1,
the first data element of the multiple-pointer fields represents the pointer triggering this event.
For example e. at EVENT_MOUSE_PRESSED returns the data of the pressed pointer, etc.
Multiple-pointer event's button number is mapped to the first pointer ID
triggering the event and the button mask bits in the modifiers
field represent the pressed pointer IDs.
Users can query the pressed button and pointer count via InputEvent#getButtonDownCount()
or use the simple query InputEvent#isAnyButtonDown().
If representing a single-pointer PointerType#Mouse event, pointer-ID is 0
and a button value of 0 denotes no button activity, i.e. PointerType#Mouse move.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | MouseEvent.
Class of pointer types |
| public static enum | MouseEvent.
Type of pointer devices |
| Modifier and Type | Field and Description |
|---|---|
| private final short | |
| public static final short | BUTTON1
ID for button 1, value |
| public static final short | BUTTON2
ID for button 2, value |
| public static final short | BUTTON3
ID for button 3, value |
| public static final short | BUTTON4
ID for button 4, value |
| public static final short | BUTTON5
ID for button 5, value |
| public static final short | BUTTON6
ID for button 6, value |
| public static final short | BUTTON7
ID for button 6, value |
| public static final short | BUTTON8
ID for button 6, value |
| public static final short | BUTTON9
ID for button 6, value |
| public static final short | BUTTON_COUNT
Maximum number of buttons, value |
| private final short | |
| private static final MouseEvent. | |
| private static final float[] | |
| private static final float[] | |
| public static final short | |
| public static final short | |
| public static final short | EVENT_MOUSE_ENTERED
Only generated for |
| public static final short | EVENT_MOUSE_EXITED
Only generated for |
| public static final short | |
| public static final short | |
| public static final short | |
| public static final short | |
| private final float | |
| private final short[] | pointerID
Pointer-ID for each pointer (multiple pointer). |
| private final MouseEvent. | pointerType
PointerType for each pointer (multiple pointer) |
| private final float[] | pressure
Pressure for each pointer (multiple pointer) |
| private final float | rotationScale
Rotation scale |
| private final float[] | rotationXYZ
Rotation around the X, Y and X axis |
| private final int[] | x
X-axis for each pointer (multiple pointer) |
| private final int[] | y
Y-axis for each pointer (multiple pointer) |
| Access | Constructor and Description |
|---|---|
| public | MouseEvent(final short eventType, final Object source, final long when, final int modifiers, final int
X-axis x, final int Y-axis y, final short Mouse-button click-count clickCount, final short button number, e.g. [ button, final float[] BUTTON1..BUTTON_COUNT-1].
A button value of 0 denotes no button activity, i.e. PointerType#Mouse move.Rotation of all axis rotationXYZ, final float Rotation scale rotationScale)Constructor for traditional one-pointer event. |
| public | MouseEvent(final short eventType, final Object source, final long when, final int modifiers, final MouseEvent.
PointerType for each pointer (multiple pointer) pointerType,Pointer ID for each pointer (multiple pointer). IDs start w/ 0 and are consecutive numbers.
A pointer-ID of -1 may also denote no pointer/button activity, i.e. pointerID, final int[] PointerType#Mouse move.X-axis for each pointer (multiple pointer) x, final int[] Y-axis for each pointer (multiple pointer) y, final float[] Pressure for each pointer (multiple pointer) pressure, final float Maximum pointer pressure for all pointer maxPressure, final short Corresponding mouse-button button, final short Mouse-button click-count clickCount, final float[] Rotation of all axis rotationXYZ, final float Rotation scale rotationScale)Constructor for a multiple-pointer event. |
| Modifier and Type | Method and Description |
|---|---|
| public final MouseEvent | |
| public final short[] | Returns: array of all pointer IDs for all pointers. IDs start w/ 0 and are consecutive numbers.See details for multiple-pointer events. |
| public final MouseEvent. | Returns: array of allPointerTypes for all pointersSee details for multiple-pointer events. |
| public final float[] | Returns: array of all raw, un-normalized pressures for all pointersSee details for multiple-pointer events. |
| public final int[] | Returns: array of all X-Coords for all pointers in pixel units.See details for multiple-pointer events. |
| public final int[] | Returns: array of all Y-Coords for all pointers in pixel units.See details for multiple-pointer events. |
| public final short | |
| public final short | |
| public static final short | |
| public static String | |
| public final float | |
| public final int | Returns: the count of pointers involved in this eventSee details for multiple-pointer events. |
| public final short | getPointerId(final int index)
Return the pointer id for the given index or -1 if index not available. |
| public final int | Returns: the pointer index for the given pointer id or -1 if id not available.See details for multiple-pointer events. |
| public final MouseEvent. | Returns: thePointerType for the data at index or null if index not available.See details for multiple-pointer events. |
| public final float | Returns: The pressure associated with the pointer-index 0. The value of zero is return if not available.if true, method returns the normalized pressure, i.e. normalized)pressure / maxPressure
|
| public final float | Returns: The pressure associated with the pointer-index. The value of zero is return if not available.pointer-index within [0 .. index, final boolean getPointerCount()-1]if true, method returns the normalized pressure, i.e. normalized)pressure / maxPressureSee details for multiple-pointer events. |
| public final float[] | getRotation()
Returns a 3-component float array filled with the values of the rotational axis in the following order: horizontal-, vertical- and z-axis. |
| public final float | getRotationScale()
Returns the scale used to determine the |
| public static final float[] | getRotationXYZ(final float rotationXorY, final int mods)
Returns the 3-axis XYZ rotation array by given rotation on Y axis or X axis (if SHIFT_MASK is given in mods). |
| public final int | Returns: X-Coord of the triggering pointer-index zero in pixel units.See details for multiple-pointer events. |
| public final int | Returns: X-Coord associated with the pointer-index in pixel units.pointer-index within [0 .. index)getPointerCount()-1]See details for multiple-pointer events. |
| public final int | Returns: Y-Coord of the triggering pointer-index zero in pixel units.See details for multiple-pointer events. |
| public final int | Returns: Y-Coord associated with the pointer-index in pixel units.pointer-index within [0 .. index)getPointerCount()-1]See details for multiple-pointer events. |
| public final String | toString()
Overrides com. |
| public final StringBuilder |
| button | back to summary |
|---|---|
| private final short button Returns the button number, e.g. [
A button value of | |
| BUTTON1 | back to summary |
|---|---|
| public static final short BUTTON1 ID for button 1, value | |
| BUTTON2 | back to summary |
|---|---|
| public static final short BUTTON2 ID for button 2, value | |
| BUTTON3 | back to summary |
|---|---|
| public static final short BUTTON3 ID for button 3, value | |
| BUTTON4 | back to summary |
|---|---|
| public static final short BUTTON4 ID for button 4, value | |
| BUTTON5 | back to summary |
|---|---|
| public static final short BUTTON5 ID for button 5, value | |
| BUTTON6 | back to summary |
|---|---|
| public static final short BUTTON6 ID for button 6, value | |
| BUTTON7 | back to summary |
|---|---|
| public static final short BUTTON7 ID for button 6, value | |
| BUTTON8 | back to summary |
|---|---|
| public static final short BUTTON8 ID for button 6, value | |
| BUTTON9 | back to summary |
|---|---|
| public static final short BUTTON9 ID for button 6, value | |
| BUTTON_COUNT | back to summary |
|---|---|
| public static final short BUTTON_COUNT Maximum number of buttons, value | |
| clickCount | back to summary |
|---|---|
| private final short clickCount | |
| constMousePointerTypes | back to summary |
|---|---|
| private static final MouseEvent. | |
| constMousePressure0 | back to summary |
|---|---|
| private static final float[] constMousePressure0 | |
| constMousePressure1 | back to summary |
|---|---|
| private static final float[] constMousePressure1 | |
| EVENT_MOUSE_CLICKED | back to summary |
|---|---|
| public static final short EVENT_MOUSE_CLICKED | |
| EVENT_MOUSE_DRAGGED | back to summary |
|---|---|
| public static final short EVENT_MOUSE_DRAGGED | |
| EVENT_MOUSE_ENTERED | back to summary |
|---|---|
| public static final short EVENT_MOUSE_ENTERED Only generated for | |
| EVENT_MOUSE_EXITED | back to summary |
|---|---|
| public static final short EVENT_MOUSE_EXITED Only generated for | |
| EVENT_MOUSE_MOVED | back to summary |
|---|---|
| public static final short EVENT_MOUSE_MOVED | |
| EVENT_MOUSE_PRESSED | back to summary |
|---|---|
| public static final short EVENT_MOUSE_PRESSED | |
| EVENT_MOUSE_RELEASED | back to summary |
|---|---|
| public static final short EVENT_MOUSE_RELEASED | |
| EVENT_MOUSE_WHEEL_MOVED | back to summary |
|---|---|
| public static final short EVENT_MOUSE_WHEEL_MOVED | |
| maxPressure | back to summary |
|---|---|
| private final float maxPressure | |
| pointerID | back to summary |
|---|---|
| private final short[] pointerID Pointer-ID for each pointer (multiple pointer). IDs start w/ 0 and are consecutive numbers. | |
| pointerType | back to summary |
|---|---|
| private final MouseEvent. PointerType for each pointer (multiple pointer) | |
| pressure | back to summary |
|---|---|
| private final float[] pressure Pressure for each pointer (multiple pointer) | |
| rotationScale | back to summary |
|---|---|
| private final float rotationScale Rotation scale | |
| rotationXYZ | back to summary |
|---|---|
| private final float[] rotationXYZ Rotation around the X, Y and X axis | |
| x | back to summary |
|---|---|
| private final int[] x X-axis for each pointer (multiple pointer) | |
| y | back to summary |
|---|---|
| private final int[] y Y-axis for each pointer (multiple pointer) | |
| MouseEvent | back to summary |
|---|---|
| public MouseEvent(final short eventType, final Object source, final long when, final int modifiers, final int x, final int y, final short clickCount, final short button, final float[] rotationXYZ, final float rotationScale) Constructor for traditional one-pointer event.
| |
| MouseEvent | back to summary |
|---|---|
| public MouseEvent(final short eventType, final Object source, final long when, final int modifiers, final MouseEvent. Constructor for a multiple-pointer event. First element of multiple-pointer arrays represents the pointer which triggered the event! See details for multiple-pointer events.
| |
| createVariant | back to summary |
|---|---|
| public final MouseEvent createVariant(final short newEventType) | |
| getAllPointerIDs | back to summary |
|---|---|
| public final short[] getAllPointerIDs() See details for multiple-pointer events.
| |
| getAllPointerTypes | back to summary |
|---|---|
| public final MouseEvent. See details for multiple-pointer events.
| |
| getAllPressures | back to summary |
|---|---|
| public final float[] getAllPressures() See details for multiple-pointer events.
| |
| getAllX | back to summary |
|---|---|
| public final int[] getAllX() See details for multiple-pointer events.
| |
| getAllY | back to summary |
|---|---|
| public final int[] getAllY() See details for multiple-pointer events.
| |
| getButton | back to summary |
|---|---|
| public final short getButton() Returns the button number, e.g. [
A button value of See details for multiple-pointer events. | |
| getClickCount | back to summary |
|---|---|
| public final short getClickCount() | |
| getClickTimeout | back to summary |
|---|---|
| public static final short getClickTimeout() | |
| getEventTypeString | back to summary |
|---|---|
| public static String getEventTypeString(final short type) | |
| getMaxPressure | back to summary |
|---|---|
| public final float getMaxPressure() Returns the maximum pressure known for the input device generating this event. This value may be self calibrating on devices/OS, where no known maximum pressure is known. Hence subsequent events may return a higher value. Self calibrating maximum pressure is performed on:
| |
| getPointerCount | back to summary |
|---|---|
| public final int getPointerCount() See details for multiple-pointer events.
| |
| getPointerId | back to summary |
|---|---|
| public final short getPointerId(final int index) Return the pointer id for the given index or -1 if index not available. IDs start w/ 0 and are consecutive numbers. See details for multiple-pointer events. | |
| getPointerIdx | back to summary |
|---|---|
| public final int getPointerIdx(final short id) See details for multiple-pointer events.
| |
| getPointerType | back to summary |
|---|---|
| public final MouseEvent. See details for multiple-pointer events.
| |
| getPressure | back to summary |
|---|---|
public final float getPressure(final boolean normalized)
| |
| getPressure | back to summary |
|---|---|
| public final float getPressure(final int index, final boolean normalized) See details for multiple-pointer events.
| |
| getRotation | back to summary |
|---|---|
| public final float[] getRotation() Returns a 3-component float array filled with the values of the rotational axis in the following order: horizontal-, vertical- and z-axis. A vertical rotation of > 0.0f is up and < 0.0f is down. A horizontal rotation of > 0.0f is left and < 0.0f is right. A z-axis rotation of > 0.0f is back and < 0.0f is front. However, on some OS this might be flipped due to the OS default behavior. The latter is true for OS X 10.7 (Lion) for example.
On PointerClass
On PointerClass
The
In case the pointer type is
In case the pointer type is of class | |
| getRotationScale | back to summary |
|---|---|
| public final float getRotationScale() Returns the scale used to determine the
For
For | |
| getRotationXYZ | back to summary |
|---|---|
| public static final float[] getRotationXYZ(final float rotationXorY, final int mods) Returns the 3-axis XYZ rotation array by given rotation on Y axis or X axis (if SHIFT_MASK is given in mods). | |
| getX | back to summary |
|---|---|
| public final int getX() See details for multiple-pointer events.
| |
| getX | back to summary |
|---|---|
| public final int getX(final int index) See details for multiple-pointer events.
| |
| getY | back to summary |
|---|---|
| public final int getY() See details for multiple-pointer events.
| |
| getY | back to summary |
|---|---|
| public final int getY(final int index) See details for multiple-pointer events.
| |
| toString | back to summary |
|---|---|
| public final String toString() Overrides com. Doc from java. Returns a String representation of this EventObject. | |
| toString | back to summary |
|---|---|
| public final StringBuilder toString(StringBuilder sb) Overrides com.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final MouseEvent. | |
| public static final MouseEvent. | |
| public static final MouseEvent. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static MouseEvent. | |
| public static MouseEvent. |
| Offscreen | back to summary |
|---|---|
| public static final MouseEvent. | |
| Onscreen | back to summary |
|---|---|
| public static final MouseEvent. | |
| Undefined | back to summary |
|---|---|
| public static final MouseEvent. | |
| PointerClass | back to summary |
|---|---|
| private PointerClass() | |
| valueOf | back to summary |
|---|---|
| public static MouseEvent. | |
| values | back to summary |
|---|---|
| public static MouseEvent. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final MouseEvent. | Mouse
|
| pack-priv MouseEvent. | |
| public static final MouseEvent. | Pen
|
| public static final MouseEvent. | TouchPad
|
| public static final MouseEvent. | TouchScreen
|
| public static final MouseEvent. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MouseEvent. | |
| public static MouseEvent. | |
| public static MouseEvent. | valueOf(final int ordinal)
Returns the matching PointerType value corresponding to the given PointerType's integer ordinal. |
| public static MouseEvent. | |
| public static MouseEvent. | valuesOf(final int[] ordinals)
Returns the PointerType array of matching PointerType values corresponding to the given PointerType's integer ordinal values. |
| Mouse | back to summary |
|---|---|
| public static final MouseEvent.
| |
| pc | back to summary |
|---|---|
| pack-priv MouseEvent. | |
| Pen | back to summary |
|---|---|
| public static final MouseEvent.
| |
| TouchPad | back to summary |
|---|---|
| public static final MouseEvent.
| |
| TouchScreen | back to summary |
|---|---|
| public static final MouseEvent.
| |
| Undefined | back to summary |
|---|---|
| public static final MouseEvent.
| |
| PointerType | back to summary |
|---|---|
| private PointerType(final MouseEvent. | |
| getPointerClass | back to summary |
|---|---|
| public MouseEvent. | |
| valueOf | back to summary |
|---|---|
| public static MouseEvent. | |
| valueOf | back to summary |
|---|---|
| public static MouseEvent. Returns the matching PointerType value corresponding to the given PointerType's integer ordinal.
given:
ordinal = enumValue.ordinal()
reverse:
enumValue = EnumClass.values()[ordinal]
| |
| values | back to summary |
|---|---|
| public static MouseEvent. | |
| valuesOf | back to summary |
|---|---|
| public static MouseEvent. Returns the PointerType array of matching PointerType values corresponding to the given PointerType's integer ordinal values.
See
| |