Package com.google.gwt.event.dom.client
Class TouchEvent<H extends EventHandler>
- java.lang.Object
-
- com.google.web.bindery.event.shared.Event<H>
-
- com.google.gwt.event.shared.GwtEvent<H>
-
- com.google.gwt.event.dom.client.DomEvent<H>
-
- com.google.gwt.event.dom.client.HumanInputEvent<H>
-
- com.google.gwt.event.dom.client.TouchEvent<H>
-
- Type Parameters:
H
- handler type
- All Implemented Interfaces:
HasNativeEvent
- Direct Known Subclasses:
TouchCancelEvent
,TouchEndEvent
,TouchMoveEvent
,TouchStartEvent
public abstract class TouchEvent<H extends EventHandler> extends HumanInputEvent<H>
Abstract class representing touch events. See {@link Safari Touch Event Documentation}
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.event.dom.client.DomEvent
DomEvent.Type<H extends EventHandler>
-
-
Constructor Summary
Constructors Constructor Description TouchEvent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsArray<Touch>
getChangedTouches()
Get an array oftouches
which have changed since the last touch event fired.JsArray<Touch>
getTargetTouches()
Get an array oftouches
all touch which originated at the same target as the current touch event.JsArray<Touch>
getTouches()
Get an array of all currenttouches
.static boolean
isSupported()
Runtime check for whether touch scrolling is supported in this browser.-
Methods inherited from class com.google.gwt.event.dom.client.HumanInputEvent
isAltKeyDown, isControlKeyDown, isMetaKeyDown, isShiftKeyDown
-
Methods inherited from class com.google.gwt.event.dom.client.DomEvent
fireNativeEvent, fireNativeEvent, getAssociatedType, getNativeEvent, getRelativeElement, init, preventDefault, setNativeEvent, setRelativeElement, stopPropagation
-
Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, dispatch, getSource, isLive, kill, revive
-
Methods inherited from class com.google.web.bindery.event.shared.Event
setSource, toDebugString, toString
-
-
-
-
Method Detail
-
isSupported
public static boolean isSupported()
Runtime check for whether touch scrolling is supported in this browser. Returns true if touch events are supported but touch based scrolling is not natively supported.- Returns:
- true if touch events are supported, false if not
-
getChangedTouches
public JsArray<Touch> getChangedTouches()
Get an array oftouches
which have changed since the last touch event fired. Note, that fortouch end events
, the touch which has just ended will not be present in the array. Moreover, if the touch which just ended was the last remaining touch, then a zero length array will be returned.- Returns:
- an array of touches
-
getTargetTouches
public JsArray<Touch> getTargetTouches()
Get an array oftouches
all touch which originated at the same target as the current touch event. Note, that fortouch end events
, the touch which has just ended will not be present in the array. Moreover, if the touch which just ended was the last remaining touch, then a zero length array will be returned.- Returns:
- an array of touches
-
getTouches
public JsArray<Touch> getTouches()
Get an array of all currenttouches
. Note, that fortouch end events
, the touch which has just ended will not be present in the array. Moreover, if the touch which just ended was the last remaining touch, then a zero length array will be returned.- Returns:
- an array of touches
-
-