Class Preferences

java.lang.Object
noaa.coastwatch.tools.Preferences
All Implemented Interfaces:
Cloneable

public class Preferences extends Object implements Cloneable
The Preferences class handles preferences set by the user for CoastWatch tool operations.
Since:
3.1.7
Author:
Peter Hollemans
  • Constructor Details

    • Preferences

      public Preferences()
      Creates a new empty set of preferences.
    • Preferences

      public Preferences(InputStream input) throws IOException
      Creates a new preferences object by parsing the specified XML input.
      Parameters:
      input - the input XML stream to read.
      Throws:
      IOException - if the input had format errors.
  • Method Details

    • getLogo

      public String getLogo()
      Gets the legend logo.
      Since:
      3.8.1
    • setLogo

      public void setLogo(String logo)
      Sets the legend logo.
      Parameters:
      logo - the new logo to use.
      Since:
      3.8.1
    • getUnitsMap

      public Map getUnitsMap()
      Gets the map of variable name to units.
    • setUnits

      public void setUnits(String varName, String units)
      Sets the preferred units for a variable.
      Parameters:
      varName - the variable name to set units for.
      units - the new units string for the variable.
    • getUnits

      public String getUnits(String varName)
      Gets the preferred units for a variable.
      Parameters:
      varName - the variable name to get units for.
      Returns:
      the units string for the variable, or null if there are no preferred units.
    • removeUnits

      public void removeUnits(String varName)
      Removes the preferred units for a variable.
      Parameters:
      varName - the variable name to remove units for.
    • getEarthLocDegrees

      public boolean getEarthLocDegrees()
      Gets the earth location in decimal degrees flag.
    • setEarthLocDegrees

      public void setEarthLocDegrees(boolean flag)
      Sets the earth location in decimal degrees flag.
    • setHeapSize

      public void setHeapSize(int heapSize)
      Sets the heap size in megabytes.
    • getHeapSize

      public int getHeapSize()
      Gets the heap size in megabytes.
    • setCacheSize

      public void setCacheSize(int cacheSize)
      Sets the tile cache size in megabytes.
    • getCacheSize

      public int getCacheSize()
      Gets the tile cache size in megabytes.
    • clone

      public Object clone()
      Creates and returns a copy of this object.
      Overrides:
      clone in class Object
    • getEnhancementVariables

      public List getEnhancementVariables()
      Gets the enhancement setting variable names.
      Returns:
      a list of variable names.
    • getEnhancement

      public ColorEnhancementSettings getEnhancement(String variableName)
      Gets the enhancement settings for the specified variable.
      Parameters:
      variableName - the variable name for which to retrieve settings.
      Returns:
      the settings, or null if no settings could be found.
    • setEnhancement

      public void setEnhancement(ColorEnhancementSettings settings)
      Adds new enhancement settings to the preferences.
      Parameters:
      settings - the new enhancement settings to add.
    • removeEnhancement

      public void removeEnhancement(String variableName)
      Removes the specified enhancement settings from the preferences.
      Parameters:
      variableName - the enhancement settings variable to remove.
    • writeOptions

      public void writeOptions(OutputStream output)
      Writes the set of options to the specified output stream.
      Parameters:
      output - the output stream to write.
      Since:
      3.3.1
    • write

      public void write(OutputStream output)
      Writes this set of preferences to the specified output stream in an XML format.
      Parameters:
      output - the output stream to write.