Errai 3.0.1-SNAPSHOT

org.jboss.errai.ui.cordova.events.touch.swipe
Class SwipeRecognizer

java.lang.Object
  extended by org.jboss.errai.ui.cordova.events.touch.AbstractRecognizer
      extended by org.jboss.errai.ui.cordova.events.touch.swipe.SwipeRecognizer
All Implemented Interfaces:
com.google.gwt.event.dom.client.TouchCancelHandler, com.google.gwt.event.dom.client.TouchEndHandler, com.google.gwt.event.dom.client.TouchMoveHandler, com.google.gwt.event.dom.client.TouchStartHandler, com.google.gwt.event.shared.EventHandler

public class SwipeRecognizer
extends AbstractRecognizer


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.errai.ui.cordova.events.touch.AbstractRecognizer
AbstractRecognizer.State
 
Constructor Summary
SwipeRecognizer(com.google.gwt.event.shared.HasHandlers source)
          construct a swipe recognizer
SwipeRecognizer(com.google.gwt.event.shared.HasHandlers source, int minDistance)
          construct a swipe recognizer
SwipeRecognizer(com.google.gwt.event.shared.HasHandlers source, int minDistance, int threshold)
          construct a swipe recognizer
 
Method Summary
 int getMinDistance()
          the distance that needs to be covered before counting as a swipe
 int getThreshold()
          the threshold before an event is fired (deadzone)
 void onTouchCancel(com.google.gwt.event.dom.client.TouchCancelEvent event)
           
 void onTouchEnd(com.google.gwt.event.dom.client.TouchEndEvent event)
           
 void onTouchMove(com.google.gwt.event.dom.client.TouchMoveEvent event)
           
 void onTouchStart(com.google.gwt.event.dom.client.TouchStartEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwipeRecognizer

public SwipeRecognizer(com.google.gwt.event.shared.HasHandlers source)
construct a swipe recognizer

Parameters:
source - the source to fire events on

SwipeRecognizer

public SwipeRecognizer(com.google.gwt.event.shared.HasHandlers source,
                       int minDistance)
construct a swipe recognizer

Parameters:
source - the source to fire events on
minDistance - the minimum distance to cover before this counts as a swipe

SwipeRecognizer

public SwipeRecognizer(com.google.gwt.event.shared.HasHandlers source,
                       int minDistance,
                       int threshold)
construct a swipe recognizer

Parameters:
source - the source to fire events on
minDistance - the minimum distance to cover before this counts as a swipe
threshold - the initial threshold before swipe start is fired
Method Detail

onTouchStart

public void onTouchStart(com.google.gwt.event.dom.client.TouchStartEvent event)

onTouchMove

public void onTouchMove(com.google.gwt.event.dom.client.TouchMoveEvent event)

onTouchEnd

public void onTouchEnd(com.google.gwt.event.dom.client.TouchEndEvent event)

onTouchCancel

public void onTouchCancel(com.google.gwt.event.dom.client.TouchCancelEvent event)

getThreshold

public int getThreshold()
the threshold before an event is fired (deadzone)

Returns:
the threshold in px

getMinDistance

public int getMinDistance()
the distance that needs to be covered before counting as a swipe

Returns:
the distance in px

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.