Package jexer.bits

Class Animation


  • public class Animation
    extends java.lang.Object
    An animation that can be displayed in an image.
    • Constructor Summary

      Constructors 
      Constructor Description
      Animation​(java.util.List<java.awt.image.BufferedImage> frames, int frameDelay, int frameLoops)
      Public constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int count()
      Get the number of frames in this animation.
      int currentFrameNumber()
      Get the number of the current frame in view.
      java.awt.image.BufferedImage getFrame()
      Get the frame currently in view.
      java.awt.image.BufferedImage getFrame​(int frameNumber)
      Get a frame by number.
      boolean isRunning()
      Check if this animation is running.
      void reset()
      Reset the animation.
      void start​(TApplication application)
      Start the animation.
      void stop()
      Stop the animation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Animation

        public Animation​(java.util.List<java.awt.image.BufferedImage> frames,
                         int frameDelay,
                         int frameLoops)
        Public constructor.
        Parameters:
        frames - the frames
        frameDelay - the number of millis to wait until next animation frame
        frameLoops - the number of times to loop the animation. 0 means play it once. -1 means to play it forever.
    • Method Detail

      • isRunning

        public boolean isRunning()
        Check if this animation is running.
        Returns:
        true if the animation is running
      • start

        public void start​(TApplication application)
        Start the animation.
        Parameters:
        application - the application
      • stop

        public void stop()
        Stop the animation.
      • reset

        public void reset()
        Reset the animation.
      • count

        public int count()
        Get the number of frames in this animation.
        Returns:
        the number of frames
      • currentFrameNumber

        public int currentFrameNumber()
        Get the number of the current frame in view.
        Returns:
        the frame number
      • getFrame

        public java.awt.image.BufferedImage getFrame​(int frameNumber)
        Get a frame by number.
        Parameters:
        frameNumber - the frame number
        Returns:
        the frame
      • getFrame

        public java.awt.image.BufferedImage getFrame()
        Get the frame currently in view.
        Returns:
        the frame