Class Filmstrip

  • public class Filmstripextends Object
    A Filmstrip is just a sequence of images. It is possible for some of the images in the Filmstrip to be null. The images are numbered starting at zero. There is no preset limit on the number of images.
    • Constructor Summary

      Constructor and Description
    • Constructor Detail

      • Filmstrip

        public Filmstrip()
    • Method Detail

      • maxFrames

        public static int maxFrames(int width,            int height,            boolean color)
        Attempts to determine how many filmstrip frames an still be created with a specified size. This is not necessarily going to give an exact value; the value is likely to be an underestimate.
        width - the width in pixels of the images
        height - the height in pixels of the images
        color - are the images to be colored (4 bytes per pixel) or black and white (1 byte per pixel)?
        See Also:
      • setFrame

        public void setFrame(int frameNumber,            BufferedImage image)
        Sets a specified frame in the filmstrip to a given image. If frameNumber is less than the current filmstrip size, then the current frame at position frameNumber is replaced. Otherwise the size of the filmstrip is increased to (frameNumber+1) and the image is then stored in position frameNumber as the last frame in the filmstrip. Any extra locations that are created are filled with nulls.
        frameNumber - The position in the filmstrip where the image is to be added. An error occurs if this is less than zero.
        image - The image that is to be put at postion frameNumber in the filmstrip. This can be null.
      • getFrameCount

        public int getFrameCount()
        Returns the current number of frames in the filmstrip.
      • getFrame

        public BufferedImage getFrame(int frameNumber)
        Returns the image at at a specified position in the filmstrip. The return value can be null.
        frameNumber - The number of the frame that is to be returned. An error occurs if this is not greater than or equal to zero and less than getFrameCount().
      • stripNullFrames

        public void stripNullFrames()
        Removes any frames for which the image is null from the filmstrip.

SCaVis 2.2 © jWork.ORG