Package com.google.gwt.touch.client
Interface Momentum
-
- All Known Implementing Classes:
DefaultMomentum
public interface MomentumDescribes the momentum of a gesture after the gesture has been completed. You can use it to control the speed of scrolling for scrollable widgets affected byTouchScroller.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMomentum.StateA snapshot of the current state.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Momentum.StatecreateState(Point initialPosition, Point initialVelocity)Create aMomentum.Stateinstance.booleanupdateState(Momentum.State state)Update the state based on the specifiedMomentum.State.
-
-
-
Method Detail
-
createState
Momentum.State createState(Point initialPosition, Point initialVelocity)
Create aMomentum.Stateinstance. TheMomentum.Stateinstance will be passed toupdateState(State)until the momentum is depleted.- Parameters:
initialPosition- the initial positioninitialVelocity- the initial velocity in pixels per millisecond
-
updateState
boolean updateState(Momentum.State state)
Update the state based on the specified
Momentum.State. When no more momentum remains, this method should return false to stop future calls.The
Momentum.Stateinstance is created by a call tocreateState(Point, Point), and the same instance if used for the duration of the momentum. This method should modify the existing state by callingMomentum.State.setPosition(Point)and/orMomentum.State.setVelocity(Point).- Parameters:
state- the current state- Returns:
- true to continue momentum, false if no momentum remains
-
-