com.maryanovsky.map.client.actions.touch
Class InertialDragPanAction

java.lang.Object
  extended by com.maryanovsky.map.client.actions.MapAction<HasAllDragHandlers>
      extended by com.maryanovsky.map.client.actions.touch.InertialDragPanAction
All Implemented Interfaces:
EventHandler, DragCancelHandler, DragEndHandler, DragMoveHandler, DragStartHandler

public class InertialDragPanAction
extends MapAction<HasAllDragHandlers>
implements DragStartHandler, DragMoveHandler, DragEndHandler, DragCancelHandler

Pans the map as the user drags his finger across the map widget, continuing the panning after the user lifted his finger, as if the map had inertia over a surface with friction.

Author:
Maryanovsky Alexander

Field Summary
 
Fields inherited from class com.maryanovsky.map.client.actions.MapAction
isAnimated, mapWidget
 
Constructor Summary
InertialDragPanAction(MapWidget mapWidget, int decelerationDuration)
          Creates a new InertialDragPanAction for the specified map widget with the specified deceleration duration, in milliseconds.
 
Method Summary
 void onDragCancel(DragCancelEvent evt)
          Invoked when a drag gesture is cancelled.
 void onDragEnd(DragEndEvent evt)
          Invoked when a drag gesture ends.
 void onDragMove(DragMoveEvent evt)
          Invoked when a drag gesture is in progress.
 void onDragStart(DragStartEvent evt)
          Invoked when a drag gesture starts.
 HandlerRegistration registerWith(HasAllDragHandlers dragSource)
          Registers for handling drag events from the specified source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InertialDragPanAction

public InertialDragPanAction(MapWidget mapWidget,
                             int decelerationDuration)
Creates a new InertialDragPanAction for the specified map widget with the specified deceleration duration, in milliseconds.

Parameters:
mapWidget - The target map widget.
decelerationDuration - The time it takes the map to decelerate to full stop, in milliseconds.
Method Detail

registerWith

public HandlerRegistration registerWith(HasAllDragHandlers dragSource)
Registers for handling drag events from the specified source.

Specified by:
registerWith in class MapAction<HasAllDragHandlers>

onDragStart

public void onDragStart(DragStartEvent evt)
Invoked when a drag gesture starts.

Specified by:
onDragStart in interface DragStartHandler

onDragMove

public void onDragMove(DragMoveEvent evt)
Invoked when a drag gesture is in progress.

Specified by:
onDragMove in interface DragMoveHandler

onDragEnd

public void onDragEnd(DragEndEvent evt)
Invoked when a drag gesture ends.

Specified by:
onDragEnd in interface DragEndHandler

onDragCancel

public void onDragCancel(DragCancelEvent evt)
Invoked when a drag gesture is cancelled.

Specified by:
onDragCancel in interface DragCancelHandler