Package org.geotools.swing.tool
Class GridReaderLayerHelper
- Object
-
- InfoToolHelper
-
- GridReaderLayerHelper
-
- All Implemented Interfaces:
EventListener
,MapBoundsListener
public class GridReaderLayerHelper extends InfoToolHelper
Helper class used by InfoTool to query values in a GridReaderLayer.- Since:
- 8.0
- Author:
- Michael Bedward
-
-
Field Summary
-
Fields inherited from class InfoToolHelper
contentRef, KEY_POSITION, layerRef
-
-
Constructor Summary
Constructors Constructor Description GridReaderLayerHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InfoToolResult
getInfo(Position2D pos)
Gets layer data at the specified position.boolean
isSupportedLayer(Layer layer)
Called by the helper lookup system when selecting a helper for a given layer.boolean
isValid()
Checks if this helper is holding a reference to aMapContent
and aLayer
.Helpers only hold aWeakReference
to both the map content and layer to avoid blocking garbage collection when layers are discarded.void
setLayer(Layer layer)
Sets the map layer for this helper.-
Methods inherited from class InfoToolHelper
clearTransform, getContentToLayerTransform, getLayer, getMapContent, isTransformRequired, mapBoundsChanged, setMapContent
-
-
-
-
Method Detail
-
isSupportedLayer
public boolean isSupportedLayer(Layer layer)
Description copied from class:InfoToolHelper
Called by the helper lookup system when selecting a helper for a given layer.- Specified by:
isSupportedLayer
in classInfoToolHelper
- Parameters:
layer
- the layer- Returns:
true
is this helper can handle the layer
-
setLayer
public void setLayer(Layer layer)
Description copied from class:InfoToolHelper
Sets the map layer for this helper.- Overrides:
setLayer
in classInfoToolHelper
- Parameters:
layer
- the map layer
-
isValid
public boolean isValid()
Description copied from class:InfoToolHelper
Checks if this helper is holding a reference to aMapContent
and aLayer
.Helpers only hold aWeakReference
to both the map content and layer to avoid blocking garbage collection when layers are discarded.- Overrides:
isValid
in classInfoToolHelper
- Returns:
true
if both map content and layer references are valid
-
getInfo
public InfoToolResult getInfo(Position2D pos) throws Exception
Description copied from class:InfoToolHelper
Gets layer data at the specified position. If there are no feature data at the position, an emptyInfoToolResult
object is returned.- Specified by:
getInfo
in classInfoToolHelper
- Parameters:
pos
- query position- Returns:
- layer data
- Throws:
Exception
- on error querying the layer
-
-