sun.awt.image
Class ImageDecoderFactory

java.lang.Object
  extended by sun.awt.image.ImageDecoderFactory

public class ImageDecoderFactory
extends Object

ImageDecoderFactory allows the peer implementations to provide alternative image decoder implementations that can be used image decoding framework. There is always a default instance created that uses the decoders that are part of the sun.awt.image package.

sun.awt.image.InputStreamImageSource.getDecoder() method gets the instance of ImageDecoderFactory using ImageDecoderFactory.getInstance() and uses the factory to create various decoders.

Plugging Alternative Factories

The peer implementation can provide alternate implementations for the image decoders. To do that they need to do the following


Field Summary
static String IMG_FORMAT_GIF
          GIF Image format
static String IMG_FORMAT_JPG
          JPEG Image format
static String IMG_FORMAT_PNG
          PNG Image format
static String IMG_FORMAT_XBM
          XBM Image format
 
Constructor Summary
ImageDecoderFactory()
           
 
Method Summary
static ImageDecoderFactory getInstance()
          Returns the ImageDecoderFactory instance.
 ImageDecoder newImageDecoder(InputStreamImageSource source, InputStream input, String imgFormat)
          Creates an instance of a new ImageDecoder for the image format specified.
static void setFactory(ImageDecoderFactory factory)
          Sets the ImageDecoderFactory instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMG_FORMAT_GIF

public static final String IMG_FORMAT_GIF
GIF Image format

See Also:
Constant Field Values

IMG_FORMAT_JPG

public static final String IMG_FORMAT_JPG
JPEG Image format

See Also:
Constant Field Values

IMG_FORMAT_PNG

public static final String IMG_FORMAT_PNG
PNG Image format

See Also:
Constant Field Values

IMG_FORMAT_XBM

public static final String IMG_FORMAT_XBM
XBM Image format

See Also:
Constant Field Values
Constructor Detail

ImageDecoderFactory

public ImageDecoderFactory()
Method Detail

getInstance

public static ImageDecoderFactory getInstance()
Returns the ImageDecoderFactory instance.


setFactory

public static void setFactory(ImageDecoderFactory factory)
Sets the ImageDecoderFactory instance. This can be called by the peer implementation to change the decoder factory


newImageDecoder

public ImageDecoder newImageDecoder(InputStreamImageSource source,
                                    InputStream input,
                                    String imgFormat)
                             throws IOException
Creates an instance of a new ImageDecoder for the image format specified.

Throws:
IOException