Package noaa.coastwatch.render.feature
Class LineFeature
java.lang.Object
noaa.coastwatch.render.feature.AbstractFeature
noaa.coastwatch.render.feature.LineFeature
- All Implemented Interfaces:
Iterable<EarthLocation>
,Feature
- Direct Known Subclasses:
PolygonFeature
The
LineFeature
class holds a list of earth location
data. Various methods are provided for converting from lines of
earth location data to projected image data.- Since:
- 3.1.1
- Author:
- Peter Hollemans
-
Field Summary
Modifier and TypeFieldDescriptionprotected static boolean
The fast mode flag.protected boolean
The last discontinuous status.protected GeneralPath
The last transformed path.protected EarthImageTransform
The last earth image transform.Fields inherited from class noaa.coastwatch.render.feature.AbstractFeature
points
-
Constructor Summary
ConstructorDescriptionCreates a new empty line feature with no attributes.LineFeature
(Object[] attributeArray) Creates a new empty line feature with attributes. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.static boolean
Gets the fast rendering mode flag.getPath
(EarthImageTransform trans) Gets the general path for this feature under the specified transform.boolean
Gets the discontinuous flag from the last call togetPath(noaa.coastwatch.render.EarthImageTransform)
ortransform(noaa.coastwatch.render.EarthImageTransform)
.void
render
(Graphics2D g, EarthImageTransform trans) Renders this feature to a graphics context.static void
setFastMode
(boolean flag) Sets the fast rendering mode flag.transform
(EarthImageTransform imageTrans) Transforms this line feature to a path.Methods inherited from class noaa.coastwatch.render.feature.AbstractFeature
add, addAll, equals, get, getAttribute, getAttributeCount, hashCode, iterator, remove, setAttributes, size
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
lastPath
The last transformed path. -
lastTrans
The last earth image transform. -
lastDiscontinuous
protected boolean lastDiscontinuousThe last discontinuous status. -
fastMode
protected static boolean fastModeThe fast mode flag.
-
-
Constructor Details
-
LineFeature
public LineFeature()Creates a new empty line feature with no attributes. -
LineFeature
Creates a new empty line feature with attributes.- Parameters:
attributeArray
- the array of feature attributes.
-
-
Method Details
-
isDiscontinuous
public boolean isDiscontinuous()Gets the discontinuous flag from the last call togetPath(noaa.coastwatch.render.EarthImageTransform)
ortransform(noaa.coastwatch.render.EarthImageTransform)
.- Returns:
- the discontinuous flag, true if this line feature was discontinuous
during the last transformation from the set of
EarthLocation
points to aGeneralPath
or false if not. When fast rendering mode is on (seesetFastMode(boolean)
), this method will always return false. If this line feature has never been transformed, this method will return false.
-
getFastMode
public static boolean getFastMode()Gets the fast rendering mode flag.- Returns:
- the fast mode flag, true if currently performing fast rendering or false if not.
- See Also:
-
setFastMode
public static void setFastMode(boolean flag) Sets the fast rendering mode flag. Under fast rendering mode, the line feature is not checked for discontinuities. By default, fast rendering mode is off.- Parameters:
flag
- the fast mode, true for fast rendering or false for not.- See Also:
-
filter
Deprecated.This method was used byGSHHSReader
but is no longer needed.Filters this feature based on an earth area. If the line segments leave and re-enter the specified earth area, they are split into multiple features. The resulting features are returned.- Parameters:
area
- the earth area to use for filtering earth locations.- Returns:
- the list of features resulting from the filter operation.
-
transform
Transforms this line feature to a path. TheEarthImageTransform
is used to eliminate any line segments which do not transform to valid image points.- Parameters:
imageTrans
- the transform for converting earth locations to image points.- Returns:
- the path that follows this feature's points in the transformed space.
-
getPath
Gets the general path for this feature under the specified transform.- Parameters:
trans
- the earth image transform for converting Earth locations to image points.- Returns:
- the general path corresponding to this feature.
-
render
Renders this feature to a graphics context.- Parameters:
g
- the graphics context for drawing.trans
- the earth image transform for converting Earth locations to image points.
-
GSHHSReader
but is no longer needed.