📄 com.kcmultimedia.gifcanvas.gifcanvas.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Tue Aug 04 23:24:55 EDT 1998 -->
<title>
Class com.kcmultimedia.gifcanvas.GIFCanvas
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-com.kcmultimedia.gifcanvas.html">This Package</a> <a href="Package-com.kcmultimedia.gifcanvas.html">Previous</a> <a href="com.kcmultimedia.gifcanvas.GIFFrame.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
Class com.kcmultimedia.gifcanvas.GIFCanvas
</h1>
<pre>
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----com.kcmultimedia.gifcanvas.GIFCanvas
</pre>
<hr>
<dl>
<dt> public class <b>GIFCanvas</b>
<dt> extends Canvas
<dt> implements Runnable
</dl>
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.
<p>
<hr>
<a name="index"></a>
<h2>
<img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
<dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#GIFCanvas()"><b>GIFCanvas</b></a>()
<dd> This no-argument constructor creates an empty GIFCanvas, sized 0x0.
<dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#GIFCanvas(byte[])"><b>GIFCanvas</b></a>(byte[])
<dd> Creates a GIFCanvas displaying the image represented by the byte[] parameter.
<dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#GIFCanvas(java.io.File)"><b>GIFCanvas</b></a>(File)
<dd> Creates a GIFCanvas displaying the image specified with the File parameter.
<dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#GIFCanvas(java.net.URL)"><b>GIFCanvas</b></a>(URL)
<dd> Creates a GIFCanvas displaying the image specified with the URL parameter.
</dl>
<h2>
<img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#finalize()"><b>finalize</b></a>()
<dd> Used to free graphics resources, flush image frames and try to be as well-behaved as possible.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getCurrentFrame()"><b>getCurrentFrame</b></a>()
<dd> 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.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#isStopped()"><b>isStopped</b></a>()
<dd> Used to determine if the current animation loop is running.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#minimumSize()"><b>minimumSize</b></a>()
<dd>
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#paint(java.awt.Graphics)"><b>paint</b></a>(Graphics)
<dd>
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#preferredSize()"><b>preferredSize</b></a>()
<dd>
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#run()"><b>run</b></a>()
<dd>
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#setCurrentFrame(int)"><b>setCurrentFrame</b></a>(int)
<dd> Set the current frame index of the sequence, and repaint.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#setImage()"><b>setImage</b></a>()
<dd> Sets the image to null, effectively clearing the GIFCanvas
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#setImage(byte[])"><b>setImage</b></a>(byte[])
<dd> Sets an image, represented by the byte array parameter of this method.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#setImage(java.io.File)"><b>setImage</b></a>(File)
<dd> Sets an image, represented by the File parameter of this method.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#setImage(java.net.URL)"><b>setImage</b></a>(URL)
<dd> Sets an image, represented by the URL parameter of this method.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#start()"><b>start</b></a>()
<dd> Once an image is set, either in the constructor o by using a setImage method, calling start() starts the animation.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#stop()"><b>stop</b></a>()
<dd> Calling this method stops the animation.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#update(java.awt.Graphics)"><b>update</b></a>(Graphics)
<dd>
</dl>
<a name="constructors"></a>
<h2>
<img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="GIFCanvas"></a>
<a name="GIFCanvas()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>GIFCanvas</b>
<pre>
public GIFCanvas()
</pre>
<dl>
<dd> This no-argument constructor creates an empty GIFCanvas, sized 0x0.
<p>
</dl>
<a name="GIFCanvas(java.net.URL)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>GIFCanvas</b>
<pre>
public GIFCanvas(URL url) throws Exception
</pre>
<dl>
<dd> Creates a GIFCanvas displaying the image specified with the URL parameter. <p>
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> url - The URL of the image to be displayed.
<dt> <b>Throws:</b> Exception
<dd> thrown if the GIF file cannot be read or converted into an image.
</dl></dd>
</dl>
<a name="GIFCanvas(java.io.File)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>GIFCanvas</b>
<pre>
public GIFCanvas(File file) throws Exception
</pre>
<dl>
<dd> Creates a GIFCanvas displaying the image specified with the File parameter. <p>
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> file - A File object representing the image to be displayed.
<dt> <b>Throws:</b> Exception
<dd> thrown if the GIF file cannot be read or converted into an image.
</dl></dd>
</dl>
<a name="GIFCanvas(byte[])"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>GIFCanvas</b>
<pre>
public GIFCanvas(byte gifBytes[]) throws Exception
</pre>
<dl>
<dd> Creates a GIFCanvas displaying the image represented by the byte[] parameter. <p>
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> gifBytes - A byte array representing the GIF's bytes.
<dt> <b>Throws:</b> Exception
<dd> thrown if the byte array cannot be converted into an image.
</dl></dd>
</dl>
<a name="methods"></a>
<h2>
<img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="setImage()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setImage"><b>setImage</b></a>
<pre>
public void setImage()
</pre>
<dl>
<dd> Sets the image to null, effectively clearing the GIFCanvas
<p>
</dl>
<a name="setImage(java.net.URL)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setImage"><b>setImage</b></a>
<pre>
public void setImage(URL url) throws Exception
</pre>
<dl>
<dd> Sets an image, represented by the URL parameter of this method. <p>
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> url - The URL of the image to be displayed.
<dt> <b>Throws:</b> Exception
<dd> thrown if the GIF file cannot be read or converted into an image.
</dl></dd>
</dl>
<a name="setImage(java.io.File)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setImage"><b>setImage</b></a>
<pre>
public void setImage(File file) throws Exception
</pre>
<dl>
<dd> Sets an image, represented by the File parameter of this method. <p>
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> url - The File object representing the image to be displayed.
<dt> <b>Throws:</b> Exception
<dd> thrown if the GIF file cannot be read or converted into an image.
</dl></dd>
</dl>
<a name="setImage(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setImage"><b>setImage</b></a>
<pre>
public void setImage(byte byteArray[]) throws Exception
</pre>
<dl>
<dd> Sets an image, represented by the byte array parameter of this method. <p>
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> byteArray - The byte array representing the image to be displayed.
<dt> <b>Throws:</b> Exception
<dd> thrown if the byte array cannot be converted into an image.
</dl></dd>
</dl>
<a name="preferredSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="preferredSize"><b>preferredSize</b></a>
<pre>
public Dimension preferredSize()
</pre>
<dl>
<dd><dl>
<dt> <b>Overrides:</b>
<dd> <a href="java.awt.Component.html#preferredSize()">preferredSize</a> in class Component
</dl></dd>
</dl>
<a name="minimumSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="minimumSize"><b>minimumSize</b></a>
<pre>
public Dimension minimumSize()
</pre>
<dl>
<dd><dl>
<dt> <b>Overrides:</b>
<dd> <a href="java.awt.Component.html#minimumSize()">minimumSize</a> in class Component
</dl></dd>
</dl>
<a name="start()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="start"><b>start</b></a>
<pre>
public synchronized void start()
</pre>
<dl>
<dd> Once an image is set, either in the constructor o by using a setImage method, calling start() starts the animation.
<p>
</dl>
<a name="stop()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="stop"><b>stop</b></a>
<pre>
public synchronized void stop()
</pre>
<dl>
<dd> Calling this method stops the animation.
<p>
</dl>
<a name="run()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="run"><b>run</b></a>
<pre>
public final void run()
</pre>
<a name="paint(java.awt.Graphics)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="paint"><b>paint</b></a>
<pre>
public synchronized void paint(Graphics g)
</pre>
<dl>
<dd><dl>
<dt> <b>Overrides:</b>
<dd> <a href="java.awt.Canvas.html#paint(java.awt.Graphics)">paint</a> in class Canvas
</dl></dd>
</dl>
<a name="update(java.awt.Graphics)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="update"><b>update</b></a>
<pre>
public void update(Graphics g)
</pre>
<dl>
<dd><dl>
<dt> <b>Overrides:</b>
<dd> <a href="java.awt.Component.html#update(java.awt.Graphics)">update</a> in class Component
</dl></dd>
</dl>
<a name="finalize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="finalize"><b>finalize</b></a>
<pre>
protected void finalize() throws Throwable
</pre>
<dl>
<dd> Used to free graphics resources, flush image frames and try to be as well-behaved as possible.
<p>
<dd><dl>
<dt> <b>Throws:</b> Throwable
<dd> [Need Description!]
<dt> <b>Overrides:</b>
<dd> <a href="java.lang.Object.html#finalize()">finalize</a> in class Object
</dl></dd>
</dl>
<a name="getCurrentFrame()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getCurrentFrame"><b>getCurrentFrame</b></a>
<pre>
public int getCurrentFrame()
</pre>
<dl>
<dd> 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.
<p>
</dl>
<a name="setCurrentFrame(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setCurrentFrame"><b>setCurrentFrame</b></a>
<pre>
public void setCurrentFrame(int num)
</pre>
<dl>
<dd> 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.
<p>
</dl>
<a name="isStopped()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="isStopped"><b>isStopped</b></a>
<pre>
public boolean isStopped()
</pre>
<dl>
<dd> Used to determine if the current animation loop is running.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> true if stopped, false if running
</dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-com.kcmultimedia.gifcanvas.html">This Package</a> <a href="Package-com.kcmultimedia.gifcanvas.html">Previous</a> <a href="com.kcmultimedia.gifcanvas.GIFFrame.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -