graphics2d.setPaint(paint);
// create a rounded rectangle area as big as the entire title bar, then subtract
// off the bottom half (roughly) in order to have perfectly square edges.
Area titleArea = new Area(new Area(new RoundRectangle2D.Double(
0, 0, getWidth(), getHeight(), ROUNDED_RECT_DIAMETER, ROUNDED_RECT_DIAMETER)));
titleArea.subtract(new Area(new Rectangle(0, midPointY, getWidth(), midPointY)));
// draw the top half of the title bar (the shine).
graphics2d.fill(titleArea);
// 2. The bottom half -----------------------------------------------------------//
// draw the bottom half of the title bar.
int bottomHeight = getHeight() - midPointY;