Package noaa.coastwatch.render
Class OverlayGroupManager
java.lang.Object
noaa.coastwatch.render.OverlayGroupManager
The
OverlayGroupManager
class can be used to save,
load, delete, and get a list of overlay groups. Bitmask overlays
need special treatment in order to correctly restore the data
source used for bitmask data. The setDataSource(noaa.coastwatch.io.EarthDataReader, java.util.List<java.lang.String>)
method
should be called to set the bitmask data source prior to loading
any overlay groups that contain bitmask overlays.- Since:
- 3.1.7
- Author:
- Peter Hollemans
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOverlayGroupManager
(File groupDir) Creates a new manager to handle overlay groups in the specified directory. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener for changes to the group list.void
deleteGroup
(String group) Deletes the specified group.Gets the list of group names available.Loads the specified group of overlays.void
Removes a listener for changes to the group list.void
saveGroup
(List<EarthDataOverlay> group, String name) Saves the specified overlay group.void
setDataSource
(EarthDataReader reader, List<String> variableList) Sets the data source for bitmask grid data.void
Signals all listeners that the overlay groups have changed.
-
Field Details
-
OVERLAY_GROUPS_PROPERTY
The overlay groups property.- See Also:
-
-
Constructor Details
-
OverlayGroupManager
Creates a new manager to handle overlay groups in the specified directory.- Parameters:
groupDir
- the group directory used to perform all group-related operations.
-
-
Method Details
-
setDataSource
Sets the data source for bitmask grid data.- Parameters:
reader
- the reader to use for data variables.variableList
- the list of allowed data variable names.
-
addPropertyChangeListener
Adds a listener for changes to the group list.- Parameters:
listener
- the listener to add to the list.
-
removePropertyChangeListener
Removes a listener for changes to the group list.- Parameters:
listener
- the listener to remove from the list.
-
getGroups
Gets the list of group names available. -
loadGroup
Loads the specified group of overlays.- Parameters:
group
- the group name, which must be a valid name obtained from thegetGroups()
method.- Returns:
- the list of overlays in the group.
- Throws:
IOException
- if an error occurred reading the group file.
-
saveGroup
Saves the specified overlay group.- Parameters:
group
- the overlay group to save.name
- the group name. This is the name that may be used later to retrieve the group.- Throws:
IOException
- if an error occurred writing the group file.
-
deleteGroup
Deletes the specified group. A subsequent call togetGroups()
will not include thie specified name in the list.- Throws:
IOException
- if an error occurred deleting the group file.
-
signalGroupsChanged
public void signalGroupsChanged()Signals all listeners that the overlay groups have changed. This is useful when some other class has changed the overlay groups and we need to force an update.- Since:
- 3.8.1
-