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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOverlay(BitmaskOverlay overlay) Adds a new bit mask overlay to the list.voidaddOverlays(List overlays) Adds a list of overlays to the list.voidClears the list of overlays.clone()protected voiddraw(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.voidInvalidates the overlay.protected voidprepare(Graphics2D g, EarthDataView view) Prepares the overlay graphics prior to drawing.voidremoveOverlay(BitmaskOverlay overlay) Removes an overlay from the list.voidsetDataSource(EarthDataReader reader, List variableList) Sets the data source for grid data.voidsetGridName(String name) Sets the grid variable in each bitmask overlay based on the name.voidUpdates 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:
setDataSourcein 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:EarthDataOverlayPrepares the overlay graphics prior to drawing.- Specified by:
preparein classEarthDataOverlay- Parameters:
g- the graphics object for drawing.view- the earth data view.
-
draw
Description copied from class:EarthDataOverlayDraws the overlay graphics.- Specified by:
drawin classEarthDataOverlay- Parameters:
g- the graphics object for drawing.view- the earth data view.
-
clone
- Overrides:
clonein classEarthDataOverlay
-
invalidate
public void invalidate()Invalidates the overlay. This causes the bitmask graphics to be completely reconstructed upon the next call torender().- Overrides:
invalidatein classEarthDataOverlay
-
getGridList
Description copied from interface:GridContainerOverlayGets the active list of grid variables.- Specified by:
getGridListin interfaceGridContainerOverlay
-