Class ThumbnailThread
- java.lang.Object
-
- java.lang.Thread
-
- elki.visualization.visualizers.thumbs.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.
-
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.
-
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
-
-
-
-
Field Detail
-
queue
private java.util.Queue<ThumbnailThread.Task> queue
Queue of thumbnails to generate.
-
shutdown
private boolean shutdown
Flag to signal shutdown.
-
THREAD
private static ThumbnailThread THREAD
The static thumbnail thread.
-
-
Method Detail
-
queue
public static ThumbnailThread.Task queue(ThumbnailThread.Listener callback)
Queue a thumbnail task in a global thumbnail thread.- Parameters:
callback
- Callback
-
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 interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
-