org.geotools.swing.tool
Class PanTool

Object
  extended by MapMouseAdapter
      extended by CursorTool
          extended by PanTool
All Implemented Interfaces:
MapMouseListener

public class PanTool
extends CursorTool

A map panning tool for JMapPane. Allows the user to drag the map with the mouse.

Since:
2.6
Author:
Michael Bedward
Module:
modules/unsupported/swing (gt-swing.jar)

Field Summary
static Point CURSOR_HOTSPOT
          Cursor hotspot coordinates
static String CURSOR_IMAGE
          Cursor
static String ICON_IMAGE
          Icon for the control
static String TOOL_NAME
          Tool name
static String TOOL_TIP
          Tool tip text
 
Constructor Summary
PanTool()
          Constructor
 
Method Summary
 boolean drawDragBox()
          Returns false to indicate that this tool does not draw a box on the map display when the mouse is being dragged
 Cursor getCursor()
          Get the mouse cursor for this tool
 void onMouseDragged(MapMouseEvent ev)
          Respond to a mouse dragged event.
 void onMousePressed(MapMouseEvent ev)
          Respond to a mouse button press event from the map mapPane.
 void onMouseReleased(MapMouseEvent ev)
          If this button release is the end of a mouse dragged event, requests the map mapPane to repaint the display
 
Methods inherited from class CursorTool
getMapPane, setMapPane
 
Methods inherited from class MapMouseAdapter
onMouseClicked, onMouseEntered, onMouseExited, onMouseMoved, onMouseWheelMoved
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOOL_NAME

public static final String TOOL_NAME
Tool name


TOOL_TIP

public static final String TOOL_TIP
Tool tip text


CURSOR_IMAGE

public static final String CURSOR_IMAGE
Cursor

See Also:
Constant Field Values

CURSOR_HOTSPOT

public static final Point CURSOR_HOTSPOT
Cursor hotspot coordinates


ICON_IMAGE

public static final String ICON_IMAGE
Icon for the control

See Also:
Constant Field Values
Constructor Detail

PanTool

public PanTool()
Constructor

Method Detail

onMousePressed

public void onMousePressed(MapMouseEvent ev)
Respond to a mouse button press event from the map mapPane. This may signal the start of a mouse drag. Records the event's window position.

Specified by:
onMousePressed in interface MapMouseListener
Overrides:
onMousePressed in class MapMouseAdapter
Parameters:
ev - the mouse event

onMouseDragged

public void onMouseDragged(MapMouseEvent ev)
Respond to a mouse dragged event. Calls org.geotools.swing.JMapPane#moveImage()

Specified by:
onMouseDragged in interface MapMouseListener
Overrides:
onMouseDragged in class MapMouseAdapter
Parameters:
ev - the mouse event

onMouseReleased

public void onMouseReleased(MapMouseEvent ev)
If this button release is the end of a mouse dragged event, requests the map mapPane to repaint the display

Specified by:
onMouseReleased in interface MapMouseListener
Overrides:
onMouseReleased in class MapMouseAdapter
Parameters:
ev - the mouse event

getCursor

public Cursor getCursor()
Get the mouse cursor for this tool

Overrides:
getCursor in class CursorTool
Returns:
the default cursor

drawDragBox

public boolean drawDragBox()
Returns false to indicate that this tool does not draw a box on the map display when the mouse is being dragged

Overrides:
drawDragBox in class CursorTool
Returns:
true if this tool supports drawing a drag-box on the map; false otherwise


Copyright © 1996-2010 Geotools. All Rights Reserved.