|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.swing.event.MapMouseAdapter
org.geotools.swing.tool.CursorTool
org.geotools.swing.tool.InfoTool
public class InfoTool
A cursor tool to retrieve information about features that the user clicks
on with the mouse. It works with InfoToolHelper
objects which do
the work of querying feature data. The primary reason for this design
is to shield this class from the grid coverage classes so that
users who are working purely with vector data are not forced to have
JAI in the classpath.
InfoToolHelper
Field Summary | |
---|---|
static java.awt.Point |
CURSOR_HOTSPOT
Cursor hotspot coordinates |
static java.lang.String |
CURSOR_IMAGE
Cursor |
static double |
DEFAULT_DISTANCE_FRACTION
Default distance fraction used with line and point features. |
static java.lang.String |
ICON_IMAGE
Icon for the control |
static java.lang.String |
TOOL_NAME
The tool name |
static java.lang.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. |
java.awt.Cursor |
getCursor()
Get the cursor for this tool. |
void |
onMouseClicked(MapMouseEvent ev)
Respond to a mouse click by querying each of the MapLayers . |
void |
onReporterClosed(java.awt.event.WindowEvent ev)
Called when a JTextReporter frame that was being used by this tool
is closed by the user |
void |
onReporterUpdated(int newTextStartLine)
Empty method. |
Methods inherited from class org.geotools.swing.tool.CursorTool |
---|
getMapPane, setMapPane |
Methods inherited from class org.geotools.swing.event.MapMouseAdapter |
---|
onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onMouseWheelMoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TOOL_NAME
public static final java.lang.String TOOL_TIP
public static final java.lang.String CURSOR_IMAGE
public static final java.awt.Point CURSOR_HOTSPOT
public static final java.lang.String ICON_IMAGE
public static final double DEFAULT_DISTANCE_FRACTION
Constructor Detail |
---|
public InfoTool()
Method Detail |
---|
public void onMouseClicked(MapMouseEvent ev)
MapLayers
. The
details of features lying within the threshold distance of the mouse
position are reported on screen using a JTextReporter
dialog.
Implementation note: An instance of InfoToolHelper
is created
and cached for each of the MapLayers
. The helpers are created using
reflection to avoid direct references to grid coverage classes here that would
required JAI (Java Advanced Imaging) to be on the classpath even when only
vector layers are being used.
onMouseClicked
in interface MapMouseListener
onMouseClicked
in class MapMouseAdapter
ev
- mouse eventJTextReporter
,
InfoToolHelper
public java.awt.Cursor getCursor()
CursorTool
getCursor
in class CursorTool
public boolean drawDragBox()
drawDragBox
in class CursorTool
public void onReporterClosed(java.awt.event.WindowEvent ev)
JTextReporter
frame that was being used by this tool
is closed by the user
onReporterClosed
in interface TextReporterListener
ev
- event published by the JTextReporter
public void onReporterUpdated(int newTextStartLine)
TextReporterListener
interface.
onReporterUpdated
in interface TextReporterListener
newTextStartLine
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |