skrueger.geotools
Class StyledGridCoverage

java.lang.Object
  extended by skrueger.geotools.AbstractStyledLayer<GridCoverage2D>
      extended by skrueger.geotools.StyledGridCoverage
All Implemented Interfaces:
StyledGridCoverageInterface, StyledLayerInterface<GridCoverage2D>, StyledRasterInterface<GridCoverage2D>

public class StyledGridCoverage
extends AbstractStyledLayer<GridCoverage2D>
implements StyledGridCoverageInterface

This class provides a simple implementation of StyledLayerInterface for GridCoverage2D. The uncache functionality is not supported, because this class bases on an existing GridCoverage2D object in memory.

Version:
1.0
Author:
Martin Schmitz (University of Bonn/Germany)

Field Summary
protected  RasterLegendData legendData
          Holds the meta data for displaying a legend.
 
Fields inherited from class skrueger.geotools.AbstractStyledLayer
crs, desc, envelope, geoObject, icon, id, keywords, LOGGER, style, title
 
Constructor Summary
StyledGridCoverage(GridCoverage2D gc, String id, String title, String desc, String keywords, StyledLayerStyle<RasterLegendData> style, ImageIcon icon)
          Creates a styled grid with non-translated informations.
StyledGridCoverage(GridCoverage2D gc, String id, String title, String desc, String keywords, Style style, RasterLegendData legendData, ImageIcon icon)
          Creates a styled grid with non-translated informations.
StyledGridCoverage(GridCoverage2D gc, String id, String title, StyledLayerStyle<RasterLegendData> style)
          Creates a styled grid with a non-translated title, no long description, no keywords and no icon.
StyledGridCoverage(GridCoverage2D gc, String id, String title, Style style, RasterLegendData legendData)
          Creates a styled grid with a non-translated title, no long description, no keywords and no icon.
StyledGridCoverage(GridCoverage2D gc, String id, Translation title, Style style, RasterLegendData legendData)
          Creates a styled grid with a language-specific title, no long description, no keywords and no icon.
StyledGridCoverage(GridCoverage2D gc, String id, Translation title, Translation desc, Translation keywords, StyledLayerStyle<RasterLegendData> style, ImageIcon icon)
          Creates a styled grid with language-specific informations.
StyledGridCoverage(GridCoverage2D gc, String id, Translation title, Translation desc, Translation keywords, Style style, RasterLegendData legendData, ImageIcon icon)
          Creates a styled grid with language-specific informations.
 
Method Summary
protected  Style createDefaultStyle()
          Creates a default style for a GridCoverage2D.
 void dispose()
          Simply sets the AbstractStyledLayer.geoObject, AbstractStyledLayer.crs, AbstractStyledLayer.envelope and legendData to null.
 URL getInfoURL()
          Returns the URL to a (HTML) file that provides more information about this layer.
 RasterLegendData getLegendMetaData()
          Returns the meta data needed for displaying a legend.
 boolean isDisposed()
          Tests whether the geo object is disposed.
 void setLegendMetaData(RasterLegendData legendData)
          Sets the meta data needed for displaying a legend.
 void uncache()
          Does nothing, because the AbstractStyledLayer bases on existing objects (in memory) which can not be uncached and reloaded.
 
Methods inherited from class skrueger.geotools.AbstractStyledLayer
getCrs, getCRSString, getDesc, getEnvelope, getGeoObject, getId, getImageIcon, getKeywords, getStyle, getTitle, setDesc, setDesc, setImageIcon, setKeywords, setKeywords, setStyle, setTitle, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface skrueger.geotools.StyledLayerInterface
getCrs, getCRSString, getDesc, getEnvelope, getGeoObject, getId, getImageIcon, getKeywords, getStyle, getTitle, setDesc, setImageIcon, setKeywords, setStyle, setTitle
 

Field Detail

legendData

protected RasterLegendData legendData
Holds the meta data for displaying a legend.

Constructor Detail

StyledGridCoverage

public StyledGridCoverage(GridCoverage2D gc,
                          String id,
                          Translation title,
                          Translation desc,
                          Translation keywords,
                          Style style,
                          RasterLegendData legendData,
                          ImageIcon icon)
Creates a styled grid with language-specific informations.

Parameters:
gc - the grid
id - a unique ID for the object
title - a (language-specific) short description
desc - a (language-specific) long description
keywords - (language-specific) keywords for the geo objects
style - a display style (if null, a default style is created)
legendData - meta data for displaying a legend
icon - an icon for the object (can be null)
Throws:
IllegalArgumentException - if null is given as ID or geo object

StyledGridCoverage

public StyledGridCoverage(GridCoverage2D gc,
                          String id,
                          Translation title,
                          Translation desc,
                          Translation keywords,
                          StyledLayerStyle<RasterLegendData> style,
                          ImageIcon icon)
Creates a styled grid with language-specific informations.

Parameters:
gc - the grid
id - a unique ID for the object
title - a (language-specific) short description
desc - a (language-specific) long description
keywords - (language-specific) keywords for the geo objects
style - a display style with legend information
icon - an icon for the object (can be null)
Throws:
IllegalArgumentException - if null is given as ID or geo object

StyledGridCoverage

public StyledGridCoverage(GridCoverage2D gc,
                          String id,
                          Translation title,
                          Style style,
                          RasterLegendData legendData)
Creates a styled grid with a language-specific title, no long description, no keywords and no icon.

Parameters:
gc - the grid
id - a unique ID for the object
title - a short description
style - a display style (if null, a default style is created)
legendData - meta data for displaying a legend
Throws:
IllegalArgumentException - if null is given as ID or geo object

StyledGridCoverage

public StyledGridCoverage(GridCoverage2D gc,
                          String id,
                          String title,
                          String desc,
                          String keywords,
                          Style style,
                          RasterLegendData legendData,
                          ImageIcon icon)
Creates a styled grid with non-translated informations.

Parameters:
gc - the grid
id - a unique ID for the object
title - a short description
desc - a long description
keywords - keywords for the geo objects
style - a display style (if null, a default style is created)
legendData - meta data for displaying a legend
icon - an icon for the object (can be null)
Throws:
IllegalArgumentException - if null is given as ID or geo object

StyledGridCoverage

public StyledGridCoverage(GridCoverage2D gc,
                          String id,
                          String title,
                          String desc,
                          String keywords,
                          StyledLayerStyle<RasterLegendData> style,
                          ImageIcon icon)
Creates a styled grid with non-translated informations.

Parameters:
gc - the grid
id - a unique ID for the object
title - a short description
desc - a long description
keywords - keywords for the geo objects
style - a display style with legend information
icon - an icon for the object (can be null)
Throws:
IllegalArgumentException - if null is given as ID or geo object

StyledGridCoverage

public StyledGridCoverage(GridCoverage2D gc,
                          String id,
                          String title,
                          Style style,
                          RasterLegendData legendData)
Creates a styled grid with a non-translated title, no long description, no keywords and no icon.

Parameters:
gc - the grid
id - a unique ID for the object
title - a short description
style - a display style (if null, a default style is created)
Throws:
IllegalArgumentException - if null is given as ID or geo object

StyledGridCoverage

public StyledGridCoverage(GridCoverage2D gc,
                          String id,
                          String title,
                          StyledLayerStyle<RasterLegendData> style)
Creates a styled grid with a non-translated title, no long description, no keywords and no icon.

Parameters:
gc - the grid
id - a unique ID for the object
title - a short description
style - a display style with legend information
Throws:
IllegalArgumentException - if null is given as ID or geo object
Method Detail

createDefaultStyle

protected Style createDefaultStyle()
Creates a default style for a GridCoverage2D.

Specified by:
createDefaultStyle in class AbstractStyledLayer<GridCoverage2D>
See Also:
GridUtil.createDefaultStyle()

getLegendMetaData

public RasterLegendData getLegendMetaData()
Returns the meta data needed for displaying a legend.

Specified by:
getLegendMetaData in interface StyledRasterInterface<GridCoverage2D>
Returns:
A RasterLegendData object with pairs of value / label information

setLegendMetaData

public void setLegendMetaData(RasterLegendData legendData)
Sets the meta data needed for displaying a legend. If legendData is null an empty RasterLegendData (without gaps) is set, so getLegendMetaData() never returns null.

Parameters:
legendData - legend meta data

dispose

public void dispose()
Simply sets the AbstractStyledLayer.geoObject, AbstractStyledLayer.crs, AbstractStyledLayer.envelope and legendData to null.

Specified by:
dispose in interface StyledLayerInterface<GridCoverage2D>

isDisposed

public boolean isDisposed()
Tests whether the geo object is disposed.

Specified by:
isDisposed in interface StyledLayerInterface<GridCoverage2D>
Returns:
boolean

uncache

public void uncache()
Does nothing, because the AbstractStyledLayer bases on existing objects (in memory) which can not be uncached and reloaded.

Specified by:
uncache in interface StyledLayerInterface<GridCoverage2D>

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<GridCoverage2D>
Returns:
null or an URL