Package com.snowtide.pdf.layout
Class Rectangle
- java.lang.Object
-
- com.snowtide.pdf.layout.Rectangle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description float
area()
The total area of this region.Region
bounds()
Instances ofRegion
will always return themselves from theirbounds
implementations.float
by()
The bottom edge of this region.static boolean
contains(Region query, Region r)
Returns true only ifr
is entirely contained withinquery
.float
endxpos()
float
endypos()
float
height()
The total height of this region.static Rectangle
intersection(Region... regions)
Returns a Rectangle that is the intersection ofstart
and all of the remaining provided Regions, or null if there is no common intersection.static boolean
intersects(Region r1, Region r2)
Returns true only if any portion of the two Regions intersect.float
lx()
The left edge of this region.float
rx()
The right edge of this region.String
toString()
float
ty()
The top edge of this region.static Rectangle
union(Region... regions)
Returns aRectangle
whose coordinates represent the minimum bounding rectangle of all of the provided rectangles.float
width()
The width of this region.float
xpos()
float
ypos()
-
-
-
Constructor Detail
-
Rectangle
public Rectangle(float x, float y, float x2, float y2)
-
Rectangle
public Rectangle(Region src)
-
-
Method Detail
-
width
public final float width()
Description copied from interface:Region
The width of this region.
-
height
public final float height()
Description copied from interface:Region
The total height of this region.
-
area
public final float area()
Description copied from interface:Region
The total area of this region.
-
bounds
public Region bounds()
Description copied from interface:Region
Instances ofRegion
will always return themselves from theirbounds
implementations.
-
lx
public float lx()
Description copied from interface:Region
The left edge of this region.
-
rx
public float rx()
Description copied from interface:Region
The right edge of this region.
-
by
public float by()
Description copied from interface:Region
The bottom edge of this region.
-
ty
public float ty()
Description copied from interface:Region
The top edge of this region.
-
intersects
public static boolean intersects(Region r1, Region r2)
Returns true only if any portion of the two Regions intersect.
-
contains
public static boolean contains(Region query, Region r)
Returns true only ifr
is entirely contained withinquery
.
-
union
public static final Rectangle union(Region... regions)
Returns aRectangle
whose coordinates represent the minimum bounding rectangle of all of the provided rectangles.- Throws:
IllegalArgumentException
- if no regions are provided
-
intersection
public static Rectangle intersection(Region... regions)
Returns a Rectangle that is the intersection ofstart
and all of the remaining provided Regions, or null if there is no common intersection.- Throws:
IllegalArgumentException
- if no regions are provided
-
-