|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
net.sourceforge.jsh3modtool.gui.imagetable.cache.ThumbnailLoader
public class ThumbnailLoader
Thread to load thumbnails. To lessen the load of the thread that reads/creates ImageBoxes Singleton behaviour
Nested Class Summary | |
---|---|
protected class |
ThumbnailLoader.ThumbnailQueueItem
A queue item that contains a viewer and a image properties object. |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
protected |
ThumbnailLoader()
Creates a thumbnail loader. |
Method Summary | |
---|---|
void |
add(ImageModel imageProps,
ThumbnailViewer viewer)
Add an ImageProperties and a ThumbnailViewer to the queue. |
void |
addFirst(ImageModel imageProps,
ThumbnailViewer viewer)
Add an ImageProperties and a ThumbnailViewer to the the begining of the queue. |
void |
clear()
Removes all ThumbnailViewers from the queue |
boolean |
contains(ImageModel imageProps)
Returns true if the queue contains the specified object. |
void |
increasePriority(ImageModel imageProps)
Increase the priority of the specified item. |
void |
increasePriority(ThumbnailViewer viewer)
Increase the priority of the specified item |
static ThumbnailLoader |
instance()
Returns the singleton instance of this class. |
int |
queueSize()
Returns the size of the queue. |
void |
remove(ImageModel imageProps)
Removes the specified object from the queue. |
void |
remove(ThumbnailViewer viewer)
Removes the specified object from the queue. |
void |
removeFirst()
Removes the first queue item. |
void |
removeLast()
Removes the last queue item. |
void |
run()
Thread run method, waits for items on the queue, removes it and reads the thumbnail for it and returns it to the listener |
void |
startLoading()
Starts the Thumbnail loading thread (if it hasnt been started |
void |
stopLoading()
Stops the Thumbnail loading thread, does not wait until the thread is dead |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ThumbnailLoader()
Method Detail |
---|
public static ThumbnailLoader instance()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void startLoading()
public void stopLoading()
public void clear()
public void add(ImageModel imageProps, ThumbnailViewer viewer)
imageProps
- the image props.viewer
- the viewer.public void addFirst(ImageModel imageProps, ThumbnailViewer viewer)
imageProps
- the image props.viewer
- the viewer.public void removeFirst()
public void removeLast()
public void increasePriority(ThumbnailViewer viewer)
viewer
- the thumbnail viewer object to raise the priority for.public void increasePriority(ImageModel imageProps)
imageProps
- the image properties object to raise the priority for.public boolean contains(ImageModel imageProps)
imageProps
- the image properties to find.
public int queueSize()
public void remove(ThumbnailViewer viewer)
viewer
- the thumbnail viewer.public void remove(ImageModel imageProps)
imageProps
- the image properties to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |