All Packages Class Hierarchy This Package Previous Next Index
Class com.kcmultimedia.gifcanvas.GIFCanvas
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----com.kcmultimedia.gifcanvas.GIFCanvas
- public class GIFCanvas
- extends Canvas
- implements Runnable
GIFCanvas is a class that permits display of animated GIF89a images (as
well as static GIF89a images.) An extension of Canvas, GIFCanvas can be
easily dropped into a layout, and several constructors are provided for
loading images.
-
GIFCanvas()
- This no-argument constructor creates an empty GIFCanvas, sized 0x0.
-
GIFCanvas(byte[])
- Creates a GIFCanvas displaying the image represented by the byte[]
parameter.
-
GIFCanvas(File)
- Creates a GIFCanvas displaying the image specified with the File
parameter.
-
GIFCanvas(URL)
- Creates a GIFCanvas displaying the image specified with the URL
parameter.
-
finalize()
- Used to free graphics resources, flush image frames and
try to be as well-behaved as possible.
-
getCurrentFrame()
- Return an index to the currently displayed frame of the
GIF, primarily for use by subclasses to perform some kind
of special action depending on the frame that is visible.
-
isStopped()
- Used to determine if the current animation loop is running.
-
minimumSize()
-
-
paint(Graphics)
-
-
preferredSize()
-
-
run()
-
-
setCurrentFrame(int)
- Set the current frame index of the sequence, and repaint.
-
setImage()
- Sets the image to null, effectively clearing the GIFCanvas
-
setImage(byte[])
- Sets an image, represented by the byte array parameter of this method.
-
setImage(File)
- Sets an image, represented by the File parameter of this method.
-
setImage(URL)
- Sets an image, represented by the URL parameter of this method.
-
start()
- Once an image is set, either in the constructor o by using a
setImage method, calling start() starts the animation.
-
stop()
- Calling this method stops the animation.
-
update(Graphics)
-
GIFCanvas
public GIFCanvas()
- This no-argument constructor creates an empty GIFCanvas, sized 0x0.
GIFCanvas
public GIFCanvas(URL url) throws Exception
- Creates a GIFCanvas displaying the image specified with the URL
parameter.
- Parameters:
- url - The URL of the image to be displayed.
- Throws: Exception
- thrown if the GIF file cannot be read or converted into an image.
GIFCanvas
public GIFCanvas(File file) throws Exception
- Creates a GIFCanvas displaying the image specified with the File
parameter.
- Parameters:
- file - A File object representing the image to be displayed.
- Throws: Exception
- thrown if the GIF file cannot be read or converted into an image.
GIFCanvas
public GIFCanvas(byte gifBytes[]) throws Exception
- Creates a GIFCanvas displaying the image represented by the byte[]
parameter.
- Parameters:
- gifBytes - A byte array representing the GIF's bytes.
- Throws: Exception
- thrown if the byte array cannot be converted into an image.
setImage
public void setImage()
- Sets the image to null, effectively clearing the GIFCanvas
setImage
public void setImage(URL url) throws Exception
- Sets an image, represented by the URL parameter of this method.
- Parameters:
- url - The URL of the image to be displayed.
- Throws: Exception
- thrown if the GIF file cannot be read or converted into an image.
setImage
public void setImage(File file) throws Exception
- Sets an image, represented by the File parameter of this method.
- Parameters:
- url - The File object representing the image to be displayed.
- Throws: Exception
- thrown if the GIF file cannot be read or converted into an image.
setImage
public void setImage(byte byteArray[]) throws Exception
- Sets an image, represented by the byte array parameter of this method.
- Parameters:
- byteArray - The byte array representing the image to be displayed.
- Throws: Exception
- thrown if the byte array cannot be converted into an image.
preferredSize
public Dimension preferredSize()
- Overrides:
- preferredSize in class Component
minimumSize
public Dimension minimumSize()
- Overrides:
- minimumSize in class Component
start
public synchronized void start()
- Once an image is set, either in the constructor o by using a
setImage method, calling start() starts the animation.
stop
public synchronized void stop()
- Calling this method stops the animation.
run
public final void run()
paint
public synchronized void paint(Graphics g)
- Overrides:
- paint in class Canvas
update
public void update(Graphics g)
- Overrides:
- update in class Component
finalize
protected void finalize() throws Throwable
- Used to free graphics resources, flush image frames and
try to be as well-behaved as possible.
- Throws: Throwable
- [Need Description!]
- Overrides:
- finalize in class Object
getCurrentFrame
public int getCurrentFrame()
- Return an index to the currently displayed frame of the
GIF, primarily for use by subclasses to perform some kind
of special action depending on the frame that is visible.
setCurrentFrame
public void setCurrentFrame(int num)
- Set the current frame index of the sequence, and repaint. Forces
GIFCanvas to display a particular frame of the animated GIF, possibly
in response to some user action, intended for use by subclasses.
isStopped
public boolean isStopped()
- Used to determine if the current animation loop is running.
- Returns:
- true if stopped, false if running
All Packages Class Hierarchy This Package Previous Next Index