Package org.geotools.swing.tool
Class FeatureLayerHelper
- Object
- 
- InfoToolHelper
- 
- FeatureLayerHelper
 
 
- 
- All Implemented Interfaces:
- EventListener,- MapBoundsListener
 
 public class FeatureLayerHelper extends InfoToolHelper Helper class used by InfoTool to query vector features in a FeatureLayer.- Since:
- 2.6
- Author:
- Michael Bedward
 
- 
- 
Field SummaryFields Modifier and Type Field Description static doubleDEFAULT_DISTANCE_FRACTIONDefault distance fraction used with line and point features.- 
Fields inherited from class InfoToolHelpercontentRef, KEY_POSITION, layerRef
 
- 
 - 
Constructor SummaryConstructors Constructor Description FeatureLayerHelper()No argument constructor required by the helper lookup system.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description InfoToolResultgetInfo(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.voidsetLayer(Layer layer)Sets the map layer for this helper.- 
Methods inherited from class InfoToolHelperclearTransform, getContentToLayerTransform, getLayer, getMapContent, isTransformRequired, isValid, mapBoundsChanged, setMapContent
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_DISTANCE_FRACTIONpublic static final double DEFAULT_DISTANCE_FRACTION Default distance fraction used with line and point features. When the user clicks on the map, this tool searches for features within a rectangle of width w centred on the mouse location, where w is the average map side length multiplied by the value of this constant.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setLayerpublic void setLayer(Layer layer) Sets the map layer for this helper. Thelayerargument must be an instance of FeatureLayer.- Overrides:
- setLayerin class- InfoToolHelper
- Parameters:
- layer- the map layer
 
 - 
isSupportedLayerpublic boolean isSupportedLayer(Layer layer) Description copied from class:InfoToolHelperCalled by the helper lookup system when selecting a helper for a given layer.- Specified by:
- isSupportedLayerin class- InfoToolHelper
- Parameters:
- layer- the layer
- Returns:
- trueis this helper can handle the layer
 
 - 
getInfopublic InfoToolResult getInfo(Position2D pos) throws Exception 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 class- InfoToolHelper
- Parameters:
- pos- query position
- Returns:
- layer data
- Throws:
- Exception- on error querying the layer
 
 
- 
 
-