org.geotools.swing.tool
Class InfoTool

Object
  extended by MapMouseAdapter
      extended by CursorTool
          extended by InfoTool
All Implemented Interfaces:
MapMouseListener, TextReporterListener

public class InfoTool
extends CursorTool
implements TextReporterListener

A cursor tool to retrieve information about features that the user clicks on with the mouse.

Since:
2.6
Author:
Michael Bedward
Module:

Field Summary
static Point CURSOR_HOTSPOT
          Cursor hotspot coordinates
static String CURSOR_IMAGE
          Cursor
static double DEFAULT_DISTANCE_FRACTION
          Default distance fraction.
static String ICON_IMAGE
          Icon for the control
static String TOOL_NAME
          The tool name
static String TOOL_TIP
          Tool tip text
 
Constructor Summary
InfoTool()
          Constructor
 
Method Summary
 boolean drawDragBox()
          Query if the tool is one that draws a box on the map display when the mouse is being dragged (eg. to indicate a zoom area).
 Cursor getCursor()
          Get the cursor for this tool.
 void onMouseClicked(MapMouseEvent ev)
          Respond to a mouse click event received from the map pane
 void onReporterClosed(WindowEvent ev)
          Called when a JTextReporter frame that was being used by this tool is closed by the user
 
Methods inherited from class CursorTool
getMapPane, setMapPane
 
Methods inherited from class MapMouseAdapter
onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, 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
The 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

DEFAULT_DISTANCE_FRACTION

public static final double DEFAULT_DISTANCE_FRACTION
Default distance fraction. When the user clicks on the map, this tool searches for point and line features that are within a given distance (in world units) of the mouse location. That threshold distance is set as the maximum map side length multiplied by the distance fraction.

See Also:
Constant Field Values
Constructor Detail

InfoTool

public InfoTool()
Constructor

Method Detail

onMouseClicked

public void onMouseClicked(MapMouseEvent ev)
Description copied from class: MapMouseAdapter
Respond to a mouse click event received from the map pane

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

getCursor

public Cursor getCursor()
Description copied from class: CursorTool
Get the cursor for this tool. Sub-classes should override this method to provide a custom cursor.

Overrides:
getCursor in class CursorTool
Returns:
the default cursor

drawDragBox

public boolean drawDragBox()
Description copied from class: CursorTool
Query if the tool is one that draws a box on the map display when the mouse is being dragged (eg. to indicate a zoom area).

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

onReporterClosed

public void onReporterClosed(WindowEvent ev)
Called when a JTextReporter frame that was being used by this tool is closed by the user

Specified by:
onReporterClosed in interface TextReporterListener
Parameters:
ev - event published by the JTextReporter


Copyright © 1996-2009 Geotools. All Rights Reserved.