Class FramedCache

  • All Implemented Interfaces:
    Cache

    public class FramedCache
    extends java.lang.Object
    implements Cache
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ID  
    • Constructor Summary

      Constructors 
      Constructor Description
      FramedCache​(int frameCount, int delayBetweenFrames, java.awt.Dimension dimension, byte[][] cachedFrames)  
    • Constructor Detail

      • FramedCache

        public FramedCache​(int frameCount,
                           int delayBetweenFrames,
                           java.awt.Dimension dimension,
                           byte[][] cachedFrames)
    • Method Detail

      • buildCache

        public static FramedCache buildCache​(de.cerus.jgif.GifImage gifImage,
                                             java.awt.Dimension dimension,
                                             int delay,
                                             NmsAdapter nmsAdapter)
        Creates a cache of a gif
        Parameters:
        gifImage - The gif
        dimension - The dimension
        nmsAdapter - The nms adapter
        Returns:
        The cache
      • write

        public void write​(java.io.DataOutputStream outputStream)
                   throws java.io.IOException
        Specified by:
        write in interface Cache
        Throws:
        java.io.IOException
      • read

        public void read​(java.io.DataInputStream inputStream)
                  throws java.io.IOException
        Specified by:
        read in interface Cache
        Throws:
        java.io.IOException
      • resize

        public void resize​(java.awt.Dimension newDimension)
        Resizes the cache Warning: Caches can only be made bigger! Making a cache smaller will *not* work.
        Parameters:
        newDimension - The new dimension
      • getFrameCount

        public int getFrameCount()
      • getCachedFrames

        public byte[][] getCachedFrames()
      • getDimension

        public java.awt.Dimension getDimension()
      • getDelayBetweenFrames

        public int getDelayBetweenFrames()
      • getId

        public int getId()
        Specified by:
        getId in interface Cache