|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jinsight.jetchart.ChartEncoder
Charts created with JetChart can be encoded into a JPEG, PNG, GIF or SVG output stream. This class is a bridge to the api of the encoders available, and is also in charge of generating an offscreen Image object to encode charts. This class is a wrapper around four image encoders, hidding the details of an offscreen image generation to encode charts.
Constructor Summary | |
ChartEncoder(GenericGraph graph)
Constructor of the ChartEncoder class. |
Method Summary | |
void |
addImageEncodingObserver(java.util.Observer obs)
Adds an Observer object for receiving notifications about the number of bytes processed while a chart image is gif-encoded. |
protected void |
finalize()
|
void |
gifEncode(java.io.File f,
int scale)
Starts gif-encoding a chart image, saving bytes into a file. |
void |
gifEncode(java.io.OutputStream out)
Starts gif-encoding a chart image, sending encoded bytes to an output stream. |
void |
jpegEncode(java.io.File f,
int quality)
Starts jpeg-encoding a chart image, saving bytes into a file. |
void |
jpegEncode(java.io.OutputStream out,
int quality)
Starts jpeg-encoding a chart image, sending encoded bytes to an output stream. |
void |
lineProcessed(SVGEvent evt)
ChartEncoder implements the interface SVGListener to be notified by the SVGGraphics class of each svg line processed. |
void |
pngEncode(java.io.File f,
int compressionLevel)
Starts png-encoding a chart image, saving bytes into a file. |
void |
pngEncode(java.io.OutputStream out,
int compressionLevel)
Starts png-encoding a chart image, sending encoded bytes to an output stream. |
void |
removeImageEncodingObserver(java.util.Observer obs)
Removes an image encoding observer from receiving notifications about a gif- encoding process. |
void |
svgEncode(java.io.File f,
boolean encodeAsImage,
int quality)
Starts svg-encoding a chart image, saving the resulting code into a file. |
void |
svgEncode(java.io.OutputStream out,
boolean encodeAsImage,
int quality)
Starts svg-encoding a chart image, sending the resulting code to an output stream. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ChartEncoder(GenericGraph graph)
graph
- A GenericGraph object.GenericGraph
Method Detail |
public void addImageEncodingObserver(java.util.Observer obs)
obs
- An object that implements the Observer interface.public void removeImageEncodingObserver(java.util.Observer obs)
obs
- An object that implements the Observer interface.addImageEncodingObserver(java.util.Observer)
public void gifEncode(java.io.File f, int scale) throws java.io.IOException
f
- A File object specifying the name and directory of the gif file.scale
- An integer that sets the gif image size. A number of 100
generates a full size image, while 50 generates an image having half the
original size.java.io.IOException
- public void gifEncode(java.io.OutputStream out) throws java.io.IOException
out
- An OutputStream object.java.io.IOException
- public void pngEncode(java.io.File f, int compressionLevel) throws java.io.IOException
f
- A File object specifying the name of the png file and its directory.compressionLevel
- An integer ranging from 1 to 9. The higher the number,
the higher the compression level.java.io.IOException
- public void pngEncode(java.io.OutputStream out, int compressionLevel) throws java.io.IOException
out
- An OutputStream object.compressionLevel
- An integer ranging from 1 to 9. The higher the number,
the higher the compression level.java.io.IOException
- public void jpegEncode(java.io.File f, int quality) throws java.io.IOException
f
- A File object specifying the name of the jpeg file and its directory.quality
- An integer ranging from 0 to 100. The larger the number,
the better the image quality.java.io.IOException
- public void jpegEncode(java.io.OutputStream out, int quality) throws java.io.IOException
out
- An OutputStream object.quality
- An integer ranging from 0 to 100. The larger the number,
the better the image quality.java.io.IOException
- public void svgEncode(java.io.File f, boolean encodeAsImage, int quality) throws java.io.IOException
Additionally, the quality of the svg image can also be specified.
f
- A File object specifying the name of the svg file and its directory.encodeAsImage
- A boolean value(true/false).quality
- An integer value.SVGEncoder.HIGH_QUALITY
,
SVGEncoder.LOW_QUALITY
public void svgEncode(java.io.OutputStream out, boolean encodeAsImage, int quality) throws java.io.IOException
Additionally, the quality of the svg code can also be specified.
out
- An OutputStream object.encodeAsImage
- A boolean value(true/false).quality
- An integer value.SVGEncoder.HIGH_QUALITY
,
SVGEncoder.LOW_QUALITY
public void lineProcessed(SVGEvent evt)
lineProcessed
in interface SVGListener
evt
- An SVGEvent object.SVGListener
,
SVGEvent
,
SVGGraphics
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |