|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.touch.client.TouchScroller
public class TouchScroller
Adds touch based scrolling to a scroll panel.
Touch based scrolling is only supported on devices that support touch events and do not implement native touch based scrolling.
Nested Class Summary | |
---|---|
(package private) static class |
TouchScroller.TemporalPoint
A point associated with a time. |
Constructor Summary | |
---|---|
protected |
TouchScroller()
Construct a new TouchScroller . |
Method Summary | |
---|---|
(package private) Point |
calculateEndVelocity(TouchScroller.TemporalPoint from,
TouchScroller.TemporalPoint to)
Calculate the end velocity. |
static TouchScroller |
createIfSupported()
Return a new TouchScroller . |
static TouchScroller |
createIfSupported(HasScrolling widget)
Return a new TouchScroller that augments the specified scrollable
widget if supported, and null otherwise. |
(package private) TouchScroller.TemporalPoint |
getLastTouchPosition()
Visible for testing. |
Momentum |
getMomentum()
Get the Momentum that controls scrolling after the user completes a
gesture. |
(package private) TouchScroller.TemporalPoint |
getRecentTouchPosition()
Visible for testing. |
HasScrolling |
getTargetWidget()
Get the target HasScrolling widget that this scroller affects. |
protected Touch |
getTouchFromEvent(TouchEvent<?> event)
Get touch from event. |
(package private) boolean |
isDragging()
Visible for testing. |
(package private) boolean |
isMomentumActive()
Check if momentum is currently active. |
static boolean |
isSupported()
Runtime check for whether touch scrolling is supported in this browser. |
(package private) boolean |
isTouching()
Visible for testing. |
protected void |
onDragEnd(TouchEvent<?> event)
Called when the object's drag sequence is complete. |
protected void |
onDragMove(TouchEvent<?> event)
Called when the object has been dragged to a new position. |
protected void |
onDragStart(TouchEvent<?> event)
Called when the object has started dragging. |
protected void |
onTouchCancel(TouchEvent<?> event)
Called when the user cancels a touch. |
protected void |
onTouchEnd(TouchEvent<?> event)
Called when the user releases a touch. |
protected void |
onTouchMove(TouchEvent<?> event)
Called when the user moves a touch. |
protected void |
onTouchStart(TouchEvent<?> event)
Called when the user starts a touch. |
(package private) void |
removeAttachHandler()
Removes the attach handler. |
(package private) void |
removeBustClickHandler()
Removes the bust click handler. |
void |
setMomentum(Momentum momentum)
Set the Momentum that controls scrolling after the user completes a
gesture. |
void |
setTargetWidget(HasScrolling widget)
Set the target HasScrolling widget that this scroller affects. |
(package private) void |
setupBustClickHandler()
Sets up the bust click handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TouchScroller()
TouchScroller
. This constructor should be called
using the static method createIfSupported()
.
createIfSupported()
Method Detail |
---|
public static TouchScroller createIfSupported()
TouchScroller
.
TouchScroller
if supported, and null otherwisepublic static TouchScroller createIfSupported(HasScrolling widget)
TouchScroller
that augments the specified scrollable
widget if supported, and null otherwise.
widget
- the scrollable widget
TouchScroller
if supported, and null otherwisepublic static boolean isSupported()
public Momentum getMomentum()
Momentum
that controls scrolling after the user completes a
gesture.
Momentum
, or null if disabledpublic HasScrolling getTargetWidget()
HasScrolling
widget that this scroller affects.
public void setMomentum(Momentum momentum)
Momentum
that controls scrolling after the user completes a
gesture.
momentum
- the scrolling Momentum
, or null to disablepublic void setTargetWidget(HasScrolling widget)
HasScrolling
widget that this scroller affects.
widget
- the target widget, or null to disbaleprotected Touch getTouchFromEvent(TouchEvent<?> event)
event
- the event
protected void onDragEnd(TouchEvent<?> event)
event
- the touch eventprotected void onDragMove(TouchEvent<?> event)
event
- the touch eventprotected void onDragStart(TouchEvent<?> event)
event
- the touch eventprotected void onTouchCancel(TouchEvent<?> event)
event
- the touch eventprotected void onTouchEnd(TouchEvent<?> event)
event
- the touch eventprotected void onTouchMove(TouchEvent<?> event)
event
- the touch eventprotected void onTouchStart(TouchEvent<?> event)
event
- the touch eventPoint calculateEndVelocity(TouchScroller.TemporalPoint from, TouchScroller.TemporalPoint to)
from
- the starting pointto
- the ending point
TouchScroller.TemporalPoint getLastTouchPosition()
TouchScroller.TemporalPoint getRecentTouchPosition()
boolean isDragging()
boolean isMomentumActive()
boolean isTouching()
void removeAttachHandler()
void removeBustClickHandler()
void setupBustClickHandler()
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |