noope.output
Class AnimatedGifCreator
java.lang.Object
|
+--noope.output.AnimatedGifCreator
- All Implemented Interfaces:
- AnimationListener
- public class AnimatedGifCreator
- extends java.lang.Object
- implements AnimationListener
This is an AnimationListener, that creates an animated gif of the frames it is given or static
gif frames of an animation.
- Version:
- 05-May-2001
- Author:
- Miklos Reiter
Constructor Summary |
AnimatedGifCreator(java.awt.image.BufferedImage aIm,
java.lang.String aFileName,
java.lang.String aComments,
int aUniformDelay,
int aLoopCount)
Constructs a new AnimatedGifCreator. |
Method Summary |
void |
dispose()
Encodes into a file. |
java.awt.Graphics2D |
drawingGraphics()
Returns a Graphics2D object that can be used to draw into the BufferedImage. |
boolean |
isWorking()
Whether this AnimationListener is ready to be sent image information (or whether it is
useful to do so. |
void |
updateComplete()
Should be called when frame complete, adds it to Gif89Encoder. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnimatedGifCreator
public AnimatedGifCreator(java.awt.image.BufferedImage aIm,
java.lang.String aFileName,
java.lang.String aComments,
int aUniformDelay,
int aLoopCount)
- Constructs a new AnimatedGifCreator. After you have constructed it, you can draw into
the Graphics2D returned by drawingGraphics() to draw into the image held in this object.
After you've completed a frame, call updateComplete(). If you are using this object in
multiple threads, synchronize access to it, while drawing into the Graphics2D returned by
drawingGraphics. After using this object, you should call its dispose() method to write the
file.
drawingGraphics
public java.awt.Graphics2D drawingGraphics()
- Returns a Graphics2D object that can be used to draw into the BufferedImage.
- Specified by:
drawingGraphics
in interface AnimationListener
updateComplete
public void updateComplete()
- Should be called when frame complete, adds it to Gif89Encoder. This method is
synchronized to prevent other threads from changing the BufferedImage in the mean time.
- Specified by:
updateComplete
in interface AnimationListener
isWorking
public boolean isWorking()
- Whether this AnimationListener is ready to be sent image information (or whether it is
useful to do so. For example, a window, after being made invisible does not need any
more graphics information.) Returns false after dispose() has been called.
- Specified by:
isWorking
in interface AnimationListener
dispose
public void dispose()
- Encodes into a file.
- Specified by:
dispose
in interface AnimationListener