public class DispatchEventHandler extends java.lang.Object implements EventHandler, EventGeneratorsHandler, ButtonEventHandler, CommandEventHandler, PointerEventHandler
Event
) and data (event type specific).Constructor and Description |
---|
DispatchEventHandler()
Creates a dispatch event handler.
|
Modifier and Type | Method and Description |
---|---|
boolean |
handleButton(int event)
Handles button events.
|
boolean |
handleCommand(int event)
Handles command events.
|
boolean |
handleEvent(int event)
Handles an event.
|
boolean |
handleKeyboard(int event)
Handles keyboard events.
|
boolean |
handleKeypad(int event)
Handles keypad events.
|
boolean |
handlePointer(int event)
Handles pointer events.
|
boolean |
onButtonClicked(int event)
Handles button clicked event.
|
boolean |
onButtonDoubleClicked(int event)
Handles button double-clicked event.
|
boolean |
onButtonPressed(int event)
Handles button pressed event.
|
boolean |
onButtonReleased(int event)
Handles button released event.
|
boolean |
onButtonRepeated(int event)
Handles button repeated event.
|
boolean |
onCommand(int command)
Handles command event.
|
boolean |
onPointerClicked(Pointer pointer,
int pointerX,
int pointerY,
int event)
Handles pointer clicked event.
|
boolean |
onPointerDoubleClicked(Pointer pointer,
int pointerX,
int pointerY,
int event)
Handles pointer double-clicked event.
|
boolean |
onPointerDragged(Pointer pointer,
int pointerX,
int pointerY,
int event)
Handles pointer dragged event.
|
boolean |
onPointerEntered(Pointer pointer,
int pointerX,
int pointerY,
int event)
Handles pointer entered event.
|
boolean |
onPointerExited(Pointer pointer,
int pointerX,
int pointerY,
int event)
Handles pointer exited event.
|
boolean |
onPointerMoved(Pointer pointer,
int pointerX,
int pointerY,
int event)
Handles pointer moved event.
|
boolean |
onPointerPressed(Pointer pointer,
int pointerX,
int pointerY,
int event)
Handles pointer pressed event.
|
boolean |
onPointerReleased(Pointer pointer,
int pointerX,
int pointerY,
int event)
Handles pointer released event.
|
public DispatchEventHandler()
public boolean handleEvent(int event)
EventHandler
handleEvent
in interface EventHandler
event
- the event to handle.true
if the event is consumed, false
otherwise.Event
,
DispatchHelper
public boolean handleButton(int event)
handleButton
in interface EventGeneratorsHandler
event
- the button event to handle.true
if the event is consumed, false
otherwise.DispatchHelper.dispatchButton(int, ButtonEventHandler)
public boolean handleCommand(int event)
Calls onCommand(int)
method passing the event data.
handleCommand
in interface EventGeneratorsHandler
event
- the command event to handle.true
if the event is consumed, false
otherwise.public boolean handleKeyboard(int event)
EventGeneratorsHandler
handleKeyboard
in interface EventGeneratorsHandler
event
- the keyboard event to handle.true
if the event is consumed, false
otherwise.public boolean handleKeypad(int event)
EventGeneratorsHandler
handleKeypad
in interface EventGeneratorsHandler
event
- the keypad event to handle.true
if the event is consumed, false
otherwise.public boolean handlePointer(int event)
handlePointer
in interface EventGeneratorsHandler
event
- the pointer event to handle.true
if the event is consumed, false
otherwise.DispatchHelper.dispatchPointer(int, PointerEventHandler)
public boolean onButtonPressed(int event)
ButtonEventHandler
onButtonPressed
in interface ButtonEventHandler
event
- the button event to handle.true
if the event is consumed, false
otherwise.public boolean onButtonReleased(int event)
ButtonEventHandler
onButtonReleased
in interface ButtonEventHandler
event
- the button event to handle.true
if the event is consumed, false
otherwise.public boolean onButtonClicked(int event)
ButtonEventHandler
onButtonClicked
in interface ButtonEventHandler
event
- the button event to handle.true
if the event is consumed, false
otherwise.public boolean onButtonDoubleClicked(int event)
ButtonEventHandler
onButtonDoubleClicked
in interface ButtonEventHandler
event
- the button event to handle.true
if the event is consumed, false
otherwise.public boolean onButtonRepeated(int event)
ButtonEventHandler
onButtonRepeated
in interface ButtonEventHandler
event
- the button event to handle.true
if the event is consumed, false
otherwise.public boolean onCommand(int command)
CommandEventHandler
onCommand
in interface CommandEventHandler
command
- the command to handle.true
if the event is consumed, false
otherwise.public boolean onPointerPressed(Pointer pointer, int pointerX, int pointerY, int event)
PointerEventHandler
onPointerPressed
in interface PointerEventHandler
pointer
- the pointer that generates the event.pointerX
- the current x coordinate of the pointer.pointerY
- the current y coordinate of the pointer.event
- the pointer event to handle.true
if the event is consumed, false
otherwise.public boolean onPointerReleased(Pointer pointer, int pointerX, int pointerY, int event)
PointerEventHandler
onPointerReleased
in interface PointerEventHandler
pointer
- the pointer that generates the event.pointerX
- the current x coordinate of the pointer.pointerY
- the current y coordinate of the pointer.event
- the pointer event to handle.true
if the event is consumed, false
otherwise.public boolean onPointerMoved(Pointer pointer, int pointerX, int pointerY, int event)
PointerEventHandler
onPointerMoved
in interface PointerEventHandler
pointer
- the pointer that generates the event.pointerX
- the current x coordinate of the pointer.pointerY
- the current y coordinate of the pointer.event
- the pointer event to handle.true
if the event is consumed, false
otherwise.public boolean onPointerDragged(Pointer pointer, int pointerX, int pointerY, int event)
PointerEventHandler
onPointerDragged
in interface PointerEventHandler
pointer
- the pointer that generates the event.pointerX
- the current x coordinate of the pointer.pointerY
- the current y coordinate of the pointer.event
- the pointer event to handle.true
if the event is consumed, false
otherwise.public boolean onPointerEntered(Pointer pointer, int pointerX, int pointerY, int event)
PointerEventHandler
onPointerEntered
in interface PointerEventHandler
pointer
- the pointer that generates the event.pointerX
- the current x coordinate of the pointer.pointerY
- the current y coordinate of the pointer.event
- the pointer event to handle.true
if the event is consumed, false
otherwise.public boolean onPointerExited(Pointer pointer, int pointerX, int pointerY, int event)
PointerEventHandler
onPointerExited
in interface PointerEventHandler
pointer
- the pointer that generates the event.pointerX
- the current x coordinate of the pointer.pointerY
- the current y coordinate of the pointer.event
- the pointer event to handle.true
if the event is consumed, false
otherwise.public boolean onPointerClicked(Pointer pointer, int pointerX, int pointerY, int event)
PointerEventHandler
onPointerClicked
in interface PointerEventHandler
pointer
- the pointer that generates the event.pointerX
- the current x coordinate of the pointer.pointerY
- the current y coordinate of the pointer.event
- the pointer event to handle.true
if the event is consumed, false
otherwise.public boolean onPointerDoubleClicked(Pointer pointer, int pointerX, int pointerY, int event)
PointerEventHandler
onPointerDoubleClicked
in interface PointerEventHandler
pointer
- the pointer that generates the event.pointerX
- the current x coordinate of the pointer.pointerY
- the current y coordinate of the pointer.event
- the pointer event to handle.true
if the event is consumed, false
otherwise.