ccs.cpc.impl
Class ToolkitDecoder

java.lang.Object
  extended by ccs.cpc.impl.ToolkitDecoder
All Implemented Interfaces:
CpcImageDecoder, java.awt.image.ImageObserver

public class ToolkitDecoder
extends java.lang.Object
implements CpcImageDecoder, java.awt.image.ImageObserver


Field Summary
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ToolkitDecoder()
           
 
Method Summary
 CpcImage decode(java.lang.String mimeType, byte[] wad)
          Decode the supplied image data synchronously, returning an image which is ready to use.
 java.lang.String getDescription()
          Return a user-friendly one-line description of this decoder.
 java.lang.String[] getSupportedTypes()
          Return the list of MIME types which this decoder can handle.
 boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int width, int height)
          Reserved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolkitDecoder

public ToolkitDecoder()
Method Detail

getSupportedTypes

public java.lang.String[] getSupportedTypes()
Return the list of MIME types which this decoder can handle.

Specified by:
getSupportedTypes in interface CpcImageDecoder

getDescription

public java.lang.String getDescription()
Return a user-friendly one-line description of this decoder. This can be in the form of a Checkpoint I18N key; the result will be fed to ccs.utils.MsgHelper before being displayed.

Specified by:
getDescription in interface CpcImageDecoder

decode

public CpcImage decode(java.lang.String mimeType,
                       byte[] wad)
Decode the supplied image data synchronously, returning an image which is ready to use. If acceptsStream returns true, this will not be called.

Specified by:
decode in interface CpcImageDecoder
Parameters:
mimeType - The apparent MIME type of the image data. You may be able to tell different (eg. by reading magic from the start of the data).
wad - The input data.
Returns:
The decoded image, if decodable. If you can't decode the image (wrong format, corrupt data, unsupported subformat / options etc.) return null.

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int flags,
                           int x,
                           int y,
                           int width,
                           int height)
Reserved.

Specified by:
imageUpdate in interface java.awt.image.ImageObserver