public class Rectangles extends Object
| Modifier and Type | Method and Description |
|---|---|
static Point2D |
center(Rectangle2D r,
Point2D result)
Store the center of the given rectangle in the given point,
and return it.
|
static Rectangle2D |
computeBounds(AffineTransform at,
Rectangle2D rSrc,
Rectangle2D rDst)
Compute the bounding rectangle of the given rectangle after it
has been transformed with the given transform, and stores it
in the given destination.
|
static Rectangle2D |
copy(Rectangle2D r)
Return a copy of the given rectangle
|
static Point2D |
getCorner(Rectangle2D rectangle,
int index,
Point2D pDst)
Computes the specified corner of the given rectangle, and stores
it in the given destination point.
|
static Rectangle2D |
moveCenterTo(Rectangle2D r,
double x,
double y,
Rectangle2D result)
Move the center of the given rectangle to the given position,
and store the result in the given result rectangle.
|
static Rectangle2D |
scale(Rectangle2D r,
double factor,
Rectangle2D result)
Scale the given rectangle by the given factor, about its center,
and store the result in the given result rectangle.
|
static Rectangle2D |
translate(Rectangle2D r,
double dx,
double dy,
Rectangle2D result)
Translate the given rectangle by the specified amount,
and store the result in the given result rectangle.
|
static Rectangle2D |
union(Iterable<? extends Rectangle2D> rectangles,
Rectangle2D result)
Compute the union of the given rectangles, and store it in the given
result rectangle.
|
public static Rectangle2D union(Iterable<? extends Rectangle2D> rectangles, Rectangle2D result)
null, then a new
rectangle will be created and returned.rectangles - The rectanglesresult - The rectangle that will store the resultpublic static Rectangle2D copy(Rectangle2D r)
r - The rectanglepublic static Rectangle2D moveCenterTo(Rectangle2D r, double x, double y, Rectangle2D result)
null, then a new
rectangle will be created and returned.r - The rectanglex - The x-coordinatey - The y-coordinateresult - The rectangle that will store the resultpublic static Rectangle2D translate(Rectangle2D r, double dx, double dy, Rectangle2D result)
null, then a new
rectangle will be created and returned.r - The rectangledx - The movement in x-directiondy - The movement in y-directionresult - The rectangle that will store the resultpublic static Rectangle2D scale(Rectangle2D r, double factor, Rectangle2D result)
null, then a new
rectangle will be created and returned.r - The rectanglefactor - The scaling factorresult - The rectangle that will store the resultpublic static Point2D center(Rectangle2D r, Point2D result)
null, then a new point
will be created and returnedr - The rectangleresult - The point that will store the resultpublic static Rectangle2D computeBounds(AffineTransform at, Rectangle2D rSrc, Rectangle2D rDst)
null
then a new rectangle will be created and returnedat - The transformrSrc - The source rectanglerDst - The destination rectanglepublic static Point2D getCorner(Rectangle2D rectangle, int index, Point2D pDst)
null, then a new point will be created and returned.rectangle - The rectangleindex - The index. This may be an arbitrary value, and will
be wrapped to be in the range [0,3].pDst - The destination pointCopyright © 2017. All rights reserved.