Package noaa.coastwatch.tools
Class Preferences
java.lang.Object
noaa.coastwatch.tools.Preferences
- All Implemented Interfaces:
Cloneable
The
Preferences
class handles preferences set by the
user for CoastWatch tool operations.- Since:
- 3.1.7
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionCreates a new empty set of preferences.Preferences
(InputStream input) Creates a new preferences object by parsing the specified XML input. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this object.int
Gets the tile cache size in megabytes.boolean
Gets the earth location in decimal degrees flag.getEnhancement
(String variableName) Gets the enhancement settings for the specified variable.Gets the enhancement setting variable names.int
Gets the heap size in megabytes.getLogo()
Gets the legend logo.Gets the preferred units for a variable.Gets the map of variable name to units.void
removeEnhancement
(String variableName) Removes the specified enhancement settings from the preferences.void
removeUnits
(String varName) Removes the preferred units for a variable.void
setCacheSize
(int cacheSize) Sets the tile cache size in megabytes.void
setEarthLocDegrees
(boolean flag) Sets the earth location in decimal degrees flag.void
setEnhancement
(ColorEnhancementSettings settings) Adds new enhancement settings to the preferences.void
setHeapSize
(int heapSize) Sets the heap size in megabytes.void
Sets the legend logo.void
Sets the preferred units for a variable.void
write
(OutputStream output) Writes this set of preferences to the specified output stream in an XML format.void
writeOptions
(OutputStream output) Writes the set of options to the specified output stream.
-
Constructor Details
-
Preferences
public Preferences()Creates a new empty set of preferences. -
Preferences
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
Gets the legend logo.- Since:
- 3.8.1
-
setLogo
Sets the legend logo.- Parameters:
logo
- the new logo to use.- Since:
- 3.8.1
-
getUnitsMap
Gets the map of variable name to units. -
setUnits
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
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
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
Creates and returns a copy of this object. -
getEnhancementVariables
Gets the enhancement setting variable names.- Returns:
- a list of variable names.
-
getEnhancement
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
Adds new enhancement settings to the preferences.- Parameters:
settings
- the new enhancement settings to add.
-
removeEnhancement
Removes the specified enhancement settings from the preferences.- Parameters:
variableName
- the enhancement settings variable to remove.
-
writeOptions
Writes the set of options to the specified output stream.- Parameters:
output
- the output stream to write.- Since:
- 3.3.1
-
write
Writes this set of preferences to the specified output stream in an XML format.- Parameters:
output
- the output stream to write.
-