Class CoastOverlay
- All Implemented Interfaces:
Serializable,Cloneable,Comparable
A 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.
- Since:
- 3.1.1
- Author:
- Peter Hollemans
- See Also:
-
Field Summary
Fields inherited from class noaa.coastwatch.render.LineOverlay
drawingShadowFields inherited from class noaa.coastwatch.render.EarthDataOverlay
alpha, lastTrans, prepared -
Constructor Summary
ConstructorsConstructorDescriptionCoastOverlay(Color color) Constructs a new coast overlay.CoastOverlay(Color color, int layer, Stroke stroke, Color fillColor) Constructs a new coast overlay. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddraw(Graphics2D g, EarthDataView view) Draws the overlay graphics.booleanGets the small polygons flag.protected voidprepare(Graphics2D g, EarthDataView view) Prepares the overlay graphics prior to drawing.voidsetFillColor(Color newColor) Sets the polygon fill color.voidsetReaderFactory(BinnedGSHHSReaderFactory factory) Sets the read factory for new coastline readers.voidsetSmallPolygons(boolean flag) Sets the small polygons flag which determines if polygons smaller than 3x3 view pixels are rendered.Methods inherited from class noaa.coastwatch.render.PolygonOverlay
getColors, getFillColor, getFillColorWithAlphaMethods inherited from class noaa.coastwatch.render.LineOverlay
clip, drawShadow, getDropShadow, getShadowColor, getStroke, render, setDropShadow, setStrokeMethods inherited from class noaa.coastwatch.render.EarthDataOverlay
clone, compareTo, getAlphaVersion, getColor, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, invalidate, isPrepared, needsPrepare, setColor, setLayer, setName, setTransparency, setVisible, toString
-
Constructor Details
-
CoastOverlay
Constructs a new coast overlay.- Parameters:
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.
-
CoastOverlay
Constructs a new coast overlay. The layer number is initialized to 0, the stroke to the defaultBasicStroke, and the fill color to null.- Parameters:
color- the overlay color.
-
-
Method Details
-
setReaderFactory
Sets the read factory for new coastline readers. -
setSmallPolygons
public void setSmallPolygons(boolean flag) Sets the small polygons flag which determines if polygons smaller than 3x3 view pixels are rendered. By default small polygons are not rendered. -
getSmallPolygons
public boolean getSmallPolygons()Gets the small polygons flag. -
setFillColor
Sets the polygon fill color. This method overrides the parent to detect null/non-null changes in the polygon fill color.- Overrides:
setFillColorin classPolygonOverlay- Parameters:
newColor- the new opaque polygon fill color, or null to perform no filling.
-
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.
-