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
-
cancelled
- A flag indicating whether the write has been cancelled.
-
eof
- A flag indicating whether the write process has reached
end of file.
-
fatalErrList
- A list of fatal errors that have been encountered.
-
GIF_IMAGE
-
-
gifEncoder
- The GIF encoder object.
-
image
- The image to be written.
-
JPEG_IMAGE
-
-
jpegEncoder
- The JPEG encoder object.
-
outStream
- The output stream to write the image to.
-
type
- The type of output to write (GIF or JPEG);
-
ImageWriter(FileOutputStream, Image, int)
- Constructs an ImageWriter object.
-
cancel()
- Cancel the operation.
-
getEOF()
- Get the completion status.
-
getFatalErrors()
- Return a list of fatal errors encountered.
-
getWarnings()
- Return a list of the warnings encountered.
-
isCancelled()
- Get the cancel flag.
-
run()
- Main line code.
outStream
private FileOutputStream outStream
- The output stream to write the image to.
image
private Image image
- The image to be written.
type
private int type
- The type of output to write (GIF or JPEG);
JPEG_IMAGE
public static final int JPEG_IMAGE
GIF_IMAGE
public static final int GIF_IMAGE
gifEncoder
private GifEncoder gifEncoder
- The GIF encoder object.
jpegEncoder
private JpegEncoder jpegEncoder
- The JPEG encoder object.
cancelled
private Boolean cancelled
- A flag indicating whether the write has been cancelled.
eof
private boolean eof
- A flag indicating whether the write process has reached
end of file.
fatalErrList
private Vector fatalErrList
- A list of fatal errors that have been encountered.
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).
run
public void run()
- Main line code.
- Overrides:
- run in class Thread
cancel
public void cancel()
- Cancel the operation.
isCancelled
public boolean isCancelled()
- Get the cancel flag.
- Returns:
- True if the operation has been cancelled;
false otherwise.
getEOF
public boolean getEOF()
- Get the completion status.
- Returns:
- True if the writer has reached EOF or been cancelled;
false otherwise.
getFatalErrors
public Vector getFatalErrors()
- Return a list of fatal errors encountered.
- Returns:
- A Vector of error messages.
getWarnings
public Vector getWarnings()
- Return a list of the warnings encountered.
- Returns:
- Always returns null.