Package noaa.coastwatch.render.lines
Class EdgeSegment
java.lang.Object
noaa.coastwatch.render.lines.EdgeSegment
- All Implemented Interfaces:
Comparable<EdgeSegment>
The
EdgeSegment
class holds information about a
segment which is close to an image edge. The edge type,
distance, and segment points are stored.- Since:
- 3.3.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The types of edges possible for edge segments. -
Field Summary
Modifier and TypeFieldDescriptiondouble
The distance to the segment edge.The segment points.The segment edge type. -
Constructor Summary
ConstructorDescriptionEdgeSegment
(EdgeSegment.EdgeType type, Dimension imageDims, Line2D line) Creates a new edge segment from the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(EdgeSegment edge) Gets a label for this edge segment using the specified text.void
orient()
Orients this edge segment with respect to its edge.
-
Field Details
-
type
The segment edge type. -
dist
public double distThe distance to the segment edge. -
line
The segment points.
-
-
Constructor Details
-
EdgeSegment
Creates a new edge segment from the specified parameters. The distance to the edge is calculated.- Parameters:
type
- the segment type.imageDims
- the image dimensions.line
- the segment line.
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<EdgeSegment>
-
orient
public void orient()Orients this edge segment with respect to its edge. The edge segment points are rearranged so that this edge segment starts at its edge and ends towards the center of the image. -
getLabel
Gets a label for this edge segment using the specified text.- Parameters:
text
- the text string for the label, or null if the label is not valid.
-