org.apache.fop.render

Class AbstractGraphics2DAdapter

Implemented Interfaces:
Graphics2DAdapter
Known Direct Subclasses:
AFPGraphics2DAdapter, Java2DGraphics2DAdapter, PCLGraphics2DAdapter, PDFGraphics2DAdapter, PSGraphics2DAdapter

public abstract class AbstractGraphics2DAdapter
extends java.lang.Object
implements Graphics2DAdapter

Abstract base class for Graphics2DAdapter implementations.

Method Summary

void
paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height)
protected BufferedImage
paintToBufferedImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter, RendererContext.RendererContextWrapper context, int resolution, boolean gray, boolean withAlpha)
Paints the image to a BufferedImage and returns that.
protected void
setRenderingHintsForBufferedImage(Graphics2D g2d)
Sets rendering hints on the Graphics2D created for painting to a BufferedImage.

Method Details

paintImage

public void paintImage(Graphics2DImagePainter painter,
                       RendererContext context,
                       int x,
                       int y,
                       int width,
                       int height)
            throws IOException
Specified by:
paintImage in interface Graphics2DAdapter

paintToBufferedImage

protected BufferedImage paintToBufferedImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
                                             RendererContext.RendererContextWrapper context,
                                             int resolution,
                                             boolean gray,
                                             boolean withAlpha)
Paints the image to a BufferedImage and returns that.
Parameters:
painter - the painter which will paint the actual image
context - the renderer context for the current renderer
resolution - the requested bitmap resolution
gray - true if the generated image should be in grayscales
withAlpha - true if an alpha channel should be created
Returns:
the generated BufferedImage

setRenderingHintsForBufferedImage

protected void setRenderingHintsForBufferedImage(Graphics2D g2d)
Sets rendering hints on the Graphics2D created for painting to a BufferedImage. Subclasses can modify the settings to customize the behaviour.
Parameters:
g2d - the Graphics2D instance

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.