public interface GestureRecognizer
External api for mangling touch events into gestures (events or callbacks). The handle() method accepts incoming dom events, getTouches() returns the current set of touches this gesture is handling, and cancel() releases the current touches so that other handlers can deal with them.
Various implementations of this can either support on- methods or events to indicate that touch events or gestures are ongoing or have completed. Events are generally expected to be fired from any provided delegate rather than this object itself.
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Ends recognition of the gesture, and fires any cancel events that apply.
|
List<TouchData> |
getTouches()
Gets all actively recognized touches that are being recognized by this gesture.
|
boolean |
handle(NativeEvent event)
Takes a browser event, and checks to see if it should decipher a gesture from it.
|
void |
setDelegate(HasHandlers eventDelegate)
Sets delegate to receive Gesture events
|
void |
start(List<TouchData> touches)
Artificially starts a gesture
|
void cancel()
List<TouchData> getTouches()
boolean handle(NativeEvent event)
Takes a browser event, and checks to see if it should decipher a gesture from it.
Callers of this are expected to do their own vetting to decide if the given event should be handled by this gesture - for example, if a cell accepts a tap on one part of it and a longpress on another, the cell should determine where the touch events occur and send to the right recognizer accordingly.
event
- the browser event to read for a gesture.void setDelegate(HasHandlers eventDelegate)
eventDelegate
- the event handler delegateCopyright © 2018. All rights reserved.