g.fillRoundRectangle(legendRectangle.x, legendRectangle.y, legendRectangle.width, legendRectangle.height, 10, 10);
g.setForeground(black);
g.drawRoundRectangle(legendRectangle.x, legendRectangle.y, legendRectangle.width, legendRectangle.height, 10, 10);
g.setForeground(oldColor);
JPowerGraphPoint point = new JPowerGraphPoint(legendRectangle.x + widthPad/2, legendRectangle.y + heightPad);
for (LegendItem legendItem : theLegend.getRoot().getLegendItems()) {
JPowerGraphDimension dimension = new JPowerGraphDimension(0, 0);
painter.getLegendItemSize(graphPane, legendItem, theLegend, dimension);
painter.paintLegendItem(graphPane, g, legendItem, theLegend, point, legendRectangle);
point.y += dimension.height;