es.prodevelop.gvsig.mobile.gui.tool.listener
Class PanListener

java.lang.Object
  extended byes.prodevelop.gvsig.mobile.gui.tool.listener.PanListener
All Implemented Interfaces:
PointToolListener, ToolListener

public class PanListener
extends java.lang.Object
implements PointToolListener

This listener is associated with the pan tool. It will repaint the map after every mouse drag event, using a frozen image, not refreshing the map truly. When the mouse is lifted, the extent will be updated.

Author:
jldominguez
See Also:
RectangleBehavior, PanRefreshTimerTask

Constructor Summary
PanListener(MapControl _mc)
          Constructor.
 
Method Summary
 boolean cancelDrawing()
          This method asks the listener to cancel the current drawing process (currently unsued)
 java.awt.Cursor getCursor()
          Gets the cursor that should be used while this tool is active.
 void point(PointEvent pevent)
          This method will be called on every point event.
 void setMapControl(MapControl _mc)
          Sets the MapControl object that will be updated by this listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PanListener

public PanListener(MapControl _mc)
Constructor.

Parameters:
_mc - the MapControl needed to perform repaint requests and reset the extent.
Method Detail

point

public void point(PointEvent pevent)
This method will be called on every point event. If it's a drag event, the map will be repainted with a slight accumulative offset.

Specified by:
point in interface PointToolListener
Parameters:
pevent - the point event

getCursor

public java.awt.Cursor getCursor()
Gets the cursor that should be used while this tool is active.

Specified by:
getCursor in interface ToolListener
Returns:
the cursor that should be used while this tool is active.

cancelDrawing

public boolean cancelDrawing()
This method asks the listener to cancel the current drawing process (currently unsued)

Specified by:
cancelDrawing in interface ToolListener
Returns:
whether it was possible to cancel the drawing

setMapControl

public void setMapControl(MapControl _mc)
Sets the MapControl object that will be updated by this listener.

Specified by:
setMapControl in interface ToolListener
Parameters:
_mc - the MapControl object to be used by this listener.