public class MultilayerBitmaskOverlay extends EarthDataOverlay implements TransparentOverlay, GridContainerOverlay
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.alpha, lastTrans, prepared
Constructor and Description |
---|
MultilayerBitmaskOverlay()
Constructs a new complex bitmask overlay.
|
Modifier and Type | Method and Description |
---|---|
void |
addOverlay(BitmaskOverlay overlay)
Adds a new bit mask overlay to the list.
|
void |
addOverlays(java.util.List overlays)
Adds a list of overlays to the list.
|
void |
clearOverlays()
Clears the list of overlays.
|
java.lang.Object |
clone() |
protected void |
draw(java.awt.Graphics2D g,
EarthDataView view)
Draws the overlay graphics.
|
Grid |
getGrid()
Gets the active grid variable.
|
java.util.List<Grid> |
getGridList()
Gets the active list of grid variables.
|
java.lang.String |
getGridName()
Gets the grid variable name.
|
java.util.List |
getGridNameValues()
Gets the possible grid variable names.
|
java.util.List |
getOverlays()
Gets the current list of overlays.
|
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.
|
void |
invalidate()
Invalidates the overlay.
|
protected void |
prepare(java.awt.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,
java.util.List variableList)
Sets the data source for grid data.
|
void |
setGridName(java.lang.String name)
Sets the grid variable in each bitmask overlay based on the
name.
|
void |
updateBitmasks()
Updates the internal image buffers to reflect any changes made in
the bitmasks.
|
compareTo, getAlphaVersion, getColor, getColors, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, isPrepared, needsPrepare, render, setColor, setLayer, setName, setTransparency, setVisible
public MultilayerBitmaskOverlay()
public void setDataSource(EarthDataReader reader, java.util.List variableList)
setDataSource
in interface GridContainerOverlay
reader
- the reader to use for data variables.variableList
- the list of allowed data variable names.public EarthDataReader getReader()
public java.util.List getGridNameValues()
public java.lang.String getGridName()
public Grid getGrid()
public void setGridName(java.lang.String name)
public void clearOverlays()
public void addOverlays(java.util.List overlays)
public void addOverlay(BitmaskOverlay overlay)
public void removeOverlay(BitmaskOverlay overlay)
public java.util.List getOverlays()
public void updateBitmasks()
protected void prepare(java.awt.Graphics2D g, EarthDataView view)
EarthDataOverlay
prepare
in class EarthDataOverlay
g
- the graphics object for drawing.view
- the earth data view.protected void draw(java.awt.Graphics2D g, EarthDataView view)
EarthDataOverlay
draw
in class EarthDataOverlay
g
- the graphics object for drawing.view
- the earth data view.public java.lang.Object clone()
clone
in class EarthDataOverlay
public void invalidate()
render()
.invalidate
in class EarthDataOverlay
public java.util.List<Grid> getGridList()
GridContainerOverlay
getGridList
in interface GridContainerOverlay