Class Line


  • public class Line
    extends Object
    Line between two points in meters
    Author:
    wnewman, osbornb
    • Constructor Detail

      • Line

        public Line​(Point point1,
                    Point point2)
        Constructor
        Parameters:
        point1 - first point
        point2 - second point
      • Line

        public Line​(Point point1,
                    Point point2,
                    GridType gridType)
        Constructor
        Parameters:
        point1 - first point
        point2 - second point
        gridType - line grid type
    • Method Detail

      • line

        public static Line line​(Point point1,
                                Point point2)
        Create a line
        Parameters:
        point1 - first point
        point2 - second point
        Returns:
        line
      • line

        public static Line line​(Point point1,
                                Point point2,
                                GridType gridType)
        Create a line
        Parameters:
        point1 - first point
        point2 - second point
        gridType - line grid type
        Returns:
        line
      • getPoint1

        public Point getPoint1()
        Get the first point
        Returns:
        first point
      • setPoint1

        public void setPoint1​(Point point1)
        Set the first point
        Parameters:
        point1 - first point
      • getPoint2

        public Point getPoint2()
        Get the second point
        Returns:
        second point
      • setPoint2

        public void setPoint2​(Point point2)
        Set the second point
        Parameters:
        point2 - second point
      • setPoints

        public void setPoints​(Point point1,
                              Point point2)
        Set the points
        Parameters:
        point1 - first point
        point2 - second point
      • getUnit

        public Unit getUnit()
        Get the unit
        Returns:
        unit
      • isUnit

        public boolean isUnit​(Unit unit)
        Is in the provided unit type
        Parameters:
        unit - unit
        Returns:
        true if in the unit
      • isDegrees

        public boolean isDegrees()
        Is this line in degrees
        Returns:
        true if degrees
      • isMeters

        public boolean isMeters()
        Is this line in meters
        Returns:
        true if meters
      • toUnit

        public Line toUnit​(Unit unit)
        Convert to the unit
        Parameters:
        unit - unit
        Returns:
        point in units, same point if equal units
      • toDegrees

        public Line toDegrees()
        Convert to degrees
        Returns:
        line in degrees, same line if already in degrees
      • toMeters

        public Line toMeters()
        Convert to meters
        Returns:
        line in meters, same line if already in meters
      • getGridType

        public GridType getGridType()
        Get the line grid type
        Returns:
        grid type
      • hasGridType

        public boolean hasGridType()
        Check if the line has a grid type
        Returns:
        true if has grid type
      • setGridType

        public void setGridType​(GridType gridType)
        Set the line grid type
        Parameters:
        gridType - grid type