Package org.jfree.chart.encoders
Class ImageEncoderFactory
- java.lang.Object
-
- org.jfree.chart.encoders.ImageEncoderFactory
-
public class ImageEncoderFactory extends java.lang.Object
Factory class for returningImageEncoder
s for differentImageFormat
s.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map
encoders
Storage for the encoders.
-
Constructor Summary
Constructors Constructor Description ImageEncoderFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
init()
Sets up default encoders (uses Sun PNG Encoder if JDK 1.4+ and the SunPNGEncoderAdapter class is available).static ImageEncoder
newInstance(java.lang.String format)
Used to retrieve an ImageEncoder for a specific image format.static ImageEncoder
newInstance(java.lang.String format, boolean encodingAlpha)
Used to retrieve an ImageEncoder for a specific image format.static ImageEncoder
newInstance(java.lang.String format, float quality)
Used to retrieve an ImageEncoder for a specific image format.static ImageEncoder
newInstance(java.lang.String format, float quality, boolean encodingAlpha)
Used to retrieve an ImageEncoder for a specific image format.static void
setImageEncoder(java.lang.String format, java.lang.String imageEncoderClassName)
Used to set additional encoders or replace default ones.
-
-
-
Method Detail
-
init
private static void init()
Sets up default encoders (uses Sun PNG Encoder if JDK 1.4+ and the SunPNGEncoderAdapter class is available).
-
setImageEncoder
public static void setImageEncoder(java.lang.String format, java.lang.String imageEncoderClassName)
Used to set additional encoders or replace default ones.- Parameters:
format
- The image format name.imageEncoderClassName
- The name of the ImageEncoder class.
-
newInstance
public static ImageEncoder newInstance(java.lang.String format)
Used to retrieve an ImageEncoder for a specific image format.- Parameters:
format
- The image format required.- Returns:
- The ImageEncoder or
null
if none available.
-
newInstance
public static ImageEncoder newInstance(java.lang.String format, float quality)
Used to retrieve an ImageEncoder for a specific image format.- Parameters:
format
- The image format required.quality
- The quality to be set before returning.- Returns:
- The ImageEncoder or
null
if none available.
-
newInstance
public static ImageEncoder newInstance(java.lang.String format, boolean encodingAlpha)
Used to retrieve an ImageEncoder for a specific image format.- Parameters:
format
- The image format required.encodingAlpha
- Sets whether alpha transparency should be encoded.- Returns:
- The ImageEncoder or
null
if none available.
-
newInstance
public static ImageEncoder newInstance(java.lang.String format, float quality, boolean encodingAlpha)
Used to retrieve an ImageEncoder for a specific image format.- Parameters:
format
- The image format required.quality
- The quality to be set before returning.encodingAlpha
- Sets whether alpha transparency should be encoded.- Returns:
- The ImageEncoder or
null
if none available.
-
-