|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sdm.quasar.client.swing.common.util.ImageCache
An image cache, that stores ImageIcon used by an
application so, that thei will be freeed from memory, when the memory
runs out of space and will be recreated, when used again.
| Nested Class Summary | |
static class |
ImageCache.ImageCreator
This class holds an image with a soft reference to it. |
| Constructor Summary | |
ImageCache()
Creates a new ImageCache. |
|
| Method Summary | |
void |
clearImageReference(java.lang.String name)
Frees up the space consumed by the image specified within the image cache. |
static ImageCache |
getGlobalImageCache()
Returns a global ImageCache instance. |
javax.swing.ImageIcon |
getImageIcon(java.lang.String name)
Returns an image with the unique name given from the cache. |
void |
registerImageCreator(java.lang.String name,
ImageCache.ImageCreator imageCreator)
Registers an ImageCache.ImageCreator for the given image name. |
void |
removeImageCreator(java.lang.String name)
Removes a previously registered ImageCache.ImageCreator from this
ImageCache. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ImageCache()
ImageCache.
| Method Detail |
public javax.swing.ImageIcon getImageIcon(java.lang.String name)
#registerImageCreator(String,ImageCreator) is
called before. If this is not the case, null will
be returned.
name - the name of the ImageIcon to return
ImageIcon created or null, if no
valid ImageCache.ImageCreator was registered for the image name.public void clearImageReference(java.lang.String name)
getImageIcon(String), it
well reallocate the memory needed.
name - the name of the ImageIcon to clear
public void registerImageCreator(java.lang.String name,
ImageCache.ImageCreator imageCreator)
ImageCache.ImageCreator for the given image name.
name - the image name to register the ImageCache.ImageCreator underimageCreator - the ImageCache.ImageCreator to be used for the namepublic void removeImageCreator(java.lang.String name)
ImageCache.ImageCreator from this
ImageCache.
name - the unique name of the image to remove a ImageCache.ImageCreator
forpublic static ImageCache getGlobalImageCache()
ImageCache instance.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||