Package noaa.coastwatch.render
Class MultilayerBitmaskOverlay
java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.MultilayerBitmaskOverlay
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
,GridContainerOverlay
,TransparentOverlay
public class MultilayerBitmaskOverlay
extends EarthDataOverlay
implements TransparentOverlay, GridContainerOverlay
The
MultilayerBitmaskOverlay
class uses a set of
BitmaskOverlay
objects to colour subsets of bits in
the bit mask with different colors. The individual bit mask
overlay colors are used in rendering, but the main overlay color is
ignored. The layer values and visibility of each bit mask overlay
are also taken into account when rendering, but the inverse flag is
ignored. It is assumed that each BitmaskOverlay
object uses the same data grid variable.- Since:
- 3.1.7
- Author:
- Peter Hollemans
- See Also:
-
Field Summary
Fields inherited from class noaa.coastwatch.render.EarthDataOverlay
alpha, lastTrans, prepared
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOverlay
(BitmaskOverlay overlay) Adds a new bit mask overlay to the list.void
addOverlays
(List overlays) Adds a list of overlays to the list.void
Clears the list of overlays.clone()
protected void
draw
(Graphics2D g, EarthDataView view) Draws the overlay graphics.getGrid()
Gets the active grid variable.Gets the active list of grid variables.Gets the grid variable name.Gets the possible grid variable names.Gets the current list of overlays.Gets the reader used to fetch the data for the bitmasks, or null if no reader was explicitly given to the bitmask constructor.void
Invalidates the overlay.protected void
prepare
(Graphics2D g, EarthDataView view) Prepares the overlay graphics prior to drawing.void
removeOverlay
(BitmaskOverlay overlay) Removes an overlay from the list.void
setDataSource
(EarthDataReader reader, List variableList) Sets the data source for grid data.void
setGridName
(String name) Sets the grid variable in each bitmask overlay based on the name.void
Updates the internal image buffers to reflect any changes made in the bitmasks.Methods inherited from class noaa.coastwatch.render.EarthDataOverlay
compareTo, getAlphaVersion, getColor, getColors, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, isPrepared, needsPrepare, render, setColor, setLayer, setName, setTransparency, setVisible, toString
-
Constructor Details
-
MultilayerBitmaskOverlay
public MultilayerBitmaskOverlay()Constructs a new complex bitmask overlay. The layer number is initialized to 0.
-
-
Method Details
-
setDataSource
Sets the data source for grid data. The reader and variable list must contain a data grid with the current grid name.- Specified by:
setDataSource
in interfaceGridContainerOverlay
- Parameters:
reader
- the reader to use for data variables.variableList
- the list of allowed data variable names.
-
getReader
Gets the reader used to fetch the data for the bitmasks, or null if no reader was explicitly given to the bitmask constructor. -
getGridNameValues
Gets the possible grid variable names. -
getGridName
Gets the grid variable name. -
getGrid
Gets the active grid variable. -
setGridName
Sets the grid variable in each bitmask overlay based on the name. -
clearOverlays
public void clearOverlays()Clears the list of overlays. -
addOverlays
Adds a list of overlays to the list. -
addOverlay
Adds a new bit mask overlay to the list. -
removeOverlay
Removes an overlay from the list. -
getOverlays
Gets the current list of overlays. -
updateBitmasks
public void updateBitmasks()Updates the internal image buffers to reflect any changes made in the bitmasks. Currently, only color changes in the bitmasks are recognized. -
prepare
Description copied from class:EarthDataOverlay
Prepares the overlay graphics prior to drawing.- Specified by:
prepare
in classEarthDataOverlay
- Parameters:
g
- the graphics object for drawing.view
- the earth data view.
-
draw
Description copied from class:EarthDataOverlay
Draws the overlay graphics.- Specified by:
draw
in classEarthDataOverlay
- Parameters:
g
- the graphics object for drawing.view
- the earth data view.
-
clone
- Overrides:
clone
in classEarthDataOverlay
-
invalidate
public void invalidate()Invalidates the overlay. This causes the bitmask graphics to be completely reconstructed upon the next call torender()
.- Overrides:
invalidate
in classEarthDataOverlay
-
getGridList
Description copied from interface:GridContainerOverlay
Gets the active list of grid variables.- Specified by:
getGridList
in interfaceGridContainerOverlay
-