public class PolygonFeature extends LineFeature
PolygonFeature
class is a LineFeature
with
extra properties and rendering algorithms specific to polygons.
Polygons are rendered as filled where as lines are rendered as a
series of segments only. Polygons have an inherent winding
direction which may be used to determine what is inside the polygon
and what is outside. The winding direction is not used by the
rendering algorithm, but rather is a convenience for the user so
that polygons of different winding directions may be grouped
together but treated differently depending on their direction.Modifier and Type | Field and Description |
---|---|
static int |
CLOCKWISE
The clockwise winding direction.
|
static int |
COUNTER_CLOCKWISE
The counter-clockwise winding direction.
|
fastMode, lastDiscontinuous, lastPath, lastTrans, points
Constructor and Description |
---|
PolygonFeature(int direction)
Creates a new empty polygon feature with no attributes.
|
PolygonFeature(int direction,
java.lang.Object[] attributeArray)
Creates a new empty polygon feature with attributes.
|
Modifier and Type | Method and Description |
---|---|
int |
getDirection()
Gets the winding direction.
|
void |
render(java.awt.Graphics2D g,
EarthImageTransform trans)
Renders this polygon feature to a graphics context.
|
void |
renderOutline(java.awt.Graphics2D g,
EarthImageTransform trans)
Renders the outline of this polygon feature to a graphics
context.
|
filter, getFastMode, getPath, isDiscontinuous, setFastMode, transform
add, addAll, equals, get, getAttribute, getAttributeCount, hashCode, iterator, remove, setAttributes, size
public static final int CLOCKWISE
public static final int COUNTER_CLOCKWISE
public PolygonFeature(int direction)
direction
- the winding direction, either clockwise or
counter-clockwise.public PolygonFeature(int direction, java.lang.Object[] attributeArray)
direction
- the winding direction, either clockwise or
counter-clockwise.attributeArray
- the array of feature attributes.public int getDirection()
public void renderOutline(java.awt.Graphics2D g, EarthImageTransform trans)
LineFeature.render(java.awt.Graphics2D, noaa.coastwatch.render.EarthImageTransform)
method.g
- the graphics context for drawing.trans
- the earth image transform for converting Earth
locations to image points.public void render(java.awt.Graphics2D g, EarthImageTransform trans)
render
in class LineFeature
g
- the graphics context for drawing.trans
- the earth image transform for converting Earth
locations to image points.