org.springframework.richclient.image
Class DefaultIconSource

java.lang.Object
  extended by org.springframework.richclient.image.DefaultIconSource
All Implemented Interfaces:
IconSource
Direct Known Subclasses:
ReloadableSizedIconSource

public class DefaultIconSource
extends Object
implements IconSource

The default implementation of ImageIconRegistry. This implementation caches all icons using soft references (TODO it just lazy loads them, but it doesn't use SoftReference). More specifically, cached icons will remain in memory unless there is a shortage of resources in the system.

Author:
Keith Donald

Nested Class Summary
protected static class DefaultIconSource.IconCache
          Icon cache using soft references.
 
Field Summary
protected static org.apache.commons.logging.Log logger
           
 
Constructor Summary
DefaultIconSource()
          Default constructor.
DefaultIconSource(ImageSource images)
          Constructs a icon registry that loads images from the provided source.
 
Method Summary
protected  DefaultIconSource.IconCache cache()
           
 void clear()
           
protected  String doProcessImageKeyBeforeLookup(String key)
           
 Icon getIcon(String key)
          Return an ImageIcon using its String key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger
Constructor Detail

DefaultIconSource

public DefaultIconSource()
Default constructor. Will obtain services dependencies from the ApplicationServices locator.


DefaultIconSource

public DefaultIconSource(ImageSource images)
Constructs a icon registry that loads images from the provided source.

Parameters:
images - the image source.
Method Detail

getIcon

public Icon getIcon(String key)
Description copied from interface: IconSource
Return an ImageIcon using its String key.

Specified by:
getIcon in interface IconSource
Parameters:
key - a key for the icon.
Returns:
The image icon.

clear

public void clear()

doProcessImageKeyBeforeLookup

protected String doProcessImageKeyBeforeLookup(String key)

cache

protected DefaultIconSource.IconCache cache()


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.