public class EdgeSegment extends java.lang.Object implements java.lang.Comparable<EdgeSegment>
EdgeSegment
class holds information about a
segment which is close to an image edge. The edge type,
distance, and segment points are stored.Modifier and Type | Class and Description |
---|---|
static class |
EdgeSegment.EdgeType
The types of edges possible for edge segments.
|
Modifier and Type | Field and Description |
---|---|
double |
dist
The distance to the segment edge.
|
java.awt.geom.Line2D |
line
The segment points.
|
EdgeSegment.EdgeType |
type
The segment edge type.
|
Constructor and Description |
---|
EdgeSegment(EdgeSegment.EdgeType type,
java.awt.Dimension imageDims,
java.awt.geom.Line2D line)
Creates a new edge segment from the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(EdgeSegment edge) |
TextElement |
getLabel(java.lang.String text)
Gets a label for this edge segment using the specified
text.
|
void |
orient()
Orients this edge segment with respect to its edge.
|
public EdgeSegment.EdgeType type
public double dist
public java.awt.geom.Line2D line
public EdgeSegment(EdgeSegment.EdgeType type, java.awt.Dimension imageDims, java.awt.geom.Line2D line)
type
- the segment type.imageDims
- the image dimensions.line
- the segment line.public int compareTo(EdgeSegment edge)
compareTo
in interface java.lang.Comparable<EdgeSegment>
public void orient()
public TextElement getLabel(java.lang.String text)
text
- the text string for the label, or null if the
label is not valid.