Package org.geotools.swing.tool
Class GridReaderLayerHelper
Object
InfoToolHelper
GridReaderLayerHelper
- All Implemented Interfaces:
EventListener,MapBoundsListener
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 -
Method Summary
Modifier and TypeMethodDescriptiongetInfo(Position2D pos) Gets layer data at the specified position.booleanisSupportedLayer(Layer layer) Called by the helper lookup system when selecting a helper for a given layer.booleanisValid()Checks if this helper is holding a reference to aMapContentand aLayer.Helpers only hold aWeakReferenceto both the map content and layer to avoid blocking garbage collection when layers are discarded.voidSets the map layer for this helper.Methods inherited from class InfoToolHelper
clearTransform, getContentToLayerTransform, getLayer, getMapContent, isTransformRequired, mapBoundsChanged, setMapContent
-
Constructor Details
-
GridReaderLayerHelper
public GridReaderLayerHelper()
-
-
Method Details
-
isSupportedLayer
Description copied from class:InfoToolHelperCalled by the helper lookup system when selecting a helper for a given layer.- Specified by:
isSupportedLayerin classInfoToolHelper- Parameters:
layer- the layer- Returns:
trueis this helper can handle the layer
-
setLayer
Description copied from class:InfoToolHelperSets the map layer for this helper.- Overrides:
setLayerin classInfoToolHelper- Parameters:
layer- the map layer
-
isValid
public boolean isValid()Description copied from class:InfoToolHelperChecks if this helper is holding a reference to aMapContentand aLayer.Helpers only hold aWeakReferenceto both the map content and layer to avoid blocking garbage collection when layers are discarded.- Overrides:
isValidin classInfoToolHelper- Returns:
trueif both map content and layer references are valid
-
getInfo
Description copied from class:InfoToolHelperGets layer data at the specified position. If there are no feature data at the position, an emptyInfoToolResultobject is returned.- Specified by:
getInfoin classInfoToolHelper- Parameters:
pos- query position- Returns:
- layer data
- Throws:
Exception- on error querying the layer
-