Class ImageSequence
All Packages Class Hierarchy This Package Previous Next Index
Class ImageSequence
public class netscape.application.ImageSequence
extends netscape.application.DrawingSequence
{
/* Constructors
*/
public ImageSequence();
public ImageSequence(DrawingSequenceOwner);
/* Methods
*/
public void addImage(Image);
public void addImagesFromName(String, int);
public Image currentImage();
public void decode(Decoder);
public void describeClassInfo(ClassInfo);
public void drawAt(Graphics, int, int);
public void drawScaled(Graphics, int, int, int, int);
public void encode(Encoder);
public int frameHeight();
public int frameWidth();
public int height();
public int imageCount();
public Image imageStrip();
public Vector images();
public Size maxSize();
public void removeAllImages();
public void removeImage(Image);
public void setCurrentImageNumber(int);
public void setFrameHeight(int);
public void setFrameWidth(int);
public void setImageStrip(Image);
public int width();
}
DrawingSequence subclass that animates a collection of Images (Bitmaps or
other). You can add one or more Images to an ImageSequence by hand, or
if you're working with a number of Bitmaps that share the same name except
for a number suffix (i.e. Ball0, Ball1, Ball2, etc.), you can provide
the ImageSequence with the first Bitmap name and a count, and the
ImageSequence will load each Bitmap itself. ImageSequences can also
produce an animation from a single Image that contains a number of frames
(oriented either vertically or horizontally). Given an "Image strip" Image
and a frame width or height, the ImageSequence will treat and display
portions of the single Image as individual frames.
Constructors
ImageSequence
public ImageSequence()
- Constructs an ImageSequence without an owner.
ImageSequence
public ImageSequence(DrawingSequenceOwner owner)
- Constructs an ImageSequence with owner owner, a frame
rate of 1 millisecond, current frame number of 0, and a direction of
FORWARD.
Methods
images
public Vector images()
- Returns the ImageSequence's collection of Images.
addImage
public void addImage(Image anImage)
- Adds anImage to the ImageSequence's collection of Images.
addImagesFromName
public void addImagesFromName(String firstImageName,
int count)
- Adds a sequence of Bitmaps with the same name but different number
suffixes, such as Ball0, Ball1, Ball2, and so on.
firstImageName should be the full name of the first Bitmap
(Ball0, in this case), and count should be the total number of
images to add, including the first one. If the Images are named
"Ball0," "Ball1," "Ball2," and "Ball3," count should be 4.
Calls Bitmap.bitmapNamed() to locate the named Bitmaps.
removeImage
public void removeImage(Image anImage)
- Removes anImage from the ImageSequence's collection of
Images.
removeAllImages
public void removeAllImages()
- Empties the ImageSequence of Images and clears its Image strip.
setImageStrip
public void setImageStrip(Image anImage)
- Sets the Image from which the ImageSequence should extract individual
frames. You set the strip's orientation and frame size through the
setFrameWidth() or setFrameHeight() methods.
- See Also:
- setFrameWidth, setFrameHeight
imageStrip
public Image imageStrip()
- Returns the ImageSequence's Image strip.
- See Also:
- setImageStrip
setFrameWidth
public void setFrameWidth(int pixels)
- Configures the ImageSequence to extract frames horizontally, assuming a
frame width of pixels.
- See Also:
- setImageStrip
frameWidth
public int frameWidth()
- Returns the ImageSequence's frame width.
- See Also:
- setFrameWidth
setFrameHeight
public void setFrameHeight(int pixels)
- Configures the ImageSequence to extract frames vertically, assuming a
frame height of pixels.
- See Also:
- setImageStrip
frameHeight
public int frameHeight()
- Returns the ImageSequence's frame height.
- See Also:
- setFrameHeight
imageCount
public int imageCount()
- Returns the number of Images (or frames, in the case of an Image
strip) that the ImageSequence will display.
setCurrentImageNumber
public void setCurrentImageNumber(int imageNumber)
- Sets the ImageSequence to display Image number imageNumber.
currentImage
public Image currentImage()
- Returns the current Image being displayed by the ImageSequence, or
its entire Image strip if configured to use one.
maxSize
public Size maxSize()
- Returns the unioned Size of the ImageSequence's Images (the minimum
area required to fully display each Image).
width
public int width()
- Returns the width of the ImageSequence's tallest Image.
- Overrides:
- width in class DrawingSequence
height
public int height()
- Returns the height of the ImageSequence's tallest Image.
- Overrides:
- height in class DrawingSequence
drawAt
public void drawAt(Graphics g,
int x,
int y)
- Draws the ImageSequence's current Image at (x, y).
- Overrides:
- drawAt in class DrawingSequence
drawScaled
public void drawScaled(Graphics g,
int x,
int y,
int width,
int height)
- Draws the ImageSequence's current Image, scaled to fit the supplied
rectangle.
- Overrides:
- drawScaled in class Image
describeClassInfo
public void describeClassInfo(ClassInfo info)
- Describes the ImageSequence class' coding information.
- Overrides:
- describeClassInfo in class DrawingSequence
- See Also:
- describeClassInfo
encode
public void encode(Encoder encoder) throws CodingException
- Encodes the ImageSequence.
- Overrides:
- encode in class DrawingSequence
- See Also:
- encode
decode
public void decode(Decoder decoder) throws CodingException
- Decodes the ImageSequence.
- Overrides:
- decode in class DrawingSequence
- See Also:
- decode
All Packages Class Hierarchy This Package Previous Next Index