com.sun.jimi.core
Class JimiWriter

java.lang.Object
  |
  +--com.sun.jimi.core.JimiWriter

public class JimiWriter
extends java.lang.Object

JimiWriter provides more fine-grained control of the encoding process, and allows writing a series of images to a single image file.


Field Summary
protected  JimiEncoder encoder
           
protected  ProgressListener listener
           
protected  FormatOptionSet options
           
protected  FormatOptionSet overrideOptions
           
protected  JimiImage sourceImage
           
protected  JimiImageEnumeration sourceImageEnumeration
           
 
Constructor Summary
protected JimiWriter()
          Create an uninitialized JimiWriter.
protected JimiWriter(java.io.OutputStream output, java.lang.String mimeType)
          Create a JimiWriter.
protected JimiWriter(java.lang.String filename)
          Create a JimiWriter.
protected JimiWriter(java.lang.String filename, java.lang.String mimeType)
          Create a JimiWriter.
 
Method Summary
 void clearProperties()
          Deprecated. Use getOptions()
 java.lang.Object getPossibleValuesForProperty(java.lang.String name)
          Deprecated. Use getOptions()
 java.lang.Object getProperty(java.lang.String name)
          Deprecated. Use getOptions()
 java.lang.String getPropertyDescription(java.lang.String name)
          Deprecated. Use getOptions()
 java.util.Enumeration getPropertyNames()
          Deprecated. Use getOptions()
protected  void initJimiWriter(JimiEncoderFactory factory)
          Initialize the writer.
 void putImage(java.io.OutputStream output)
          Write the source to a stream.
 void putImage(java.lang.String filename)
          Write the source to a file.
protected  void setMimeType(java.lang.String typeID)
          Choose the mimetype of the format to save in.
 void setOptions(FormatOptionSet options)
          Set the options to use for encoding.
 void setProgressListener(ProgressListener listener)
          Register a ProgressListener to be informed of encoding progress.
 void setProperty(java.lang.String name, java.lang.Object value)
          Deprecated. Use getOptions()
 void setSource(java.awt.Image image)
          Set the source image to be written.
 void setSource(java.awt.Image[] images)
          Set a series of images as the source to be written.
 void setSource(java.awt.image.ImageProducer producer)
          Set the source image to be written.
 void setSource(java.awt.image.ImageProducer[] producers)
          Set a series of images as the source to be written.
 void setSource(JimiImage ji)
          Set the source image to be written.
 void setSource(JimiImage[] images)
          Set a series of images as the source to be written.
 void setSource(java.lang.Object[] images)
          Set a series of images as the source to be written.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoder

protected JimiEncoder encoder

sourceImage

protected JimiImage sourceImage

sourceImageEnumeration

protected JimiImageEnumeration sourceImageEnumeration

options

protected FormatOptionSet options

overrideOptions

protected FormatOptionSet overrideOptions

listener

protected ProgressListener listener
Constructor Detail

JimiWriter

protected JimiWriter(java.lang.String filename,
                     java.lang.String mimeType)
              throws JimiException
Create a JimiWriter.
Parameters:
filename - the filename to write to
mimeType - the mimetype of the format to write in

JimiWriter

protected JimiWriter(java.lang.String filename)
              throws JimiException
Create a JimiWriter.
Parameters:
filename - the filename to write to

JimiWriter

protected JimiWriter(java.io.OutputStream output,
                     java.lang.String mimeType)
              throws JimiException
Create a JimiWriter.
Parameters:
output - the stream to write to
mimeType - the mimetype of the format to write in

JimiWriter

protected JimiWriter()
Create an uninitialized JimiWriter.
Method Detail

setMimeType

protected void setMimeType(java.lang.String typeID)
                    throws JimiException
Choose the mimetype of the format to save in.

initJimiWriter

protected void initJimiWriter(JimiEncoderFactory factory)
                       throws JimiException
Initialize the writer.

setOptions

public void setOptions(FormatOptionSet options)
Set the options to use for encoding.

setProgressListener

public void setProgressListener(ProgressListener listener)
Register a ProgressListener to be informed of encoding progress.

setSource

public void setSource(JimiImage ji)
               throws JimiException
Set the source image to be written.
Parameters:
ji - the JimiImage to save

setSource

public void setSource(java.awt.Image image)
               throws JimiException
Set the source image to be written.
Parameters:
ji - the JimiImage to save

setSource

public void setSource(java.awt.image.ImageProducer producer)
               throws JimiException
Set the source image to be written.
Parameters:
ji - the JimiImage to save

setSource

public void setSource(JimiImage[] images)
               throws JimiException
Set a series of images as the source to be written.

setSource

public void setSource(java.awt.image.ImageProducer[] producers)
               throws JimiException
Set a series of images as the source to be written.

setSource

public void setSource(java.awt.Image[] images)
               throws JimiException
Set a series of images as the source to be written.

setSource

public void setSource(java.lang.Object[] images)
               throws JimiException
Set a series of images as the source to be written.
Parameters:
images - a JimiImage[], ImageProducer[], or Image[]

putImage

public void putImage(java.lang.String filename)
              throws JimiException
Write the source to a file.

putImage

public void putImage(java.io.OutputStream output)
              throws JimiException
Write the source to a stream.

getPossibleValuesForProperty

public java.lang.Object getPossibleValuesForProperty(java.lang.String name)
                                              throws InvalidOptionException
Deprecated. Use getOptions()

getPropertyDescription

public java.lang.String getPropertyDescription(java.lang.String name)
                                        throws InvalidOptionException
Deprecated. Use getOptions()

clearProperties

public void clearProperties()
Deprecated. Use getOptions()

getProperty

public java.lang.Object getProperty(java.lang.String name)
Deprecated. Use getOptions()

getPropertyNames

public java.util.Enumeration getPropertyNames()
Deprecated. Use getOptions()

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws InvalidOptionException
Deprecated. Use getOptions()