/** * Constructs a new MultiRectArea consists of single rectangle */ public MultiRectArea(java.awt.Rectangle r) { rect = MultiRectAreaOp.createBuf(0); if (r != null && !r.isEmpty()) { rect[0] = 5; rect[1] = r.x; rect[2] = r.y; rect[3] = r.x + r.width - 1; rect[4] = r.y + r.height - 1; } check(this, "MultiRectArea(Rectangle)"); //$NON-NLS-1$ }
/** * Translate MultiRectArea object by (x, y) */ public void translate(int x, int y) { for (int i = 1; i < rect[0];) { rect[i++] += x; rect[i++] += y; rect[i++] += x; rect[i++] += y; } if (bounds != null && !bounds.isEmpty()) { bounds.translate(x, y); } if (rectangles != null) { foreach (java.awt.Rectangle element in rectangles) { element.translate(x, y); } } }