Class ASCoordinate


  • public class ASCoordinate
    extends ASObject
    ASCoordinate represents a PDF coordintate point (x, y).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double angleTo​(ASCoordinate coord)
      Find the angle as measured along a line from this coordinate to the specified coordinate.
      double distanceTo​(ASCoordinate coord)
      Find the shortest Euclidean distance between this coordinate point and the specified coordinate point.
      double distanceToSquare​(ASCoordinate coord)
      Find the square of shortest Euclidean distance between this coordinate point and the specified coordinate point.
      java.lang.String toString()  
      ASCoordinate transform​(ASMatrix ctm)
      Transform the coordinate by a coordinate transformation matrix.
      ASCoordinate translate​(double dx, double dy)
      Translate the coordinate by dx, dy
      void write​(OutputByteStream outputByteStream)
      Writes the ASCoordinate in to the given OutputStream in the format expected by the PDF Spec.
      double x()  
      double y()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ASCoordinate

        public ASCoordinate​(double x,
                            double y)
        Parameters:
        x -
        y -
      • ASCoordinate

        public ASCoordinate​(ASCoordinate coordinate)
        Copy constructor.
        Parameters:
        coordinate -
    • Method Detail

      • translate

        public ASCoordinate translate​(double dx,
                                      double dy)
        Translate the coordinate by dx, dy
        Parameters:
        dx - The x offset
        dy - The y offset
        Returns:
        A new coordinate offset by dx, dy
      • transform

        public ASCoordinate transform​(ASMatrix ctm)
        Transform the coordinate by a coordinate transformation matrix.
        Parameters:
        ctm - - Coordinate Transformation Matrix
        Returns:
        ASCoordinate
      • distanceTo

        public double distanceTo​(ASCoordinate coord)
        Find the shortest Euclidean distance between this coordinate point and the specified coordinate point.
        Parameters:
        coord -
      • distanceToSquare

        public double distanceToSquare​(ASCoordinate coord)
        Find the square of shortest Euclidean distance between this coordinate point and the specified coordinate point.
        Parameters:
        coord -
        Returns:
        double
      • angleTo

        public double angleTo​(ASCoordinate coord)
        Find the angle as measured along a line from this coordinate to the specified coordinate.
        Parameters:
        coord -
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • write

        public void write​(OutputByteStream outputByteStream)
                   throws PDFIOException
        Writes the ASCoordinate in to the given OutputStream in the format expected by the PDF Spec.
        Specified by:
        write in class ASObject
        Parameters:
        outputByteStream - OutputStream to write to.
        Throws:
        PDFIOException
      • x

        public double x()
      • y

        public double y()