skrueger.geotools
Class StyledFS

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

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 TODO Rename to StyledShapefile

Constructor Summary
StyledFS( fs)
           
StyledFS( 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.
 AttributeMetadataMap getAttributeMetaDataMap()
           
 CoordinateReferenceSystem getCrs()
           
 String getCRSString()
          Returns human readable String of the CRS natively used by this DpLayer If CRS == null, it will call getGeoObject()
 Translation getDesc()
           
 Envelope getEnvelope()
           
  getFeatureCollection()
          Returns the features of the FeatureSource.
  getFeatureCollectionFiltered()
           
  getFeatureSource()
          Same as getGeoObject() method, but complies to the StyledFeaturesInterface
 Filter getFilter()
          Returns the Filter a filter that is associated with this StyledFeaturesInterface Never shall return null, but rather Filter.INCLUDE.
  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()
           
 SimpleFeatureType getSchema()
           
 File getSldFile()
           
 Style getStyle()
           
 Translation getTitle()
           
 boolean isDisposed()
          Is the object already disposed?
 void setDesc(Translation dec)
          Killed by SK: 6.
 void setFilter(Filter filter)
          Stores Filter that is NOT automatically applied.
 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( 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

StyledFS

public StyledFS( fs)
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<>

getCRSString

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

Specified by:
getCRSString in interface StyledLayerInterface<>

getCrs

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

getDesc

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

getEnvelope

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

getGeoObject

public  getGeoObject()
Description copied from interface: StyledFeaturesInterface
Returns the underlying GeoTools Object. The filter is NOT applied.

Specified by:
getGeoObject in interface StyledFeaturesInterface<>
Specified by:
getGeoObject in interface StyledLayerInterface<>

getId

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

getImageIcon

public ImageIcon getImageIcon()
Specified by:
getImageIcon in interface StyledLayerInterface<>
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<>
Returns:
null or an URL

getKeywords

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

getStyle

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

getTitle

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

isDisposed

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

Specified by:
isDisposed in interface StyledLayerInterface<>

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<>

setImageIcon

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

setKeywords

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

setStyle

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

setTitle

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

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<>

getAttributeMetaDataMap

public AttributeMetadataMap getAttributeMetaDataMap()
Specified by:
getAttributeMetaDataMap in interface StyledFeaturesInterface<>

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  getFeatureCollection()
Returns the features of the FeatureSource.

Specified by:
getFeatureCollection in interface StyledFeaturesInterface<>
Returns:
The features of this layer as a FeatureCollection. The filter is NOT automatically applied.
See Also:
StyledFeaturesInterface}

getFeatureSource

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

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

getFeatureCollectionFiltered

public  getFeatureCollectionFiltered()
Specified by:
getFeatureCollectionFiltered in interface StyledFeaturesInterface<>
Returns:
The features of this layer as a FeatureCollection. The associated Filter is automatically applied.

getFilter

public Filter getFilter()
Description copied from interface: StyledFeaturesInterface
Returns the Filter a filter that is associated with this StyledFeaturesInterface Never shall return null, but rather Filter.INCLUDE.

Specified by:
getFilter in interface StyledFeaturesInterface<>

setFilter

public void setFilter(Filter filter)
Description copied from interface: StyledFeaturesInterface
Stores Filter that is NOT automatically applied. null is not allowed, use Filter.INCLUDE.

Specified by:
setFilter in interface StyledFeaturesInterface<>

getSchema

public SimpleFeatureType getSchema()
Specified by:
getSchema in interface StyledFeaturesInterface<>
Returns:
As the fastest way to get the Schema is depending on the underlying geoObject (FeatureSource or FeatureCollection), this method shall be implemented in the classes.