final boolean ltr = button.getComponentOrientation ().isLeftToRight ();
final boolean actualPaintLeft = ltr ? drawLeft : drawRight;
final boolean actualPaintRight = ltr ? drawRight : drawLeft;
// Retrieve shade 9-patch icon
final NinePatchIcon shade = NinePatchUtils.getShadeIcon ( shadeWidth, round * 2, transparency );
// Calculate shade bounds and paint it
final int x = actualPaintLeft ? 0 : -shadeWidth * 2;
final int width = w + ( actualPaintLeft ? 0 : shadeWidth * 2 ) + ( actualPaintRight ? 0 : shadeWidth * 2 );
final int y = drawTop ? 0 : -shadeWidth * 2;
final int height = h + ( drawTop ? 0 : shadeWidth * 2 ) + ( drawBottom ? 0 : shadeWidth * 2 );
shade.paintIcon ( g2d, x, y, width, height );
}
GraphicsUtils.restoreComposite ( g2d, oc, setInner );
}
// Background