Class SldTemplateStyleCatalogue
- java.lang.Object
 - 
- uk.ac.rdg.resc.edal.graphics.utils.SldTemplateStyleCatalogue
 
 
- 
- All Implemented Interfaces:
 StyleCatalogue
public class SldTemplateStyleCatalogue extends Object implements StyleCatalogue
An implementation of aStyleCataloguewhich is based on having resources containing Xml templates of SLD documents. This uses the singleton pattern and the object is obtained withgetStyleCatalogue()- Author:
 - Guy Griffiths
 
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStylesInDirectory(File stylesDir)Adds an external directory containing styles.MapImagegetMapImageFromStyle(String styleName, PlottingStyleParameters templateProperties, VariableMetadata metadata, LayerNameMapper layerNameMapper)Returns a concreteMapImagefor a given styleList<String>getScaledRoleForStyle(String styleName)static SldTemplateStyleCataloguegetStyleCatalogue()Collection<String>getSupportedStyles(VariableMetadata variableMetadata, LayerNameMapper layerNameMapper)Gets the supported styles for a given variablestatic voidmain(String[] args)booleanstyleUsesPalette(String styleName) 
 - 
 
- 
- 
Method Detail
- 
getStyleCatalogue
public static SldTemplateStyleCatalogue getStyleCatalogue()
- Returns:
 - An instance of the 
SldTemplateStyleCatalogue 
 
- 
main
public static void main(String[] args)
 
- 
getSupportedStyles
public Collection<String> getSupportedStyles(VariableMetadata variableMetadata, LayerNameMapper layerNameMapper)
Description copied from interface:StyleCatalogueGets the supported styles for a given variable- Specified by:
 getSupportedStylesin interfaceStyleCatalogue- Parameters:
 variableMetadata- TheVariableMetadataof the variable to get styles forlayerNameMapper- TheLayerNameMapperused to map layer names to dataset/variable pairs.- Returns:
 - A 
Listof the supported style names for this variable 
 
- 
styleUsesPalette
public boolean styleUsesPalette(String styleName)
- Specified by:
 styleUsesPalettein interfaceStyleCatalogue- Parameters:
 styleName- The style name to test- Returns:
 trueif this style needs a colour palette
 
- 
getScaledRoleForStyle
public List<String> getScaledRoleForStyle(String styleName)
- Specified by:
 getScaledRoleForStylein interfaceStyleCatalogue- Parameters:
 styleName- The style name to test- Returns:
 - The role which the scale range applies to. This is:
 
         
nullif no scaling takes place- An empty string if the named layer is scaled
 - The child role which scaling is applied to TODO DOCUMENT MULTIPLE ROLES CASE
  
 
- 
getMapImageFromStyle
public MapImage getMapImageFromStyle(String styleName, PlottingStyleParameters templateProperties, VariableMetadata metadata, LayerNameMapper layerNameMapper)
Description copied from interface:StyleCatalogueReturns a concreteMapImagefor a given style- Specified by:
 getMapImageFromStylein interfaceStyleCatalogue- Parameters:
 styleName- The name of the styletemplateProperties- The properties which should be injected into the style template. None of the methods in this object may returnnullmetadata- TheVariableMetadataof the variable being plotted. In the case that multiple variables are used for a single plot, this should be the parentVariableMetadataof all required variableslayerNameMapper- The associatedLayerNameMapper. This is used to turnVariableMetadataobjects into concrete layer names for the style template- Returns:
 - A 
MapImage, ready to generate images 
 
- 
addStylesInDirectory
public void addStylesInDirectory(File stylesDir) throws FileNotFoundException
Adds an external directory containing styles.- Parameters:
 stylesDir- The location of the directory to add.- Throws:
 FileNotFoundException- If the supplied path is not a directory
 
 - 
 
 -