skrueger.geotools
Class StyledFS

java.lang.Object
  extended by skrueger.geotools.StyledFS
All Implemented Interfaces:
StyledFeaturesInterface<FeatureSource>, StyledFeatureSourceInterface, StyledLayerInterface<FeatureSource>

public class StyledFS
extends Object
implements StyledFeatureSourceInterface

This class enables a non Atlas context to use the Atlas LayerPanel JPanel as a MapContextManagerInterface

Author:
Stefan Alfons Krüger

Constructor Summary
StyledFS(FeatureSource fs, File sldFile)
          This class enables a non Atlas context to use the Atlas LayerPanel JPanel as a MapContextManagerInterface
 
Method Summary
 void dispose()
          Should be called when this Object is not needed anymore.
 Map<Integer,AttributeMetaData> getAttributeMetaDataMap()
           
 CoordinateReferenceSystem getCrs()
           
 String getCRSString()
          Returnes human readable String of the CRS natively used by this DpLayer If crs == null, it will call getGeoObject()
 Translation getDesc()
           
 Envelope getEnvelope()
           
 FeatureCollection getFeatureCollection()
          Returns the features of the FeatureSource.
 FeatureSource getFeatureSource()
          Same as getGeoObject() method, but complies to the StyledFeaturesInterface
 FeatureSource getGeoObject()
          Returns the underlying GeoTools Object
 String getId()
           
 ImageIcon getImageIcon()
           
 URL getInfoURL()
          Returns the URL to a (HTML) file that provides more information about this layer.
 Translation getKeywords()
           
 File getSldFile()
           
 Style getStyle()
           
 Translation getTitle()
           
 boolean isDisposed()
          Is the object already disposed?
 void setDesc(Translation dec)
          Killed by SK: 6.
 void setImageIcon(ImageIcon icon)
           
 void setKeywords(Translation keywords)
           
 void setSldFile(File sldFile)
           
 void setStyle(Style style)
           
 void setTitle(Translation title)
           
 void uncache()
          Clears any caches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyledFS

public StyledFS(FeatureSource fs,
                File sldFile)
This class enables a non Atlas context to use the Atlas LayerPanel JPanel as a MapContextManagerInterface

Parameters:
fs - FeatureSource that is beeing styled.
sldFile - may be null. Otherwise the SLD File to import and associate with this StyledFS
Method Detail

dispose

public void dispose()
Description copied from interface: StyledLayerInterface
Should be called when this Object is not needed anymore.

Specified by:
dispose in interface StyledLayerInterface<FeatureSource>

getCRSString

public String getCRSString()
Returnes human readable String of the CRS natively used by this DpLayer If crs == null, it will call getGeoObject()

Specified by:
getCRSString in interface StyledLayerInterface<FeatureSource>

getCrs

public CoordinateReferenceSystem getCrs()
Specified by:
getCrs in interface StyledLayerInterface<FeatureSource>

getDesc

public Translation getDesc()
Specified by:
getDesc in interface StyledLayerInterface<FeatureSource>

getEnvelope

public Envelope getEnvelope()
Specified by:
getEnvelope in interface StyledLayerInterface<FeatureSource>

getGeoObject

public FeatureSource getGeoObject()
Description copied from interface: StyledLayerInterface
Returns the underlying GeoTools Object

Specified by:
getGeoObject in interface StyledLayerInterface<FeatureSource>

getId

public String getId()
Specified by:
getId in interface StyledLayerInterface<FeatureSource>

getImageIcon

public ImageIcon getImageIcon()
Specified by:
getImageIcon in interface StyledLayerInterface<FeatureSource>
Returns:
return an ImageIcon - null is valid and no icon or a default icon will then be shown

getInfoURL

public URL getInfoURL()
Description copied from interface: StyledLayerInterface
Returns the URL to a (HTML) file that provides more information about this layer. If no HTML if associated with this StyledLayerInterface, then null will be returned.

Specified by:
getInfoURL in interface StyledLayerInterface<FeatureSource>
Returns:
null or an URL

getKeywords

public Translation getKeywords()
Specified by:
getKeywords in interface StyledLayerInterface<FeatureSource>

getStyle

public Style getStyle()
Specified by:
getStyle in interface StyledLayerInterface<FeatureSource>

getTitle

public Translation getTitle()
Specified by:
getTitle in interface StyledLayerInterface<FeatureSource>

isDisposed

public boolean isDisposed()
Description copied from interface: StyledLayerInterface
Is the object already disposed? *

Specified by:
isDisposed in interface StyledLayerInterface<FeatureSource>

setDesc

public void setDesc(Translation dec)
Killed by SK: 6. April 09: Ein Layer soll nicht generell auf verstecken/nicht verstecken gestellt werden können. Das sind Eigenschaften der Karte/MapContext, ebenso wie die Reihenfolge der Layer. Im Atlas verwaltet deshalb nun die Klasse skrueger.atlas.Map welche Layer nicht in der Legende auftauchen sollen. Meines Wissens hat keiner bisher die Funktion genutzt. // public boolean isHideInLegend() { // return false; // }

Specified by:
setDesc in interface StyledLayerInterface<FeatureSource>

setImageIcon

public void setImageIcon(ImageIcon icon)
Specified by:
setImageIcon in interface StyledLayerInterface<FeatureSource>

setKeywords

public void setKeywords(Translation keywords)
Specified by:
setKeywords in interface StyledLayerInterface<FeatureSource>

setStyle

public void setStyle(Style style)
Specified by:
setStyle in interface StyledLayerInterface<FeatureSource>

setTitle

public void setTitle(Translation title)
Specified by:
setTitle in interface StyledLayerInterface<FeatureSource>

uncache

public void uncache()
Description copied from interface: StyledLayerInterface
Clears any caches. For example the GeoObject could be released, and reread on next call of getGeoObject()

Specified by:
uncache in interface StyledLayerInterface<FeatureSource>

getAttributeMetaDataMap

public Map<Integer,AttributeMetaData> getAttributeMetaDataMap()
Specified by:
getAttributeMetaDataMap in interface StyledFeaturesInterface<FeatureSource>

getSldFile

public File getSldFile()
Returns:
The File where the SLD was loaded from or null if there didn't exist a File.

setSldFile

public void setSldFile(File sldFile)

getFeatureCollection

public FeatureCollection getFeatureCollection()
Returns the features of the FeatureSource.

Specified by:
getFeatureCollection in interface StyledFeaturesInterface<FeatureSource>
Returns:
The features of this layer as a FeatureCollection.
See Also:
StyledFeaturesInterface}

getFeatureSource

public FeatureSource getFeatureSource()
Same as getGeoObject() method, but complies to the StyledFeaturesInterface

Specified by:
getFeatureSource in interface StyledFeaturesInterface<FeatureSource>
Returns:
The features of this layer as a FeatureSource.
See Also:
StyledFeaturesInterface}