apg_config
Class APGImageCacheManager

java.lang.Object
apg_config.APGImageCacheManager
- All Implemented Interfaces:
- java.lang.Runnable
- public class APGImageCacheManager
- extends java.lang.Object
- implements java.lang.Runnable
An simple cache system for images files. This system stores pictures in a cache that
persists. The SIZE_xxxx constants defines the supported cache sizes.
The only optimization that is performed is the construction of smaller cache entries from
their next highest image size. For example, if the 800x600 size is present and a request
is made for the 320x240 size, that cache entry will be constructed from the 640x480 image - but
since that does not exist, it'll be constructed from the 800x600 image.
If this proves tooooo slow, I might change it to pass-thru the construction properly, so that
in the above request the 640x480 cache entry is created in the process!
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TOTAL
protected static final int TOTAL
- See Also:
- Constant Field Values
entry
private APGEntry entry
cacheDir
private java.io.File cacheDir
mainThread
private java.lang.Thread mainThread
continueMainThread
private boolean continueMainThread
cache
private APGImageCache[] cache
listener
private APGImageCacheManagerListener listener
threadGroup
private java.lang.ThreadGroup threadGroup
requestList
private java.util.SortedMap requestList
threadList
private java.util.Map threadList
broken
private java.awt.Image broken
loading
private java.awt.Image loading
dirNames
private static final java.lang.String[] dirNames
cacheSizes
private static final int[] cacheSizes
SIZE_48
public static final int SIZE_48
- See Also:
- Constant Field Values
SIZE_64
public static final int SIZE_64
- See Also:
- Constant Field Values
SIZE_96
public static final int SIZE_96
- See Also:
- Constant Field Values
SIZE_120
public static final int SIZE_120
- See Also:
- Constant Field Values
APGImageCacheManager
public APGImageCacheManager(APGEntry e)
initialise
public boolean initialise()
shutdown
public void shutdown()
cancelAllRequests
public void cancelAllRequests()
- Shut down all existing threads!
run
public void run()
- Description copied from interface:
java.lang.Runnable
- This method will be called by whoever wishes to run your class
implementing Runnable. Note that there are no restrictions on what
you are allowed to do in the run method, except that you cannot
throw a checked exception.
- Specified by:
run in interface java.lang.Runnable
getWidth
public static int getWidth(int size)
setAPGImageCacheManagerListener
public void setAPGImageCacheManagerListener(APGImageCacheManagerListener l)
destroyCacheFiles
public boolean destroyCacheFiles(int size)
isImageIconQueued
public boolean isImageIconQueued(APGEntryItem item,
int size)
isImageIconProcessing
public boolean isImageIconProcessing(APGEntryItem item,
int size)
queueImageIcon
public void queueImageIcon(APGEntryItem item,
int size)
getImage
public java.awt.Image getImage(APGEntryItem item,
int size)