|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.maryanovsky.gwtutils.client.ui.touch.gestures.TouchGestureRecognizer
com.maryanovsky.gwtutils.client.ui.touch.gestures.tap.TapRecognizer
public class TapRecognizer
Recognizes and fires single-finger, multi-tap events.
Field Summary |
---|
Fields inherited from class com.maryanovsky.gwtutils.client.ui.touch.gestures.TouchGestureRecognizer |
---|
handlerManager |
Constructor Summary | |
---|---|
TapRecognizer(Object tapEventsSource)
Creates a new TapRecognizer which will fire events with the
specified source object. |
|
TapRecognizer(Object tapEventsSource,
Condition<? super TapEvent> tapCondition)
Creates a new TapRecognizer which will fire events with the
specified source object and consult the specified tap condition before
firing tap events. |
|
TapRecognizer(Object tapEventsSource,
H touchEventsSource)
Creates a new TapRecognizer which will fire events with the
specified source object and use the specified source of touch events. |
|
TapRecognizer(Object tapEventsSource,
H touchEventsSource,
Condition<? super TapEvent> tapCondition)
Creates a new TapRecognizer which will fire events with the
specified source object, use the specified source of touch events and
consult the specified tap condition before firing tap events. |
Method Summary | |
---|---|
HandlerRegistration |
addTapHandler(TapHandler handler)
Adds a tap handler. |
protected void |
onTouchCancel(TouchCancelEvent evt)
Invoked when a touch event is canceled. |
protected void |
onTouchEnd(TouchEndEvent evt)
Invoked when a finger touching the screen is lifted. |
protected void |
onTouchMove(TouchMoveEvent evt)
Invoked when a finger touching the screen is moved. |
protected void |
onTouchStart(TouchStartEvent evt)
Invoked when a touch starts. |
protected boolean |
tapCondition(TapEvent evt)
Returns whether the specified TapEvent should be delivered to the
handlers. |
Methods inherited from class com.maryanovsky.gwtutils.client.ui.touch.gestures.TouchGestureRecognizer |
---|
fireEvent, setTouchEventsSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TapRecognizer(Object tapEventsSource)
TapRecognizer
which will fire events with the
specified source object.
public TapRecognizer(Object tapEventsSource, H touchEventsSource)
TapRecognizer
which will fire events with the
specified source object and use the specified source of touch events.
public TapRecognizer(Object tapEventsSource, Condition<? super TapEvent> tapCondition)
TapRecognizer
which will fire events with the
specified source object and consult the specified tap condition before
firing tap events.
public TapRecognizer(Object tapEventsSource, H touchEventsSource, Condition<? super TapEvent> tapCondition)
TapRecognizer
which will fire events with the
specified source object, use the specified source of touch events and
consult the specified tap condition before firing tap events.
See the documentation of tapCondition(TapEvent)
for more
information on the tap condition.
Method Detail |
---|
public HandlerRegistration addTapHandler(TapHandler handler)
addTapHandler
in interface HasTapHandlers
protected boolean tapCondition(TapEvent evt)
TapEvent
should be delivered to the
handlers. This allows filtering tap gestures to only those you really
want. For example, if you only want to recognize double taps, you would
override this method and return evt.getTapCount() == 2
.
The default implementation delegates the decision to the tap condition
passed in the constructor.
protected void onTouchStart(TouchStartEvent evt)
onTouchStart
in class TouchGestureRecognizer
protected void onTouchMove(TouchMoveEvent evt)
onTouchMove
in class TouchGestureRecognizer
protected void onTouchEnd(TouchEndEvent evt)
onTouchEnd
in class TouchGestureRecognizer
protected void onTouchCancel(TouchCancelEvent evt)
onTouchCancel
in class TouchGestureRecognizer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |