Class ThumbnailThread

  • All Implemented Interfaces:
    java.lang.Runnable

    public class ThumbnailThread
    extends java.lang.Thread
    Thread to render thumbnails in the background.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  ThumbnailThread.Listener
      Listener interface for completed thumbnails.
      static class  ThumbnailThread.Task
      A single thumbnailer task.
      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Queue<ThumbnailThread.Task> queue
      Queue of thumbnails to generate.
      private boolean shutdown
      Flag to signal shutdown.
      private static ThumbnailThread THREAD
      The static thumbnail thread.
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      ThumbnailThread()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void generateThumbnail​(ThumbnailThread.Task ti)
      Generate a single Thumbnail.
      static ThumbnailThread.Task queue​(ThumbnailThread.Listener callback)
      Queue a thumbnail task in a global thumbnail thread.
      void run()  
      static void unqueue​(ThumbnailThread.Task task)
      Remove a pending task from the queue.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • shutdown

        private boolean shutdown
        Flag to signal shutdown.
      • THREAD

        private static ThumbnailThread THREAD
        The static thumbnail thread.
    • Constructor Detail

      • ThumbnailThread

        public ThumbnailThread()
    • Method Detail

      • unqueue

        public static void unqueue​(ThumbnailThread.Task task)
        Remove a pending task from the queue.
        Parameters:
        task - Task to remove.
      • generateThumbnail

        private void generateThumbnail​(ThumbnailThread.Task ti)
        Generate a single Thumbnail.
        Parameters:
        ti - Visualization task
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread