Package com.datalogics.PDFL
Class Rect
java.lang.Object
com.datalogics.PDFL.Rect
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
ConstructorsConstructorDescriptionRect()Create a rectangle with all values zero.Rect(double nLLx, double nLLy, double nURx, double nURy) Create a Rect.Rect(Rectangle2D r) Create a Rect from a java.awt rectangle type Note that the coordinate systems are inverted for PDFL. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()booleandoublethe Y coordinate of the lower left corner of the rectangle.doubleThe height of the Rect.doublegetLeft()the X coordinate of the lower left corner of the rectangle.doublegetLLx()the X coordinate of the lower left corner of the rectangle.doublegetLLy()the Y coordinate of the lower left corner of the rectangle.doublegetRight()the X coordinate of the upper right corner of the rectangle.doublegetTop()the Y coordinate of the upper right corner of the rectangle.doublegetURx()the X coordinate of the upper right corner of the rectangle.doublegetURy()the Y coordinate of the upper right corner of the rectangle.doublegetWidth()The width of the Rect.booleanCheck if this rectangle is inside the parameter rectangle.Obtain the intersection of this rectangle and another rectangle.booleanisEmpty()Check if this rectangle is empty.booleanCheck if two rectangles overlap.voidsetBottom(double bottom) the Y coordinate of the lower left corner of the rectangle.voidsetLeft(double left) the X coordinate of the lower left corner of the rectangle.voidsetLLx(double value) the X coordinate of the lower left corner of the rectangle.voidsetLLy(double value) the Y coordinate of the lower left corner of the rectangle.voidsetRight(double right) the X coordinate of the upper right corner of the rectangle.voidsetTop(double top) the Y coordinate of the upper right corner of the rectangle.voidsetURx(double value) the X coordinate of the upper right corner of the rectangle.voidsetURy(double value) the Y coordinate of the upper right corner of the rectangle.toString()Transform the coordinates of the rectangle by the given Matrix Object.
-
Constructor Details
-
Rect
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 rectanglenLLy- the Y coordinate of the lower left corner of the rectanglenURx- the X coordinate of the upper right corner of the rectanglenURy- the Y coordinate of the upper right corner of the rectangle
-
-
Method Details
-
delete
public void delete() -
equals
-
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
Transform the coordinates of the rectangle by the given Matrix Object. -
overlaps
Check if two rectangles overlap. -
inRect
Check if this rectangle is inside the parameter rectangle. -
isEmpty
public boolean isEmpty()Check if this rectangle is empty. -
intersect
Obtain the intersection of this rectangle and another rectangle. -
toString
-