Package noaa.coastwatch.render.feature
Class PolygonFeatureSource
java.lang.Object
noaa.coastwatch.render.feature.AbstractFeatureSource
noaa.coastwatch.render.feature.LineFeatureSource
noaa.coastwatch.render.feature.PolygonFeatureSource
- All Implemented Interfaces:
Iterable<Feature>
,FeatureSource
- Direct Known Subclasses:
BinnedGSHHSReader
The
PolygonFeatureSource
extends the
LineFeatureSource
class to render filled polygons as
well as lines. Polygon features are maintained in a separate list,
so that line features and polygon features may be rendered
independently.- Since:
- 3.1.4
- Author:
- Peter Hollemans
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<PolygonFeature>
The currently selected list of polygon features.Fields inherited from class noaa.coastwatch.render.feature.AbstractFeatureSource
area, featureList
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new source with an empty list of polygons. -
Method Summary
Modifier and TypeMethodDescriptionvoid
renderOutlines
(Graphics2D g, EarthImageTransform trans) Renders the selected polygon data to a graphics context as just the polygon outlines.void
renderPolygons
(Graphics2D g, EarthImageTransform trans) Renders the selected polygon data to a graphics context.Methods inherited from class noaa.coastwatch.render.feature.LineFeatureSource
render
Methods inherited from class noaa.coastwatch.render.feature.AbstractFeatureSource
getArea, getAttributeCount, getAttributeNameMap, getAttributes, getFilter, iterator, select, select, setAttributes, setFilter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
polygonList
The currently selected list of polygon features.
-
-
Constructor Details
-
PolygonFeatureSource
protected PolygonFeatureSource()Creates a new source with an empty list of polygons.
-
-
Method Details
-
renderPolygons
Renders the selected polygon data to a graphics context. This method differs from theLineFeatureSource.render(java.awt.Graphics2D, noaa.coastwatch.render.EarthImageTransform)
method in three ways:- Groups of polygons are rendered as a batch using a non-zero
winding rule (see the
PathIterator
class for details). This is done so that hierarchical levels of polygons (polygons contained within other polygons) whose winding orders are different are rendered correctly. - Groups of polygons that should be rendered as a batch are separated by a polygon of length zero.
- Polygons that are detected to be discontinuous are not rendered, and all polygons in their group are also ignored. This helps to avoid strange polygon rendering results.
- Parameters:
g
- the graphics context for drawing.trans
- the earth image transform for converting earth locations to image points.
- Groups of polygons are rendered as a batch using a non-zero
winding rule (see the
-
renderOutlines
Renders the selected polygon data to a graphics context as just the polygon outlines.- Parameters:
g
- the graphics context for drawing.trans
- the earth image transform for converting earth locations to image points.
-