com.sdm.quasar.client.swing.common.util
Class ImageCache.ImageCreator

java.lang.Object
  extended bycom.sdm.quasar.client.swing.common.util.ImageCache.ImageCreator
Enclosing class:
ImageCache

public abstract static class ImageCache.ImageCreator
extends java.lang.Object

This class holds an image with a soft reference to it. The class is abstract, because the first time - or after removing the image from the cache - the image must be (re)created. This must be done by the {@link #createImageIcon() method.

Version:
1.$Revision: 1.2 $
Author:
Thomas Wolf

Constructor Summary
ImageCache.ImageCreator()
           
 
Method Summary
 void clearImageReference()
          Clears the reference to the last created ImageIcon to free up the space consumed by the image and force reallocation of the image the next time it is queried.
abstract  javax.swing.ImageIcon createImageIcon()
          Creates a new ImageIcon instance.
 javax.swing.ImageIcon getImageIcon()
          Returns the ImageIcon referred.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageCache.ImageCreator

public ImageCache.ImageCreator()
Method Detail

createImageIcon

public abstract javax.swing.ImageIcon createImageIcon()
Creates a new ImageIcon instance. The implementor of this method should not store the refernce returned anywhere!


getImageIcon

public final javax.swing.ImageIcon getImageIcon()
Returns the ImageIcon referred. This is eighter a previously created ImageIcon instance, or a newly created.


clearImageReference

public final void clearImageReference()
Clears the reference to the last created ImageIcon to free up the space consumed by the image and force reallocation of the image the next time it is queried.