// Render our clip shape into the image. Enable antialiasing to achieve
// a soft clipping effect.
g2d.setComposite(AlphaComposite.Src);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(bgFillColor);
CornerSize cornerSize = pBar.getOrientation() == JProgressBar.HORIZONTAL ? CornerSize.ROUND_HEIGHT : CornerSize.ROUND_WIDTH;
g2d.fill(shapeGenerator.createRoundRectangle(0, 0, bounds.width, bounds.height, cornerSize));
// Use SrcAtop, which effectively uses the alpha value as a coverage
// value for each pixel stored in the destination. At the edges, the
// antialiasing of the rounded rectangle gives us the desired soft