/** Prepare background **/
g2.transform(AffineTransform.getScaleInstance(getZoom(), getZoom()));
g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
/** Prepare background **/
final Rectangle2D pageArea = new Rectangle2D.Float(0, 0, outerW, outerH);
/**
* The border around the printable area is painted when the corresponding property is
* set to true.
*/
final Rectangle2D printingArea = new Rectangle2D.Float(innerX, innerY, innerW, innerH);
/** Paint Page Shadow */
final Rectangle2D southborder = new Rectangle2D.Float
(getShadowSize(), outerH,
outerW, getShadowSize());
final Rectangle2D eastborder = new Rectangle2D.Float
(outerW, getShadowSize(), getShadowSize(), outerH);
g2.setPaint(UIManager.getColor("controlShadow")); //$NON-NLS-1$
g2.fill(southborder);
g2.fill(eastborder);
if (isBorderPainted())
{
g2.setPaint(Color.gray);
g2.draw(printingArea);
}
g2.setPaint(Color.white);
g2.fill(pageArea);
final Graphics2D g22 = (Graphics2D) g2.create();
backend.draw(g22, new Rectangle2D.Double
(0, 0, pageFormat.getWidth(), pageFormat.getHeight()));
g22.dispose();
final Rectangle2D transPageArea = new Rectangle2D.Float(0, 0, outerW, outerH);
g2.setPaint(Color.black);
g2.draw(transPageArea);
g2.dispose();