Class EdgeSegment

java.lang.Object
noaa.coastwatch.render.lines.EdgeSegment
All Implemented Interfaces:
Comparable<EdgeSegment>

public class EdgeSegment extends Object implements 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
  • Field Details

    • type

      public EdgeSegment.EdgeType type
      The segment edge type.
    • dist

      public double dist
      The distance to the segment edge.
    • line

      public Line2D line
      The segment points.
  • Constructor Details

    • EdgeSegment

      public EdgeSegment(EdgeSegment.EdgeType type, Dimension imageDims, Line2D line)
      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

      public int compareTo(EdgeSegment edge)
      Specified by:
      compareTo in interface Comparable<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

      public TextElement getLabel(String text)
      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.