Package com.google.gwt.touch.client
Class Momentum.State
java.lang.Object
com.google.gwt.touch.client.Momentum.State
- Enclosing interface:
Momentum
A snapshot of the current state.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the cumulative elapsed time in milliseconds since momentum took over.int
Get the elapsed time in milliseconds since the last time the state was updated.Get the initial position when the momentum took over.Get the initial velocity in pixels per millisecond when the momentum took over.Get the current position.Get the current velocity in pixels per millisecond.(package private) void
setCumulativeElapsedMillis
(int cumulativeElapsedMillis) Set the cumulative elapsed time in milliseconds since momentum took over.(package private) void
setElapsedMillis
(int elapsedMillis) Set the elapsed time in milliseconds since the last time the state was updated.void
setPosition
(Point position) Set the current position.void
setVelocity
(Point velocity) Get the current velocity in pixels per millisecond.
-
Constructor Details
-
State
Construct a newMomentum.State
.- Parameters:
initialPosition
- the initial position, which is also set to the current positioninitialVelocity
- the initial velocity in pixels per millisecond, which is also set to the current velocity
-
-
Method Details
-
getCumulativeElapsedMillis
public int getCumulativeElapsedMillis()Get the cumulative elapsed time in milliseconds since momentum took over.- Returns:
- the elapsed time in milliseconds
-
getElapsedMillis
public int getElapsedMillis()Get the elapsed time in milliseconds since the last time the state was updated.- Returns:
- the elapsed time in milliseconds
-
getInitialPosition
Get the initial position when the momentum took over.- Returns:
- the initial position
-
getInitialVelocity
Get the initial velocity in pixels per millisecond when the momentum took over.- Returns:
- the initial velocity
-
getPosition
Get the current position.- Returns:
- the current position
-
getVelocity
Get the current velocity in pixels per millisecond.- Returns:
- the current velocity
-
setPosition
Set the current position.- Parameters:
position
- set the current position
-
setVelocity
Get the current velocity in pixels per millisecond.- Parameters:
velocity
- set the current velocity
-
setCumulativeElapsedMillis
void setCumulativeElapsedMillis(int cumulativeElapsedMillis) Set the cumulative elapsed time in milliseconds since momentum took over. -
setElapsedMillis
void setElapsedMillis(int elapsedMillis) Set the elapsed time in milliseconds since the last time the state was updated.
-