/** Update the drawableBounds member according to insideBounds and spacing. */ protected void updateDrawableBounds() { // here, we would like to avoid Rectangle creation drawableBounds.x = insideBounds.x - spacing.left; drawableBounds.y = insideBounds.y - spacing.top; drawableBounds.width = insideBounds.width + spacing.left + spacing.right; drawableBounds.height = insideBounds.height + spacing.top + spacing.bottom; Dimension d = getDepth(); backRectangle.setToBackRectangleOf(insideBounds, d); frontRectangle.setToFrontRectangleOf(insideBounds, d); }