|
Header
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.ChartUtilities
public abstract class ChartUtilities
A collection of utility methods for JFreeChart. Includes methods for converting charts to image formats (PNG and JPEG) plus creating simple HTML image maps.
ImageMapUtilities
Constructor Summary | |
---|---|
ChartUtilities()
|
Method Summary | |
---|---|
static void |
applyCurrentTheme(JFreeChart chart)
Applies the current theme to the specified chart. |
static byte[] |
encodeAsPNG(java.awt.image.BufferedImage image)
Encodes a BufferedImage to PNG format. |
static byte[] |
encodeAsPNG(java.awt.image.BufferedImage image,
boolean encodeAlpha,
int compression)
Encodes a BufferedImage to PNG format. |
static java.lang.String |
getImageMap(java.lang.String name,
ChartRenderingInfo info)
Creates an HTML image map. |
static java.lang.String |
getImageMap(java.lang.String name,
ChartRenderingInfo info,
ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
URLTagFragmentGenerator urlTagFragmentGenerator)
Creates an HTML image map. |
static void |
saveChartAsJPEG(java.io.File file,
float quality,
JFreeChart chart,
int width,
int height)
Saves a chart to a file in JPEG format. |
static void |
saveChartAsJPEG(java.io.File file,
float quality,
JFreeChart chart,
int width,
int height,
ChartRenderingInfo info)
Saves a chart to a file in JPEG format. |
static void |
saveChartAsJPEG(java.io.File file,
JFreeChart chart,
int width,
int height)
Saves a chart to a file in JPEG format. |
static void |
saveChartAsJPEG(java.io.File file,
JFreeChart chart,
int width,
int height,
ChartRenderingInfo info)
Saves a chart to a file in JPEG format. |
static void |
saveChartAsPNG(java.io.File file,
JFreeChart chart,
int width,
int height)
Saves a chart to the specified file in PNG format. |
static void |
saveChartAsPNG(java.io.File file,
JFreeChart chart,
int width,
int height,
ChartRenderingInfo info)
Saves a chart to a file in PNG format. |
static void |
saveChartAsPNG(java.io.File file,
JFreeChart chart,
int width,
int height,
ChartRenderingInfo info,
boolean encodeAlpha,
int compression)
Saves a chart to a file in PNG format. |
static void |
writeBufferedImageAsJPEG(java.io.OutputStream out,
java.awt.image.BufferedImage image)
Writes a BufferedImage to an output stream in JPEG format. |
static void |
writeBufferedImageAsJPEG(java.io.OutputStream out,
float quality,
java.awt.image.BufferedImage image)
Writes a BufferedImage to an output stream in JPEG format. |
static void |
writeBufferedImageAsPNG(java.io.OutputStream out,
java.awt.image.BufferedImage image)
Writes a BufferedImage to an output stream in PNG format. |
static void |
writeBufferedImageAsPNG(java.io.OutputStream out,
java.awt.image.BufferedImage image,
boolean encodeAlpha,
int compression)
Writes a BufferedImage to an output stream in PNG format. |
static void |
writeChartAsJPEG(java.io.OutputStream out,
float quality,
JFreeChart chart,
int width,
int height)
Writes a chart to an output stream in JPEG format. |
static void |
writeChartAsJPEG(java.io.OutputStream out,
float quality,
JFreeChart chart,
int width,
int height,
ChartRenderingInfo info)
Writes a chart to an output stream in JPEG format. |
static void |
writeChartAsJPEG(java.io.OutputStream out,
JFreeChart chart,
int width,
int height)
Writes a chart to an output stream in JPEG format. |
static void |
writeChartAsJPEG(java.io.OutputStream out,
JFreeChart chart,
int width,
int height,
ChartRenderingInfo info)
Writes a chart to an output stream in JPEG format. |
static void |
writeChartAsPNG(java.io.OutputStream out,
JFreeChart chart,
int width,
int height)
Writes a chart to an output stream in PNG format. |
static void |
writeChartAsPNG(java.io.OutputStream out,
JFreeChart chart,
int width,
int height,
boolean encodeAlpha,
int compression)
Writes a chart to an output stream in PNG format. |
static void |
writeChartAsPNG(java.io.OutputStream out,
JFreeChart chart,
int width,
int height,
ChartRenderingInfo info)
Writes a chart to an output stream in PNG format. |
static void |
writeChartAsPNG(java.io.OutputStream out,
JFreeChart chart,
int width,
int height,
ChartRenderingInfo info,
boolean encodeAlpha,
int compression)
Writes a chart to an output stream in PNG format. |
static void |
writeImageMap(java.io.PrintWriter writer,
java.lang.String name,
ChartRenderingInfo info,
boolean useOverLibForToolTips)
Writes an image map to an output stream. |
static void |
writeImageMap(java.io.PrintWriter writer,
java.lang.String name,
ChartRenderingInfo info,
ToolTipTagFragmentGenerator toolTipTagFragmentGenerator,
URLTagFragmentGenerator urlTagFragmentGenerator)
Writes an image map to the specified writer. |
static void |
writeScaledChartAsPNG(java.io.OutputStream out,
JFreeChart chart,
int width,
int height,
int widthScaleFactor,
int heightScaleFactor)
Writes a scaled version of a chart to an output stream in PNG format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartUtilities()
Method Detail |
---|
public static void applyCurrentTheme(JFreeChart chart)
ChartFactory
class.
chart
- the chart (null
not permitted).public static void writeChartAsPNG(java.io.OutputStream out, JFreeChart chart, int width, int height) throws java.io.IOException
out
- the output stream (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.
java.io.IOException
- if there are any I/O errors.public static void writeChartAsPNG(java.io.OutputStream out, JFreeChart chart, int width, int height, boolean encodeAlpha, int compression) throws java.io.IOException
out
- the output stream (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.encodeAlpha
- encode alpha?compression
- the compression level (0-9).
java.io.IOException
- if there are any I/O errors.public static void writeChartAsPNG(java.io.OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws java.io.IOException
ChartRenderingInfo
object, to collect
information about the chart dimensions/entities. You will need this
info if you want to create an HTML image map.
out
- the output stream (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.info
- the chart rendering info (null
permitted).
java.io.IOException
- if there are any I/O errors.public static void writeChartAsPNG(java.io.OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info, boolean encodeAlpha, int compression) throws java.io.IOException
ChartRenderingInfo
object, to collect
information about the chart dimensions/entities. You will need this
info if you want to create an HTML image map.
out
- the output stream (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.info
- carries back chart rendering info (null
permitted).encodeAlpha
- encode alpha?compression
- the PNG compression level (0-9).
java.io.IOException
- if there are any I/O errors.public static void writeScaledChartAsPNG(java.io.OutputStream out, JFreeChart chart, int width, int height, int widthScaleFactor, int heightScaleFactor) throws java.io.IOException
out
- the output stream (null
not permitted).chart
- the chart (null
not permitted).width
- the unscaled chart width.height
- the unscaled chart height.widthScaleFactor
- the horizontal scale factor.heightScaleFactor
- the vertical scale factor.
java.io.IOException
- if there are any I/O problems.public static void saveChartAsPNG(java.io.File file, JFreeChart chart, int width, int height) throws java.io.IOException
file
- the file name (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.
java.io.IOException
- if there are any I/O errors.public static void saveChartAsPNG(java.io.File file, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws java.io.IOException
ChartRenderingInfo
object, to collect information about the
chart dimensions/entities. You will need this info if you want to
create an HTML image map.
file
- the file (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.info
- the chart rendering info (null
permitted).
java.io.IOException
- if there are any I/O errors.public static void saveChartAsPNG(java.io.File file, JFreeChart chart, int width, int height, ChartRenderingInfo info, boolean encodeAlpha, int compression) throws java.io.IOException
ChartRenderingInfo
object, to collect information about the
chart dimensions/entities. You will need this info if you want to
create an HTML image map.
file
- the file (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.info
- the chart rendering info (null
permitted).encodeAlpha
- encode alpha?compression
- the PNG compression level (0-9).
java.io.IOException
- if there are any I/O errors.public static void writeChartAsJPEG(java.io.OutputStream out, JFreeChart chart, int width, int height) throws java.io.IOException
out
- the output stream (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.
java.io.IOException
- if there are any I/O errors.public static void writeChartAsJPEG(java.io.OutputStream out, float quality, JFreeChart chart, int width, int height) throws java.io.IOException
out
- the output stream (null
not permitted).quality
- the quality setting.chart
- the chart (null
not permitted).width
- the image width.height
- the image height.
java.io.IOException
- if there are any I/O errors.public static void writeChartAsJPEG(java.io.OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws java.io.IOException
ChartRenderingInfo
object, to collect
information about the chart dimensions/entities. You will need this
info if you want to create an HTML image map.
out
- the output stream (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.info
- the chart rendering info (null
permitted).
java.io.IOException
- if there are any I/O errors.public static void writeChartAsJPEG(java.io.OutputStream out, float quality, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws java.io.IOException
ChartRenderingInfo
object, to collect
information about the chart dimensions/entities. You will need this
info if you want to create an HTML image map.
out
- the output stream (null
not permitted).quality
- the output quality (0.0f to 1.0f).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.info
- the chart rendering info (null
permitted).
java.io.IOException
- if there are any I/O errors.public static void saveChartAsJPEG(java.io.File file, JFreeChart chart, int width, int height) throws java.io.IOException
file
- the file (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.
java.io.IOException
- if there are any I/O errors.public static void saveChartAsJPEG(java.io.File file, float quality, JFreeChart chart, int width, int height) throws java.io.IOException
file
- the file (null
not permitted).quality
- the JPEG quality setting.chart
- the chart (null
not permitted).width
- the image width.height
- the image height.
java.io.IOException
- if there are any I/O errors.public static void saveChartAsJPEG(java.io.File file, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws java.io.IOException
ChartRenderingInfo
object, to collect information about the
chart dimensions/entities. You will need this info if you want to
create an HTML image map.
file
- the file name (null
not permitted).chart
- the chart (null
not permitted).width
- the image width.height
- the image height.info
- the chart rendering info (null
permitted).
java.io.IOException
- if there are any I/O errors.public static void saveChartAsJPEG(java.io.File file, float quality, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws java.io.IOException
ChartRenderingInfo
object, to collect information about the
chart dimensions/entities. You will need this info if you want to
create an HTML image map.
file
- the file name (null
not permitted).quality
- the quality setting.chart
- the chart (null
not permitted).width
- the image width.height
- the image height.info
- the chart rendering info (null
permitted).
java.io.IOException
- if there are any I/O errors.public static void writeBufferedImageAsJPEG(java.io.OutputStream out, java.awt.image.BufferedImage image) throws java.io.IOException
BufferedImage
to an output stream in JPEG format.
out
- the output stream (null
not permitted).image
- the image (null
not permitted).
java.io.IOException
- if there are any I/O errors.public static void writeBufferedImageAsJPEG(java.io.OutputStream out, float quality, java.awt.image.BufferedImage image) throws java.io.IOException
BufferedImage
to an output stream in JPEG format.
out
- the output stream (null
not permitted).quality
- the image quality (0.0f to 1.0f).image
- the image (null
not permitted).
java.io.IOException
- if there are any I/O errors.public static void writeBufferedImageAsPNG(java.io.OutputStream out, java.awt.image.BufferedImage image) throws java.io.IOException
BufferedImage
to an output stream in PNG format.
out
- the output stream (null
not permitted).image
- the image (null
not permitted).
java.io.IOException
- if there are any I/O errors.public static void writeBufferedImageAsPNG(java.io.OutputStream out, java.awt.image.BufferedImage image, boolean encodeAlpha, int compression) throws java.io.IOException
BufferedImage
to an output stream in PNG format.
out
- the output stream (null
not permitted).image
- the image (null
not permitted).encodeAlpha
- encode alpha?compression
- the compression level (0-9).
java.io.IOException
- if there are any I/O errors.public static byte[] encodeAsPNG(java.awt.image.BufferedImage image) throws java.io.IOException
BufferedImage
to PNG format.
image
- the image (null
not permitted).
java.io.IOException
- if there is an I/O problem.public static byte[] encodeAsPNG(java.awt.image.BufferedImage image, boolean encodeAlpha, int compression) throws java.io.IOException
BufferedImage
to PNG format.
image
- the image (null
not permitted).encodeAlpha
- encode alpha?compression
- the PNG compression level (0-9).
java.io.IOException
- if there is an I/O problem.public static void writeImageMap(java.io.PrintWriter writer, java.lang.String name, ChartRenderingInfo info, boolean useOverLibForToolTips) throws java.io.IOException
writer
- the writer (null
not permitted).name
- the map name (null
not permitted).info
- the chart rendering info (null
not permitted).useOverLibForToolTips
- whether to use OverLIB for tooltips
(http://www.bosrup.com/web/overlib/).
java.io.IOException
- if there are any I/O errors.public static void writeImageMap(java.io.PrintWriter writer, java.lang.String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) throws java.io.IOException
writer
- the writer (null
not permitted).name
- the map name (null
not permitted).info
- the chart rendering info (null
not permitted).toolTipTagFragmentGenerator
- a generator for the HTML fragment
that will contain the tooltip text (null
not permitted
if info
contains tooltip information).urlTagFragmentGenerator
- a generator for the HTML fragment that
will contain the URL reference (null
not permitted if
info
contains URLs).
java.io.IOException
- if there are any I/O errors.public static java.lang.String getImageMap(java.lang.String name, ChartRenderingInfo info)
ImageMapUtilities.getImageMap(String, ChartRenderingInfo,
ToolTipTagFragmentGenerator, URLTagFragmentGenerator)
, using default
generators.
name
- the map name (null
not permitted).info
- the chart rendering info (null
not permitted).
public static java.lang.String getImageMap(java.lang.String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator)
ImageMapUtilities.getImageMap(String, ChartRenderingInfo,
ToolTipTagFragmentGenerator, URLTagFragmentGenerator)
.
name
- the map name (null
not permitted).info
- the chart rendering info (null
not permitted).toolTipTagFragmentGenerator
- a generator for the HTML fragment
that will contain the tooltip text (null
not permitted
if info
contains tooltip information).urlTagFragmentGenerator
- a generator for the HTML fragment that
will contain the URL reference (null
not permitted if
info
contains URLs).
|
Footer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |