Class ImageWriter

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----ImageWriter

public class ImageWriter
extends Thread
Class definition for an object that writes an image as a GIF or JPEG file.

Version:
$Revision: 1.5 $, $Date: 2000/10/12 14:07:51 $
Author:
John Cavanaugh

Variable Index

 o cancelled
A flag indicating whether the write has been cancelled.
 o eof
A flag indicating whether the write process has reached end of file.
 o fatalErrList
A list of fatal errors that have been encountered.
 o GIF_IMAGE
 o gifEncoder
The GIF encoder object.
 o image
The image to be written.
 o JPEG_IMAGE
 o jpegEncoder
The JPEG encoder object.
 o outStream
The output stream to write the image to.
 o type
The type of output to write (GIF or JPEG);

Constructor Index

 o ImageWriter(FileOutputStream, Image, int)
Constructs an ImageWriter object.

Method Index

 o cancel()
Cancel the operation.
 o getEOF()
Get the completion status.
 o getFatalErrors()
Return a list of fatal errors encountered.
 o getWarnings()
Return a list of the warnings encountered.
 o isCancelled()
Get the cancel flag.
 o run()
Main line code.

Variables

 o outStream
 private FileOutputStream outStream
The output stream to write the image to.

 o image
 private Image image
The image to be written.

 o type
 private int type
The type of output to write (GIF or JPEG);

 o JPEG_IMAGE
 public static final int JPEG_IMAGE
 o GIF_IMAGE
 public static final int GIF_IMAGE
 o gifEncoder
 private GifEncoder gifEncoder
The GIF encoder object.

 o jpegEncoder
 private JpegEncoder jpegEncoder
The JPEG encoder object.

 o cancelled
 private Boolean cancelled
A flag indicating whether the write has been cancelled.

 o eof
 private boolean eof
A flag indicating whether the write process has reached end of file.

 o fatalErrList
 private Vector fatalErrList
A list of fatal errors that have been encountered.

Constructors

 o ImageWriter
 public ImageWriter(FileOutputStream outStream,
                    Image image,
                    int type) throws IOException
Constructs an ImageWriter object.

Parameters:
outStream - The output stream to write the image to.
image - The image to write.
type - The type of image to be written (GIF or JPEG).

Methods

 o run
 public void run()
Main line code.

Overrides:
run in class Thread
 o cancel
 public void cancel()
Cancel the operation.

 o isCancelled
 public boolean isCancelled()
Get the cancel flag.

Returns:
True if the operation has been cancelled; false otherwise.
 o getEOF
 public boolean getEOF()
Get the completion status.

Returns:
True if the writer has reached EOF or been cancelled; false otherwise.
 o getFatalErrors
 public Vector getFatalErrors()
Return a list of fatal errors encountered.

Returns:
A Vector of error messages.
 o getWarnings
 public Vector getWarnings()
Return a list of the warnings encountered.

Returns:
Always returns null.