org.norther.tammi.sprig.jfree.encode
Class JFreeEncoder

java.lang.Object
  extended by org.norther.tammi.sprig.jfree.encode.JFreeEncoder
All Implemented Interfaces:
Encoder
Direct Known Subclasses:
GIFEncoder, JpegEncoder, PNGEncoder

public abstract class JFreeEncoder
extends Object
implements Encoder

A JFreeReport compatible encoder.

Version:
$Id: JFreeEncoder.java,v 1.7 2009/09/28 15:08:51 cvsimp Exp $
Author:
Ilkka Priha

Constructor Summary
JFreeEncoder()
          Constructs a new exporter.
 
Method Summary
 byte[] encode(ChartLayout layout)
          Encodes the specified layout as a byte buffer.
protected  BufferedImage getImage(ChartLayout layout)
          Gets the image.
protected abstract  String getImageFormat()
          Gets the image format of this encoder.
protected  ChartRenderingInfo getInfo()
          Gets the rendering info.
 int getQuality()
          Gets the image quality.
 boolean isEncodeAlpha()
          Checks the encode alpha visibity option.
 void setEncodeAlpha(boolean flag)
          Sets the encode alpha visibity option.
protected  void setInfo(ChartRenderingInfo info)
          Sets the rendering info.
 void setQuality(int q)
          Sets the image quality.
 void write(ChartLayout layout, File file)
          Writes the specified layout to a file.
 void write(ChartLayout layout, OutputStream output)
          Writes the specified layout to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JFreeEncoder

public JFreeEncoder()
Constructs a new exporter.

Method Detail

isEncodeAlpha

public boolean isEncodeAlpha()
Description copied from interface: Encoder
Checks the encode alpha visibity option.

Specified by:
isEncodeAlpha in interface Encoder
Returns:
true to encode alpha visibity, false otherwise.

setEncodeAlpha

public void setEncodeAlpha(boolean flag)
Description copied from interface: Encoder
Sets the encode alpha visibity option.

Specified by:
setEncodeAlpha in interface Encoder
Parameters:
flag - true to encode alpha visibity, false otherwise.

getQuality

public int getQuality()
Description copied from interface: Encoder
Gets the image quality.

Specified by:
getQuality in interface Encoder
Returns:
the quality.

setQuality

public void setQuality(int q)
Description copied from interface: Encoder
Sets the image quality.

Specified by:
setQuality in interface Encoder
Parameters:
q - the quality (0 - 100 %).

encode

public byte[] encode(ChartLayout layout)
              throws LogException
Description copied from interface: Encoder
Encodes the specified layout as a byte buffer.

Specified by:
encode in interface Encoder
Parameters:
layout - the chart layout.
Returns:
the encoded chart.
Throws:
LogException - on errors.

write

public void write(ChartLayout layout,
                  File file)
           throws LogException
Description copied from interface: Encoder
Writes the specified layout to a file.

Specified by:
write in interface Encoder
Parameters:
layout - the chart layout.
file - the output file.
Throws:
LogException - on errors.

write

public void write(ChartLayout layout,
                  OutputStream output)
           throws LogException
Description copied from interface: Encoder
Writes the specified layout to a stream.

Specified by:
write in interface Encoder
Parameters:
layout - the chart layout.
output - the output stream.
Throws:
LogException - on errors.

getImage

protected BufferedImage getImage(ChartLayout layout)
Gets the image.

Parameters:
layout - the layout.
Returns:
the buffered image.

getInfo

protected ChartRenderingInfo getInfo()
Gets the rendering info.

Returns:
the info.

setInfo

protected void setInfo(ChartRenderingInfo info)
Sets the rendering info.

Parameters:
info - the info.

getImageFormat

protected abstract String getImageFormat()
Gets the image format of this encoder.

Returns:
the image format.


Copyright © 2004 The Norther Organization. All rights reserved.