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:
  • Constructor Details

    • MultilayerBitmaskOverlay

      public MultilayerBitmaskOverlay()
      Constructs a new complex bitmask overlay. The layer number is initialized to 0.
  • Method Details

    • setDataSource

      public void setDataSource(EarthDataReader reader, List variableList)
      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 interface GridContainerOverlay
      Parameters:
      reader - the reader to use for data variables.
      variableList - the list of allowed data variable names.
    • getReader

      public EarthDataReader 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

      public List getGridNameValues()
      Gets the possible grid variable names.
    • getGridName

      public String getGridName()
      Gets the grid variable name.
    • getGrid

      public Grid getGrid()
      Gets the active grid variable.
    • setGridName

      public void setGridName(String name)
      Sets the grid variable in each bitmask overlay based on the name.
    • clearOverlays

      public void clearOverlays()
      Clears the list of overlays.
    • addOverlays

      public void addOverlays(List overlays)
      Adds a list of overlays to the list.
    • addOverlay

      public void addOverlay(BitmaskOverlay overlay)
      Adds a new bit mask overlay to the list.
    • removeOverlay

      public void removeOverlay(BitmaskOverlay overlay)
      Removes an overlay from the list.
    • getOverlays

      public 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

      protected void prepare(Graphics2D g, EarthDataView view)
      Description copied from class: EarthDataOverlay
      Prepares the overlay graphics prior to drawing.
      Specified by:
      prepare in class EarthDataOverlay
      Parameters:
      g - the graphics object for drawing.
      view - the earth data view.
    • draw

      protected void draw(Graphics2D g, EarthDataView view)
      Description copied from class: EarthDataOverlay
      Draws the overlay graphics.
      Specified by:
      draw in class EarthDataOverlay
      Parameters:
      g - the graphics object for drawing.
      view - the earth data view.
    • clone

      public Object clone()
      Overrides:
      clone in class EarthDataOverlay
    • invalidate

      public void invalidate()
      Invalidates the overlay. This causes the bitmask graphics to be completely reconstructed upon the next call to render().
      Overrides:
      invalidate in class EarthDataOverlay
    • getGridList

      public List<Grid> getGridList()
      Description copied from interface: GridContainerOverlay
      Gets the active list of grid variables.
      Specified by:
      getGridList in interface GridContainerOverlay