public abstract class PointerEventHandler extends Object implements EventHandler
It can be used as base class for event handlers compatible with PointerEventDispatcher
semantic.
Modifier | Constructor and Description |
---|---|
protected |
PointerEventHandler(Widget widget)
Instantiates the handler for the given widget.
|
Modifier and Type | Method and Description |
---|---|
boolean |
handleEvent(int event)
Handles an event.
|
protected boolean |
onDragged(int pointerX,
int pointerY)
Returns
false by default. |
protected void |
onExited()
Does nothing by default.
|
protected boolean |
onPressed(int pointerX,
int pointerY)
Returns
false by default. |
protected boolean |
onReleased(int pointerX,
int pointerY)
Returns
false by default. |
protected PointerEventHandler(Widget widget)
widget
- the attached widget.public final boolean handleEvent(int event)
EventHandler
handleEvent
in interface EventHandler
event
- the event to handle.true
if the event is consumed, false
otherwise.Event
protected boolean onDragged(int pointerX, int pointerY)
protected void onExited()
Override this method to react on focus loss events.
protected boolean onPressed(int pointerX, int pointerY)
protected boolean onReleased(int pointerX, int pointerY)
false
by default.
Override this method to react on RELEASED
events.
Returns true
to prevent other widgets to also handle this event.