kcl.waterloo.deploy.gif
Class GJGifSequencer
- java.lang.Object
-
- kcl.waterloo.deploy.gif.GifSequenceWriter
-
- kcl.waterloo.deploy.gif.GJGifSequencer
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener, GJSequencerInterface
public class GJGifSequencer extends GifSequenceWriter implements GJSequencerInterface, java.awt.event.ActionListener
GJGifSequencer class for creating animated GIFs.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidactionPerformed(java.awt.event.ActionEvent e)voidadd()Add the graphics of the component as a new frame to the GIF.voidclose()Closes the GIF writer and associated output streams.voidclose(java.lang.String filename)Close call used when a memory cached output stream is used.static GJGifSequencercreateInstance(java.awt.Component comp, int interval, boolean loopFlag)Factory method to create a GIF writer using a memory cache for output.static GJGifSequencercreateInstance(java.lang.String fileName, java.awt.Component comp, int interval, boolean loopFlag)Factory method to create a GIF writer writing to a file output stream.booleanisMemoryCached()Returns true is this GIF writer users a memory MemoryCacheImageOutputStream, false otherwise.-
Methods inherited from class kcl.waterloo.deploy.gif.GifSequenceWriter
writeToSequence
-
-
-
-
Method Detail
-
createInstance
public static GJGifSequencer createInstance(java.lang.String fileName, java.awt.Component comp, int interval, boolean loopFlag) throws java.io.FileNotFoundException, javax.imageio.IIOException, java.io.IOException
Factory method to create a GIF writer writing to a file output stream.- Parameters:
fileName- String description of the file to writecomp- the Component to animateinterval- interval between frames (ms)loopFlag- true to loop continuously- Returns:
- a GIF writer
- Throws:
java.io.FileNotFoundExceptionjavax.imageio.IIOExceptionjava.io.IOException
-
createInstance
public static GJGifSequencer createInstance(java.awt.Component comp, int interval, boolean loopFlag) throws java.io.IOException
Factory method to create a GIF writer using a memory cache for output.- Parameters:
comp- the Component to animateinterval- interval between frames (ms)loopFlag- true to loop continuously- Returns:
- a GIF writer
- Throws:
java.io.FileNotFoundExceptionjavax.imageio.IIOExceptionjava.io.IOException
-
add
public void add() throws java.io.IOExceptionAdd the graphics of the component as a new frame to the GIF.- Specified by:
addin interfaceGJSequencerInterface- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionCloses the GIF writer and associated output streams.- Overrides:
closein classGifSequenceWriter- Throws:
java.io.IOException
-
close
public void close(java.lang.String filename) throws java.io.IOExceptionClose call used when a memory cached output stream is used. Closes the GIF writer and writes the contents to the named file.- Parameters:
filename- String descriptor of the file to write.- Throws:
java.io.IOException
-
isMemoryCached
public boolean isMemoryCached()
Returns true is this GIF writer users a memory MemoryCacheImageOutputStream, false otherwise.- Returns:
- true is this GIF writer users a memory MemoryCacheImageOutputStream
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
-
DMelt 3.0 © DataMelt by jWork.ORG