public class ThumbnailHandler extends Object implements Runnable, TransformListener
Modifier and Type | Field and Description |
---|---|
protected ThumbnailCache |
cache
Thumbnail disk cache for faster thumbnail retrieval.
|
protected int |
count
Number of thumbnails that have been generated.
|
protected DataTransform |
data
Data transform on which this thumbnail handler operates.
|
protected boolean |
global
Flag indicating cache string ids are for use in default, global cache.
|
protected Thread |
loader
Background thumbnail generation thread.
|
protected boolean |
on
Flag indicating background thumbnail generation is enabled.
|
protected int[] |
resolution
Resolution of each thumbnail dimension.
|
protected FlatField[] |
thumbs
Thumbnail data computed from data transform.
|
protected TaskManager |
tm
Task manager used for reporting background thumbnail generation progress.
|
Constructor and Description |
---|
ThumbnailHandler(DataTransform data,
String filename)
Creates a thumbnail handler.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears thumbnails from memory, restarting background generation if
auto-generation is enabled.
|
protected FlatField |
computeThumb(int[] pos)
Computes a thumbnail for the given dimensional position.
|
ThumbnailCache |
getCache()
Gets the associated thumbnail disk cache object.
|
FlatField |
getThumb(int[] pos)
Gets the thumbnail at the given dimensional position.
|
protected void |
loadThumb(int i)
Computes the ith thumbnail.
|
FlatField |
makeThumb(Data d)
Creates an image thumbnail from the given data.
|
void |
run()
Loads all thumbnails in the background.
|
void |
setResolution(int[] res)
Sets resolution of computed thumbnails.
|
void |
setTaskManager(TaskManager tm)
Sets the task manager to use for reporting thumbnail generation progress.
|
void |
setThumb(int[] pos,
FlatField thumb)
Sets the thumbnail at the given dimensional position.
|
void |
toggleGeneration(boolean on)
Starts or stops background thumbnail generation.
|
void |
transformChanged(TransformEvent e)
Handles data transform parameter changes.
|
protected DataTransform data
protected int[] resolution
protected FlatField[] thumbs
protected ThumbnailCache cache
protected boolean global
protected TaskManager tm
protected Thread loader
protected int count
protected boolean on
public ThumbnailHandler(DataTransform data, String filename)
public FlatField getThumb(int[] pos)
public void setThumb(int[] pos, FlatField thumb)
public void setResolution(int[] res)
public void toggleGeneration(boolean on)
public void clear()
public void setTaskManager(TaskManager tm)
public ThumbnailCache getCache()
protected void loadThumb(int i)
protected FlatField computeThumb(int[] pos)
public void run()
public void transformChanged(TransformEvent e)
transformChanged
in interface TransformListener
Copyright © 2015–2022 SciJava. All rights reserved.