Package com.google.gwt.touch.client
Class DefaultMomentum
- java.lang.Object
-
- com.google.gwt.touch.client.DefaultMomentum
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.gwt.touch.client.Momentum
Momentum.State
-
-
Constructor Summary
Constructors Constructor Description DefaultMomentum()
-
Method Summary
All Methods Instance Methods Concrete 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
public Momentum.State createState(Point initialPosition, Point initialVelocity)
Description copied from interface:MomentumCreate aMomentum.Stateinstance. TheMomentum.Stateinstance will be passed toMomentum.updateState(State)until the momentum is depleted.- Specified by:
createStatein interfaceMomentum- Parameters:
initialPosition- the initial positioninitialVelocity- the initial velocity in pixels per millisecond
-
updateState
public boolean updateState(Momentum.State state)
Description copied from interface:MomentumUpdate 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 toMomentum.createState(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).- Specified by:
updateStatein interfaceMomentum- Parameters:
state- the current state- Returns:
- true to continue momentum, false if no momentum remains
-
-