Class Momentum.State

java.lang.Object
com.google.gwt.touch.client.Momentum.State
Enclosing interface:
Momentum

public static class Momentum.State extends Object
A snapshot of the current state.
  • Constructor Details

    • State

      public State(Point initialPosition, Point initialVelocity)
      Construct a new Momentum.State.
      Parameters:
      initialPosition - the initial position, which is also set to the current position
      initialVelocity - 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

      public Point getInitialPosition()
      Get the initial position when the momentum took over.
      Returns:
      the initial position
    • getInitialVelocity

      public Point getInitialVelocity()
      Get the initial velocity in pixels per millisecond when the momentum took over.
      Returns:
      the initial velocity
    • getPosition

      public Point getPosition()
      Get the current position.
      Returns:
      the current position
    • getVelocity

      public Point getVelocity()
      Get the current velocity in pixels per millisecond.
      Returns:
      the current velocity
    • setPosition

      public void setPosition(Point position)
      Set the current position.
      Parameters:
      position - set the current position
    • setVelocity

      public void setVelocity(Point velocity)
      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.