org.bootchart.renderer
Class ImageRenderer

java.lang.Object
  extended by org.bootchart.renderer.Renderer
      extended by org.bootchart.renderer.ImageRenderer
Direct Known Subclasses:
EPSRenderer, PNGRenderer

public abstract class ImageRenderer
extends Renderer

ImageRenderer renders the boot chart as a Java 2D BufferedImage. Subclasses may then encode the image in different formats (e.g. PNG or EPS).


Field Summary
protected  boolean allowAlpha
          Whether to allow usage of transparency.
protected  Graphics g
           
protected  BufferedImage img
           
 
Constructor Summary
ImageRenderer()
           
 
Method Summary
abstract  String getFileSuffix()
          Returns the file suffix to use for the rendered image.
 void render(Properties headers, BootStats bootStats, OutputStream os)
          Render the chart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

g

protected Graphics g

img

protected BufferedImage img

allowAlpha

protected boolean allowAlpha
Whether to allow usage of transparency. Certain renderers (e.g. EPS) will produce better results if the colors aren't transparent.

Constructor Detail

ImageRenderer

public ImageRenderer()
Method Detail

render

public void render(Properties headers,
                   BootStats bootStats,
                   OutputStream os)
            throws IOException
Render the chart.

Specified by:
render in class Renderer
Parameters:
headers - header properties to include in the title banner
bootStats - boot statistics
os - the output stream to write t
Throws:
IOException - if an I/O error occurs

getFileSuffix

public abstract String getFileSuffix()
Description copied from class: Renderer
Returns the file suffix to use for the rendered image.

Specified by:
getFileSuffix in class Renderer
Returns:
file suffix