|
|||||||||
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.drag.DragRecognizer
public class DragRecognizer
Recognizes and fires drag events.
Field Summary |
---|
Fields inherited from class com.maryanovsky.gwtutils.client.ui.touch.gestures.TouchGestureRecognizer |
---|
handlerManager |
Constructor Summary | |
---|---|
DragRecognizer(Object dragEventsSource)
Creates a new DragRecognizer which will fire drag events with the
specified source object. |
|
DragRecognizer(Object dragEventsSource,
Condition<? super DragStartEvent> dragCondition)
Creates a new DragRecognizer which will fire drag events with
the specified source object and consult the specified drag condition
before doing so. |
|
DragRecognizer(Object dragEventsSource,
H touchEventsSource)
Creates a new DragRecognizer which will fire events with the
specified source object and use the specified source of touch events. |
|
DragRecognizer(Object dragEventsSource,
H touchEventsSource,
Condition<? super DragStartEvent> dragCondition)
Creates a new DragRecognizer which will fire events with the
specified source object, use the specified source of touch events and
consult the specified drag condition before firing the drag event(s). |
Method Summary | |
---|---|
HandlerRegistration |
addDragCancelHandler(DragCancelHandler handler)
Adds a drag cancel handler. |
HandlerRegistration |
addDragEndHandler(DragEndHandler handler)
Adds a drag end handler. |
HandlerRegistration |
addDragMoveHandler(DragMoveHandler handler)
Adds a drag move handler. |
HandlerRegistration |
addDragStartHandler(DragStartHandler handler)
Adds a drag start handler. |
protected boolean |
dragCondition(DragStartEvent evt)
Returns whether the specified DragStartEvent and the drag events
that follow it in the drag gesture should be delivered to the handlers. |
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. |
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 DragRecognizer(Object dragEventsSource)
DragRecognizer
which will fire drag events with the
specified source object.
public DragRecognizer(Object dragEventsSource, H touchEventsSource)
DragRecognizer
which will fire events with the
specified source object and use the specified source of touch events.
public DragRecognizer(Object dragEventsSource, Condition<? super DragStartEvent> dragCondition)
DragRecognizer
which will fire drag events with
the specified source object and consult the specified drag condition
before doing so.
public DragRecognizer(Object dragEventsSource, H touchEventsSource, Condition<? super DragStartEvent> dragCondition)
DragRecognizer
which will fire events with the
specified source object, use the specified source of touch events and
consult the specified drag condition before firing the drag event(s).
See the documentation of dragCondition(DragStartEvent)
for more
information on the drag condition.
Method Detail |
---|
public HandlerRegistration addDragStartHandler(DragStartHandler handler)
addDragStartHandler
in interface HasDragStartHandlers
public HandlerRegistration addDragMoveHandler(DragMoveHandler handler)
addDragMoveHandler
in interface HasDragMoveHandlers
public HandlerRegistration addDragEndHandler(DragEndHandler handler)
addDragEndHandler
in interface HasDragEndHandlers
public HandlerRegistration addDragCancelHandler(DragCancelHandler handler)
addDragCancelHandler
in interface HasDragCancelHandlers
protected boolean dragCondition(DragStartEvent evt)
DragStartEvent
and the drag events
that follow it in the drag gesture should be delivered to the handlers.
This allows filtering drag gestures to only those you really want.
The default implementation delegates the decision to the drag 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 |