Momentum (GWT Javadoc)

Overview | Package | Class | Use | Deprecated | Help
| GWT 2.7.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gwt.touch.client
Interface Momentum

All Known Implementing Classes:
  DefaultMomentum

    public interface Momentum

Describes 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 by `TouchScroller`.

Nested Class Summary
`static class` | `Momentum.State` A snapshot of the current state.

Method Summary
`Momentum.State` | `createState(Point initialPosition, Point initialVelocity)` Create a `Momentum.State` instance.
`boolean` | `updateState(Momentum.State state)` Update the state based on the specified `Momentum.State`.

Method Detail

### createState

    Momentum.State createState(Point initialPosition,
                               Point initialVelocity)

  Create a `Momentum.State` instance. The `Momentum.State` instance will be passed to `updateState(State)` until the momentum is depleted.

  Parameters:
    `initialPosition` - the initial position
    `initialVelocity` - 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.State` instance is created by a call to `createState(Point, Point)`, and the same instance if used for the duration of the momentum. This method should modify the existing state by calling `Momentum.State.setPosition(Point)` and/or `Momentum.State.setVelocity(Point)`.

  Parameters:
    `state` - the current state
  Returns:
    true to continue momentum, false if no momentum remains

Overview | Package | Class | Use | Deprecated | Help
| GWT 2.7.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD