Class Rect

java.lang.Object
com.datalogics.PDFL.Rect

public class Rect extends Object
A rect holds four coordinates for a rectangle. The coordinates for a rectangle include left, top, right, bottom. Width () and height () defines the rectangle's width and height. LLx and LLy defines lower left corner, and URx and URy defines the upper right corner.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a rectangle with all values zero.
    Rect(double nLLx, double nLLy, double nURx, double nURy)
    Create a Rect.
    Create a Rect from a java.awt rectangle type Note that the coordinate systems are inverted for PDFL.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    boolean
     
    double
    the Y coordinate of the lower left corner of the rectangle.
    double
    The height of the Rect.
    double
    the X coordinate of the lower left corner of the rectangle.
    double
    the X coordinate of the lower left corner of the rectangle.
    double
    the Y coordinate of the lower left corner of the rectangle.
    double
    the X coordinate of the upper right corner of the rectangle.
    double
    the Y coordinate of the upper right corner of the rectangle.
    double
    the X coordinate of the upper right corner of the rectangle.
    double
    the Y coordinate of the upper right corner of the rectangle.
    double
    The width of the Rect.
    boolean
    Check if this rectangle is inside the parameter rectangle.
    Obtain the intersection of this rectangle and another rectangle.
    boolean
    Check if this rectangle is empty.
    boolean
    Check if two rectangles overlap.
    void
    setBottom(double bottom)
    the Y coordinate of the lower left corner of the rectangle.
    void
    setLeft(double left)
    the X coordinate of the lower left corner of the rectangle.
    void
    setLLx(double value)
    the X coordinate of the lower left corner of the rectangle.
    void
    setLLy(double value)
    the Y coordinate of the lower left corner of the rectangle.
    void
    setRight(double right)
    the X coordinate of the upper right corner of the rectangle.
    void
    setTop(double top)
    the Y coordinate of the upper right corner of the rectangle.
    void
    setURx(double value)
    the X coordinate of the upper right corner of the rectangle.
    void
    setURy(double value)
    the Y coordinate of the upper right corner of the rectangle.
     
    Transform the coordinates of the rectangle by the given Matrix Object.

    Methods inherited from class java.lang.Object

    getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Rect

      public Rect(Rectangle2D r)
      Create a Rect from a java.awt rectangle type Note that the coordinate systems are inverted for PDFL. Smaller X/Y values are assigned to the lower left coordinate.
      Parameters:
      r - a rectangle
    • Rect

      public Rect()
      Create a rectangle with all values zero.
    • Rect

      public Rect(double nLLx, double nLLy, double nURx, double nURy)
      Create a Rect.

      Parameters:
      nLLx - the X coordinate of the lower left corner of the rectangle
      nLLy - the Y coordinate of the lower left corner of the rectangle
      nURx - the X coordinate of the upper right corner of the rectangle
      nURy - the Y coordinate of the upper right corner of the rectangle
  • Method Details

    • delete

      public void delete()
    • equals

      public boolean equals(Object rhs)
      Overrides:
      equals in class Object
    • setLLx

      public void setLLx(double value)
      the X coordinate of the lower left corner of the rectangle.
    • getLLx

      public double getLLx()
      the X coordinate of the lower left corner of the rectangle.
    • setLLy

      public void setLLy(double value)
      the Y coordinate of the lower left corner of the rectangle.
    • getLLy

      public double getLLy()
      the Y coordinate of the lower left corner of the rectangle.
    • setURx

      public void setURx(double value)
      the X coordinate of the upper right corner of the rectangle.
    • getURx

      public double getURx()
      the X coordinate of the upper right corner of the rectangle.
    • setURy

      public void setURy(double value)
      the Y coordinate of the upper right corner of the rectangle.
    • getURy

      public double getURy()
      the Y coordinate of the upper right corner of the rectangle.
    • getLeft

      public double getLeft()
      the X coordinate of the lower left corner of the rectangle.
    • setLeft

      public void setLeft(double left)
      the X coordinate of the lower left corner of the rectangle.
    • getBottom

      public double getBottom()
      the Y coordinate of the lower left corner of the rectangle.
    • setBottom

      public void setBottom(double bottom)
      the Y coordinate of the lower left corner of the rectangle.
    • getRight

      public double getRight()
      the X coordinate of the upper right corner of the rectangle.
    • setRight

      public void setRight(double right)
      the X coordinate of the upper right corner of the rectangle.
    • getTop

      public double getTop()
      the Y coordinate of the upper right corner of the rectangle.
    • setTop

      public void setTop(double top)
      the Y coordinate of the upper right corner of the rectangle.
    • getWidth

      public double getWidth()
      The width of the Rect.
    • getHeight

      public double getHeight()
      The height of the Rect.
    • transform

      public Rect transform(Matrix arg0)
      Transform the coordinates of the rectangle by the given Matrix Object.
    • overlaps

      public boolean overlaps(Rect r2)
      Check if two rectangles overlap.
    • inRect

      public boolean inRect(Rect r2)
      Check if this rectangle is inside the parameter rectangle.
    • isEmpty

      public boolean isEmpty()
      Check if this rectangle is empty.
    • intersect

      public Rect intersect(Rect r2)
      Obtain the intersection of this rectangle and another rectangle.
    • toString

      public String toString()
      Overrides:
      toString in class Object