|
JTablet 1.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.EventObject java.awt.AWTEvent java.awt.event.ComponentEvent java.awt.event.InputEvent java.awt.event.MouseEvent cello.jtablet.event.TabletEvent
public class TabletEvent
An event that indicates cursor input occurred on the given component. This class extends MouseEvent
and
provides a similar and extended API for accessing tablet events.
You likely will not be constructing this class yourself.
Implementation Note: MouseEvent.isPopupTrigger()
is unsupported.
Nested Class Summary | |
---|---|
static class |
TabletEvent.Type
This enum is used to specify the possible types of a TabletEvent . |
Field Summary |
---|
Fields inherited from class java.awt.event.MouseEvent |
---|
BUTTON1, BUTTON2, BUTTON3, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_FIRST, MOUSE_LAST, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_WHEEL, NOBUTTON |
Fields inherited from class java.awt.event.InputEvent |
---|
ALT_DOWN_MASK, ALT_GRAPH_DOWN_MASK, ALT_GRAPH_MASK, ALT_MASK, BUTTON1_DOWN_MASK, BUTTON1_MASK, BUTTON2_DOWN_MASK, BUTTON2_MASK, BUTTON3_DOWN_MASK, BUTTON3_MASK, CTRL_DOWN_MASK, CTRL_MASK, META_DOWN_MASK, META_MASK, SHIFT_DOWN_MASK, SHIFT_MASK |
Fields inherited from class java.awt.event.ComponentEvent |
---|
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
TabletEvent(Component source,
TabletEvent.Type type,
long when,
int modifiers,
int rawTabletButtonMask,
TabletDevice device,
float x,
float y)
Constructs a new TabletEvent with some of the trimmings... |
|
TabletEvent(Component source,
TabletEvent.Type type,
long when,
int modifiers,
int rawTabletButtonMask,
TabletDevice device,
float x,
float y,
float pressure,
float tiltX,
float tiltY,
float sidePressure,
float rotation,
int button)
Constructs a new TabletEvent with all the trimmings... |
|
TabletEvent(Component source,
TabletEvent.Type type,
long when,
int modifiers,
TabletDevice device,
float x,
float y,
float rotation,
float deltaX,
float deltaY,
float zoom)
Constructs a new TabletEvent with some of the trimmings... |
|
TabletEvent(Component source,
TabletEvent.Type type,
long when,
int modifiers,
TabletDevice device,
float x,
float y,
float pressure,
float tiltX,
float tiltY,
float sidePressure,
float rotation,
float deltaX,
float deltaY,
float zoom,
int button,
int rawTabletButtonMask)
Constructs a new TabletEvent with all the trimmings... |
|
TabletEvent(Component source,
TabletEvent.Type type,
long when,
TabletDevice device,
int modifiers,
float x,
float y,
int button)
Constructs a new TabletEvent with some of the trimmings... |
|
TabletEvent(MouseEvent e,
TabletEvent.Type type,
TabletDevice device)
Wrap a MouseEvent as a TabletEvent. |
|
TabletEvent(MouseEvent e,
TabletEvent.Type type,
TabletDevice device,
Component c,
float x,
float y)
Wrap a MouseEvent as a TabletEvent. |
|
TabletEvent(TabletEvent original,
Component newComponent,
float newX,
float newY)
Constructs a TabletEvent based on another with a new component and coordinates. |
|
TabletEvent(TabletEvent original,
float newX,
float newY)
Constructs a TabletEvent based on another with new coordinates. |
|
TabletEvent(TabletEvent original,
TabletEvent.Type newType)
Constructs a TabletEvent based on another with a new event TabletEvent.Type . |
Method Summary | |
---|---|
void |
fireEvent(TabletListener listener)
Triggers this event on the given TabletListener . |
TabletDevice |
getDevice()
Returns the tablet device associated with this event. |
float |
getFloatX()
Returns the fractional x position of the mouse/tablet cursor (if available). |
float |
getFloatY()
Returns the fractional y position of the mouse/tablet cursor (if available). |
Point2D.Float |
getPoint2D()
Returns the fractional Point2D of the mouse/tablet cursor (if available). |
float |
getPressure()
Returns the current pressure value of the tablet pressure. |
int |
getRawTabletButtonMask()
Returns the raw tablet button mask independent of any user mapping with regards to "left" or "right." This may return zero for emulated devices. |
float |
getRotation()
Returns either the rotational position of a tablet, or the rotational amount for a TabletEvent.Type.ROTATED gesture
event. |
float |
getScrollX()
Returns the amount scrolled in the x direction for a TabletEvent.Type.SCROLLED gesture event. |
float |
getScrollY()
Returns the amount scrolled in the y direction for a TabletEvent.Type.SCROLLED gesture event. |
float |
getSidePressure()
Returns the current tablet side pressure. |
float |
getTiltX()
Returns the current horizontal tilt angle in radians. |
float |
getTiltY()
Returns the current horizontal tilt angle in radians. |
TabletEvent.Type |
getType()
Returns the TabletEvent.Type for this event. |
float |
getZoomFactor()
Returns the magnification amount for a TabletEvent.Type.ZOOMED gesture event. |
String |
toString()
|
TabletEvent |
translated(Component c,
float deltaX,
float deltaY)
Returns a copy of this TabletEvent with translated coordinates. |
TabletEvent |
translated(float deltaX,
float deltaY)
Returns a copy of this TabletEvent with translated coordinates. |
TabletEvent |
withPoint(Component component,
float x,
float y)
Returns a copy of this TabletEvent with the given component and coordinates. |
TabletEvent |
withPoint(float x,
float y)
Returns a copy of this TabletEvent with the given coordinates. |
TabletEvent |
withType(TabletEvent.Type type)
Returns a copy of this TabletEvent with a new event TabletEvent.Type . |
Methods inherited from class java.awt.event.MouseEvent |
---|
getButton, getClickCount, getLocationOnScreen, getMouseModifiersText, getPoint, getX, getXOnScreen, getY, getYOnScreen, isPopupTrigger, paramString, translatePoint |
Methods inherited from class java.awt.event.InputEvent |
---|
consume, getModifiers, getModifiersEx, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown |
Methods inherited from class java.awt.event.ComponentEvent |
---|
getComponent |
Methods inherited from class java.awt.AWTEvent |
---|
getID, setSource |
Methods inherited from class java.util.EventObject |
---|
getSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TabletEvent(Component source, TabletEvent.Type type, long when, int modifiers, TabletDevice device, float x, float y, float pressure, float tiltX, float tiltY, float sidePressure, float rotation, float deltaX, float deltaY, float zoom, int button, int rawTabletButtonMask)
source
- type
- when
- device
- x
- y
- modifiers
- button
- pressure
- tiltX
- tiltY
- sidePressure
- rotation
- deltaX
- deltaY
- zoom
- rawTabletButtonMask
- public TabletEvent(MouseEvent e, TabletEvent.Type type, TabletDevice device)
MouseEvent
as a TabletEvent.
e
- type
- device
- public TabletEvent(MouseEvent e, TabletEvent.Type type, TabletDevice device, Component c, float x, float y)
MouseEvent
as a TabletEvent.
e
- type
- device
- c
- x
- y
- public TabletEvent(Component source, TabletEvent.Type type, long when, int modifiers, int rawTabletButtonMask, TabletDevice device, float x, float y, float pressure, float tiltX, float tiltY, float sidePressure, float rotation, int button)
source
- type
- when
- modifiers
- rawTabletButtonMask
- device
- x
- y
- pressure
- tiltX
- tiltY
- sidePressure
- rotation
- button
- public TabletEvent(Component source, TabletEvent.Type type, long when, int modifiers, int rawTabletButtonMask, TabletDevice device, float x, float y)
source
- type
- when
- modifiers
- rawTabletButtonMask
- device
- x
- y
- public TabletEvent(Component source, TabletEvent.Type type, long when, int modifiers, TabletDevice device, float x, float y, float rotation, float deltaX, float deltaY, float zoom)
source
- type
- when
- modifiers
- device
- x
- y
- rotation
- deltaX
- deltaY
- zoom
- public TabletEvent(Component source, TabletEvent.Type type, long when, TabletDevice device, int modifiers, float x, float y, int button)
source
- type
- when
- device
- modifiers
- x
- y
- button
- public TabletEvent(TabletEvent original, Component newComponent, float newX, float newY)
original
- newComponent
- newX
- x-coordinatenewY
- y-coordinatewithPoint(float, float)
public TabletEvent(TabletEvent original, float newX, float newY)
original
- newX
- x-coordinatenewY
- y-coordinatewithPoint(Component, float, float)
public TabletEvent(TabletEvent original, TabletEvent.Type newType)
TabletEvent.Type
.
original
- newType
- the new event typeMethod Detail |
---|
public String toString()
toString
in class AWTEvent
public void fireEvent(TabletListener listener)
TabletListener
.
listener
- the listener to trigger onpublic Point2D.Float getPoint2D()
Point2D
of the mouse/tablet cursor (if available).
public float getFloatX()
You can determine if the current device supports fractional points with
TabletDevice.getFloatSupport()
via getDevice()
.
public float getFloatY()
You can determine if the current device supports fractional points with
TabletDevice.getFloatSupport()
via getDevice()
.
public float getPressure()
You can determine if the current device supports pressure with TabletDevice.getPressureSupport()
via
getDevice()
.
TabletDevice.getPressureSupport()
public TabletDevice getDevice()
TabletDevice
public TabletEvent.Type getType()
TabletEvent.Type
for this event.
TabletEvent.Type
public float getSidePressure()
You can determine if the current device supports side pressure with
TabletDevice.getSidePressureSupport()
via getDevice()
.
public float getTiltX()
You can determine if the current device supports side pressure with
TabletDevice.getTiltSupport()
via getDevice()
.
public float getTiltY()
You can determine if the current device supports side pressure with
TabletDevice.getTiltSupport()
via getDevice()
.
public float getRotation()
TabletEvent.Type.ROTATED
gesture
event.
You can determine if the current device supports side pressure with
TabletDevice.getRotationSupport()
via getDevice()
.
public int getRawTabletButtonMask()
public float getScrollX()
TabletEvent.Type.SCROLLED
gesture event.
public float getScrollY()
TabletEvent.Type.SCROLLED
gesture event.
public float getZoomFactor()
TabletEvent.Type.ZOOMED
gesture event.
public TabletEvent withPoint(Component component, float x, float y)
component
- x
- x-coordinatey
- y-coordinate
withPoint(float, float)
public TabletEvent withPoint(float x, float y)
x
- x-coordinatey
- y-coordinate
withPoint(Component, float, float)
public TabletEvent translated(Component c, float deltaX, float deltaY)
c
- component for translated eventdeltaX
- the amount to translate the x-coordinatedeltaY
- the amount to translate the y-coordinate
translated(float, float)
public TabletEvent translated(float deltaX, float deltaY)
deltaX
- the amount to translate the x-coordinatedeltaY
- the amount to translate the y-coordinate
translated(Component, float, float)
public TabletEvent withType(TabletEvent.Type type)
TabletEvent.Type
.
type
- the new event type
|
JTablet 1.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |