Java Utililty Methods Rectangle Grow

List of utility methods to do Rectangle Grow

Description

The list of methods to do Rectangle Grow are organized into topic(s).

Method

Rectangle2DgrowRectByRelativeSize(Rectangle2D rect, double top, double right, double bottom, double left)
grow Rect By Relative Size
Rectangle2D r = new Rectangle2D.Double(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight());
growRectInPlaceByRelativeSize(r, top, right, bottom, left);
return r;
voidgrowRectInPlace(Rectangle2D rect, double top, double right, double bottom, double left)
grow Rect In Place
rect.setRect(rect.getX() - left, rect.getY() - top, rect.getWidth() + left + right,
        rect.getHeight() + top + bottom);
RectanglegrowTheRect(Rectangle rect, int factor)
Grow the rectangle; useful for GRID_SIZE_INT conversions
return (new Rectangle(rect.x * factor, rect.y * factor, rect.width * factor, rect.height * factor));
Rectangleshrink(Rectangle r, int h, int v, boolean clone)
shrinks a Rectangle, the center is kept constant
if (!clone) {
    r.x = r.x + v;
    r.width = r.width - v;
    r.y = r.y + h;
    r.height = r.height - h;
    return r;
} else {
    return new Rectangle(r.x + v, r.width - v, r.y + h, r.height - h);
...
RectangleshrinkSize(Rectangle r, Insets insets)
shrink Size
if (insets != null) {
    r = new Rectangle(r.x + insets.left, r.y + insets.top, r.width - insets.left - insets.right,
            r.height - insets.top - insets.bottom);
if (r.width < 0) {
    r.width = 0;
if (r.height < 0) {
...