com.maryanovsky.map.client
Class MapWidget.MapDragAction

java.lang.Object
  extended by com.maryanovsky.map.client.MapWidget.MapDragAction
All Implemented Interfaces:
DragAction
Enclosing class:
MapWidget

public abstract static class MapWidget.MapDragAction
extends Object
implements DragAction

A DragAction on the map widget. This is a convenience class which converts the event's target widget to a MapWidget. Additionally, it makes sure to invoke the delegate methods only if the MapWidget is already displaying a (non null) map.


Constructor Summary
MapWidget.MapDragAction()
           
 
Method Summary
protected abstract  void mapDragEnded(MapWidget mapWidget, PointView point, PointView offset)
          Invoked when the map stops being dragged.
protected abstract  void mapDragged(MapWidget mapWidget, PointView point, PointView offset)
          Invoked when the map is being dragged.
protected abstract  void mapPressed(MapWidget mapWidget, PointView point)
          Invoked on mouse-press on the map.
protected abstract  void mapReleased(MapWidget mapWidget, PointView point)
          Invoked on mouse-release on the map, when the drag action did not occur.
 void mouseDragEnded(Widget target, PointView point, PointView offset)
          Converts the target widget to a MapWidget and calls mapDragEnded(MapWidget, PointView, PointView).
 void mouseDragged(Widget target, PointView point, PointView offset)
          Converts the target widget to a MapWidget and calls mapDragged(MapWidget, PointView, PointView).
 void mousePressed(Widget target, PointView point)
          Converts the target widget to a MapWidget and calls mapPressed(MapWidget, PointView).
 void mouseReleased(Widget target, PointView point)
          Converts the target widget to a MapWidget and calls mapReleased(MapWidget, PointView).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapWidget.MapDragAction

public MapWidget.MapDragAction()
Method Detail

mousePressed

public void mousePressed(Widget target,
                         PointView point)
Converts the target widget to a MapWidget and calls mapPressed(MapWidget, PointView).

Specified by:
mousePressed in interface DragAction
Parameters:
target - The widget where the mouse was pressed.
point - The point where the mouse was pressed.

mouseReleased

public void mouseReleased(Widget target,
                          PointView point)
Converts the target widget to a MapWidget and calls mapReleased(MapWidget, PointView).

Specified by:
mouseReleased in interface DragAction
Parameters:
target - The widget where the mouse-drag started.
point - The point where the mouse was pressed and released.

mouseDragged

public void mouseDragged(Widget target,
                         PointView point,
                         PointView offset)
Converts the target widget to a MapWidget and calls mapDragged(MapWidget, PointView, PointView).

Specified by:
mouseDragged in interface DragAction
Parameters:
target - The widget where the mouse was dragged.
point - The current location of the mouse pointer.
offset - The offset from the point where the mouse was pressed to the current point.

mouseDragEnded

public void mouseDragEnded(Widget target,
                           PointView point,
                           PointView offset)
Converts the target widget to a MapWidget and calls mapDragEnded(MapWidget, PointView, PointView).

Specified by:
mouseDragEnded in interface DragAction
Parameters:
target - The widget where the mouse was dragged.
point - The point where the mouse was released.
offset - The offset from the point where the mouse was pressed to the current point.

mapPressed

protected abstract void mapPressed(MapWidget mapWidget,
                                   PointView point)
Invoked on mouse-press on the map.


mapReleased

protected abstract void mapReleased(MapWidget mapWidget,
                                    PointView point)
Invoked on mouse-release on the map, when the drag action did not occur.


mapDragged

protected abstract void mapDragged(MapWidget mapWidget,
                                   PointView point,
                                   PointView offset)
Invoked when the map is being dragged.


mapDragEnded

protected abstract void mapDragEnded(MapWidget mapWidget,
                                     PointView point,
                                     PointView offset)
Invoked when the map stops being dragged.