Package totalcross.ui.event
Class PenEvent
- java.lang.Object
-
- totalcross.ui.event.Event<PenListener>
-
- totalcross.ui.event.PenEvent
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
DragEvent,MouseEvent
public class PenEvent extends Event<PenListener> implements java.lang.Cloneable
PenEvent is a pen down, up, move or drag event.A pen drag occurs when the pen moves while the screen is pressed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class totalcross.ui.event.Event
Event.Type<H>
-
-
Field Summary
Fields Modifier and Type Field Description intabsoluteXThe absolute x location of the event.intabsoluteYThe absolute y location of the event.protected static java.lang.String[]EVENT_NAMEintmodifiersThe state of the modifier keys when the event occured.static intPEN_DOWNThe event type for a pen or mouse down.static intPEN_DRAGThe event type for a pen or mouse drag.static intPEN_DRAG_ENDThe event type for a pen or mouse drag end.static intPEN_DRAG_STARTThe event type for a pen or mouse drag start.static intPEN_UPThe event type for a pen or mouse up.intxThe x location of the event.intyThe y location of the event.
-
Constructor Summary
Constructors Constructor Description PenEvent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PenEventclone()voiddispatch(PenListener listener)static java.lang.StringgetEventName(int type)Returns the event name.java.lang.StringtoString()PenEventupdate(Control c, int absoluteX, int x, int absoluteY, int y, int type, int modifiers)Updates this event setting also the timestamp, consumed and target.-
Methods inherited from class totalcross.ui.event.Event
clearQueue, getNextAvailableEventId, isAvailable, touch
-
-
-
-
Field Detail
-
PEN_DOWN
public static final int PEN_DOWN
The event type for a pen or mouse down.- See Also:
- Constant Field Values
-
PEN_UP
public static final int PEN_UP
The event type for a pen or mouse up.- See Also:
- Constant Field Values
-
PEN_DRAG
public static final int PEN_DRAG
The event type for a pen or mouse drag.- See Also:
- Constant Field Values
-
PEN_DRAG_START
public static final int PEN_DRAG_START
The event type for a pen or mouse drag start.- See Also:
- Constant Field Values
-
PEN_DRAG_END
public static final int PEN_DRAG_END
The event type for a pen or mouse drag end.- See Also:
- Constant Field Values
-
EVENT_NAME
protected static final java.lang.String[] EVENT_NAME
-
x
public int x
The x location of the event.
-
y
public int y
The y location of the event.
-
absoluteX
public int absoluteX
The absolute x location of the event.
-
absoluteY
public int absoluteY
The absolute y location of the event.
-
modifiers
public int modifiers
The state of the modifier keys when the event occured. This is a OR'ed combination of the modifiers present in the DeviceKeys interface.- See Also:
SpecialKeys
-
-
Method Detail
-
update
public PenEvent update(Control c, int absoluteX, int x, int absoluteY, int y, int type, int modifiers)
Updates this event setting also the timestamp, consumed and target.- Since:
- TotalCross 1.0
-
getEventName
public static java.lang.String getEventName(int type)
Returns the event name. Used to debugging.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classEvent<PenListener>
-
clone
public PenEvent clone()
- Overrides:
clonein classjava.lang.Object
-
dispatch
public void dispatch(PenListener listener)
- Specified by:
dispatchin classEvent<PenListener>
-
-