|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectInfoToolHelper
public abstract class InfoToolHelper
Abstract base class for helper classes used by InfoTool to query features in map layers.
Field Summary | |
---|---|
protected WeakReference<MapContent> |
contentRef
|
static String |
KEY_POSITION
String key used for the position element in the Map passed to
#getInfo( org.geotools.util.KVP ). |
protected WeakReference<Layer> |
layerRef
|
Constructor Summary | |
---|---|
InfoToolHelper()
|
Method Summary | |
---|---|
protected void |
clearTransform()
|
protected MathTransform |
getContentToLayerTransform()
Gets the MathTransform used to convert coordinates from the
projection being used by the MapContent to that of the
Layer . |
abstract InfoToolResult |
getInfo(DirectPosition2D pos)
Gets layer data at the specified position. |
Layer |
getLayer()
Gets the map layer associated with this helper. |
MapContent |
getMapContent()
Gets the map content associated with this helper. |
abstract boolean |
isSupportedLayer(Layer layer)
CAlled by the helper lookup system when selecting a helper for a given layer. |
protected boolean |
isTransformRequired()
|
boolean |
isValid()
Checks if this helper is holding a reference to a MapContent and
a Layer .Helpers only hold a WeakReference to both the
map content and layer to avoid blocking garbage collection when layers
are discarded. |
void |
mapBoundsChanged(MapBoundsEvent event)
A method from the MapBoundsListener interface used to listen
for a change to the map content's coordinate reference system. |
void |
setLayer(Layer layer)
Sets the map layer for this helper. |
void |
setMapContent(MapContent content)
Sets the map content for this helper. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String KEY_POSITION
Map
passed to
#getInfo( org.geotools.util.KVP ).
protected WeakReference<MapContent> contentRef
protected WeakReference<Layer> layerRef
Constructor Detail |
---|
public InfoToolHelper()
Method Detail |
---|
public abstract boolean isSupportedLayer(Layer layer)
layer
- the layer
true
is this helper can handle the layer
IllegalArgumentException
- if layer
is null
public abstract InfoToolResult getInfo(DirectPosition2D pos) throws Exception
InfoToolResult
object is
returned.
pos
- query position
Exception
- on error querying the layerpublic boolean isValid()
MapContent
and
a Layer
.Helpers only hold a WeakReference
to both the
map content and layer to avoid blocking garbage collection when layers
are discarded.
true
if both map content and layer references are validpublic void setMapContent(MapContent content)
layer
- the map content
IllegalArgumentException
- if content
is null
public MapContent getMapContent()
public void setLayer(Layer layer)
layer
- the map layer
IllegalArgumentException
- if layer
is null
public Layer getLayer()
public void mapBoundsChanged(MapBoundsEvent event)
MapBoundsListener
interface used to listen
for a change to the map content's coordinate reference system.
mapBoundsChanged
in interface MapBoundsListener
event
- The change event.protected MathTransform getContentToLayerTransform()
MathTransform
used to convert coordinates from the
projection being used by the MapContent
to that of the
Layer
.
null
if the layer's CRS is the same
as that of the map content, or if either has no CRS definedprotected boolean isTransformRequired()
protected void clearTransform()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |