|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface GestureHandler
Generic gesture handler interface designed to allow pass-through
filtering of InputEvents.
To avoid negative impact on event processing, implementation shall restrict computation as much as possible and only within it's appropriate gesture states.
To allow custom user events, other than the normal InputEvents,
a user may return a GestureHandler.GestureEvent in it's implementation.
| Nested Class Summary | |
|---|---|
static class |
GestureHandler.GestureEvent
A custom gesture event |
static interface |
GestureHandler.GestureListener
Listener for GestureHandler.GestureEvents. |
| Field Summary | |
|---|---|
static boolean |
DEBUG
|
| Method Summary | |
|---|---|
void |
clear(boolean clearStarted)
Clears state of handler, i.e. |
InputEvent |
getGestureEvent()
Returns the corresponding InputEvent for the gesture as detected by
a previous process(InputEvent), which has not been cleared. |
boolean |
hasGesture()
Returns true if a previous process(InputEvent) command produced a gesture,
which has not been cleared. |
boolean |
isWithinGesture()
Returns true if within a gesture as detected by a previous process(InputEvent) command,
which has not been cleared. |
boolean |
process(InputEvent e)
Process the given InputEvent and returns true if it produced the gesture. |
| Field Detail |
|---|
static final boolean DEBUG
| Method Detail |
|---|
void clear(boolean clearStarted)
clearStarted - if true, also clears started state,
otherwise stay within gesture - if appropriate.
Staying within a gesture allows fluent continuous gesture sequence,
e.g. for scrolling.boolean hasGesture()
process(InputEvent) command produced a gesture,
which has not been cleared.
Otherwise returns false.
InputEvent getGestureEvent()
InputEvent for the gesture as detected by
a previous process(InputEvent), which has not been cleared.
Otherwise returns null.
Only implemented for gestures mapping to InputEvents.
boolean isWithinGesture()
process(InputEvent) command,
which has not been cleared.
Otherwise returns false.
boolean process(InputEvent e)
InputEvent and returns true if it produced the gesture.
Otherwise returns false.
If a gesture was already detected previously and has not been cleared, method does not process the event and returns true.
Besides validation of the event's details,
the handler may also validate the InputEvent.InputClass and/or InputEvent.InputType.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||