public class CoastOverlay extends PolygonOverlay
CoastOverlay
annotates an earth data view with
coast lines and polygons. The coast lines are rendered using
GSHHS coast line vector data (see BinnedGSHHSReader
and BinnedGSHHSReaderFactory
). The resolution of the
rendered earth vector data is based on the view resolution at
the time of rendering. The resolution of the view is taken to
be the number of kilometers per pixel at the view center
point. In order to help reduce the rendering time and keep
the view clear of unwanted coast line "dust", by default small
polygons such as the coasts of islands and lakes enclosing
less than 3x3 pixels are not rendered.The overlay color and fill color are used to determine if coast lines and/or polygons should be rendered. If the overlay color is set to null, the coast lines are not rendered. Likewise if the fill color is set to null, land polygons are not rendered. By default the fill color is set to null.
The default reader factory for coastline data is a standard BinnedGSHHSReaderFactory
unless the setReaderFactory(noaa.coastwatch.render.feature.BinnedGSHHSReaderFactory)
method
is called.
drawingShadow
alpha, lastTrans, prepared
Constructor and Description |
---|
CoastOverlay(java.awt.Color color)
Constructs a new coast overlay.
|
CoastOverlay(java.awt.Color color,
int layer,
java.awt.Stroke stroke,
java.awt.Color fillColor)
Constructs a new coast overlay.
|
Modifier and Type | Method and Description |
---|---|
protected void |
draw(java.awt.Graphics2D g,
EarthDataView view)
Draws the overlay graphics.
|
boolean |
getSmallPolygons()
Gets the small polygons flag.
|
protected void |
prepare(java.awt.Graphics2D g,
EarthDataView view)
Prepares the overlay graphics prior to drawing.
|
void |
setFillColor(java.awt.Color newColor)
Sets the polygon fill color.
|
void |
setReaderFactory(BinnedGSHHSReaderFactory factory)
Sets the read factory for new coastline readers.
|
void |
setSmallPolygons(boolean flag)
Sets the small polygons flag which determines if polygons smaller
than 3x3 view pixels are rendered.
|
getColors, getFillColor, getFillColorWithAlpha
clip, drawShadow, getDropShadow, getShadowColor, getStroke, render, setDropShadow, setStroke
clone, compareTo, getAlphaVersion, getColor, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, invalidate, isPrepared, needsPrepare, setColor, setLayer, setName, setTransparency, setVisible
public CoastOverlay(java.awt.Color color, int layer, java.awt.Stroke stroke, java.awt.Color fillColor)
color
- the overlay color.layer
- the overlay layer number.stroke
- the stroke to use for vector paths.fillColor
- the fill color to use for polygon fills.public CoastOverlay(java.awt.Color color)
BasicStroke
, and the
fill color to null.color
- the overlay color.public void setReaderFactory(BinnedGSHHSReaderFactory factory)
public void setSmallPolygons(boolean flag)
public boolean getSmallPolygons()
public void setFillColor(java.awt.Color newColor)
setFillColor
in class PolygonOverlay
newColor
- the new opaque polygon fill color, or null to
perform no filling.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.