The list of methods to do Rectangle are organized into topic(s).
Rectangle[]
computeDifference(Rectangle rectA, Rectangle rectB) Subtracts a rectangle from another and return the area as an array of rectangles.
if (rectA == null || rectB == null)
return new Rectangle[0];
Rectangle[] r = new Rectangle[4];
int x1 = rectA.x;
int y1 = rectA.y;
int w1 = rectA.width;
int h1 = rectA.height;
int x2 = rectB.x;
...
Rectangle
flip(Dimension view, Rectangle rect, int direction) flip
boolean flipHorizontal = (direction & 1) == 1;
boolean flipVertical = (direction & 2) == 2;
int x = flipHorizontal ? view.width - (rect.x + rect.width) : rect.x;
int y = flipVertical ? view.height - (rect.y + rect.height) : rect.y;
System.out.println(rect + " - " + new Rectangle(x, y, rect.width, rect.height));
return new Rectangle(x, y, rect.width, rect.height);