Class GifVideo

All Implemented Interfaces:
PropertyChangeListener, EventListener, Drawable, Interactive, Measurable, DrawableImage, InteractiveImage, Trackable, Video

public class GifVideo extends VideoAdapter
This is a video that wraps an animated gif image.
Version:
1.0
Author:
Douglas Brown
  • Field Details

  • Constructor Details

    • GifVideo

      public GifVideo(String gifName) throws IOException
      Creates a GifVideo and loads a gif image specified by name
      Parameters:
      gifName - the name of the image file
      Throws:
      IOException
  • Method Details

    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Draws the video image on the panel.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class VideoAdapter
      Parameters:
      panel - the drawing panel requesting the drawing
      g - the graphics context on which to draw
    • play

      public void play()
      Plays the video at the current rate.
    • stop

      public void stop()
      Stops the video.
    • setFrameNumber

      public void setFrameNumber(int n)
      Overrides ImageVideo setFrameNumber method.
      Specified by:
      setFrameNumber in interface Video
      Overrides:
      setFrameNumber in class VideoAdapter
      Parameters:
      n - the desired frame number
      See Also:
    • getEndTime

      public double getEndTime()
      Gets the end time in milliseconds.
      Specified by:
      getEndTime in interface Video
      Overrides:
      getEndTime in class VideoAdapter
      Returns:
      the end time in milliseconds, or -1 if not known
    • getFrameCountDurationMS

      public double getFrameCountDurationMS()
      Gets the duration of the video.
      Returns:
      the duration of the video in milliseconds, or -1 if not known
    • load

      protected void load(String gifName) throws IOException
      Loads a gif image specified by name.
      Parameters:
      gifName - the gif image name
      Throws:
      IOException
    • setStartTimes

      protected void setStartTimes()
      Specified by:
      setStartTimes in class VideoAdapter
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load GifVideo data.
      Returns:
      the object loader
    • getTypeName

      public String getTypeName()
      Description copied from interface: Video
      Returns the VideoType name of this video.