|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectj2d.io.gif.gifAnimation.Gif89Frame
public abstract class Gif89Frame
First off, just to dispel any doubt, this class and its subclasses have nothing to do with GUI "frames" such as java.awt.Frame. We merely use the term in its very common sense of a still picture in an animation sequence. It's hoped that the restricted context will prevent any confusion.
An instance of this class is used in conjunction with a Gif89Encoder object to represent and encode a single static image and its associated "control" data. A Gif89Frame doesn't know or care whether it is encoding one of the many animation frames in a GIF movie, or the single bitmap in a "normal" GIF. (FYI, this design mirrors the encoded GIF structure.)
Since Gif89Frame is an abstract class we don't instantiate it directly, but instead create instances of its concrete subclasses, IndexGif89Frame and DirectGif89Frame. From the API standpoint, these subclasses differ only in the sort of data their instances are constructed from. Most folks will probably work with DirectGif89Frame, since it can be constructed from a java.awt.Image object, but the lower-level IndexGif89Frame class offers advantages in specialized circumstances. (Of course, in routine situations you might not explicitly instantiate any frames affineTransform all, instead letting Gif89Encoder's convenience methods do the honors.)
As far as the public API is concerned, objects in the Gif89Frame hierarchy interact with a Gif89Encoder only via the latter's methods for adding and querying frames. (As a side note, you should know that while Gif89Encoder objects are permanently modified by the addition of Gif89Frames, the reverse is NOT true. That is, even though the ultimate encoding of a Gif89Frame may be affected by the context its parent encoder object provides, it retains its original condition and can be reused in a different context.)
The core pixel-encoding code in this class was essentially lifted from Jef Poskanzer's well-known Acme GifEncoder, so please see the readme containing his notice.
Gif89Encoder
,
DirectGif89Frame
,
IndexGif89Frame
Field Summary | |
---|---|
static int |
DM_BGCOLOR
The animated GIF renderer shall replace this Gif89Frame's area with the background color. |
static int |
DM_LEAVE
The animated GIF renderer shall take no display-disposal action. |
static int |
DM_REVERT
The animated GIF renderer shall replace this Gif89Frame's area with the previous frame's bitmap. |
static int |
DM_UNDEFINED
The animated GIF renderer shall decide how to dispose of this Gif89Frame's display area. |
Method Summary | |
---|---|
void |
setDelay(int interval)
Set the between-frame interval. |
void |
setDisposalMode(int code)
Setting this option determines (in a cooperative GIF-viewer) what will be done with this frame's display area before the subsequent frame is displayed. |
void |
setInterlaced(boolean b)
Set or clear the interlace flag. |
void |
setPosition(java.awt.Point p)
Set the position of this frame within a larger animation display space. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DM_UNDEFINED
setDisposalMode(int)
,
Constant Field Valuespublic static final int DM_LEAVE
setDisposalMode(int)
,
Constant Field Valuespublic static final int DM_BGCOLOR
setDisposalMode(int)
,
Constant Field Valuespublic static final int DM_REVERT
setDisposalMode(int)
,
Constant Field ValuesMethod Detail |
---|
public void setPosition(java.awt.Point p)
p
- Coordinates of the frame's upper left corner in the display space.
(Default: The logical display's origin [0, 0])Gif89Encoder.setLogicalDisplay(java.awt.Dimension, int)
public void setInterlaced(boolean b)
b
- true if you want interlacing. (Default: false)public void setDelay(int interval)
interval
- Centiseconds to wait before displaying the subsequent frame.
(Default: 0)public void setDisposalMode(int code)
code
- One of the four int constants of the Gif89Frame.DM_* series.
(Default: DM_LEAVE)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |