org.dishevelled.iconbundle.impl
Class CachingIconBundle

java.lang.Object
  extended by org.dishevelled.iconbundle.impl.CachingIconBundle
All Implemented Interfaces:
IconBundle

public class CachingIconBundle
extends java.lang.Object
implements IconBundle

Wrapper around an existing implementation of IconBundle that caches images.

Version:
$Revision: 404 $ $Date: 2008-01-02 13:19:59 -0600 (Wed, 02 Jan 2008) $
Author:
Michael Heuer

Constructor Summary
CachingIconBundle(IconBundle iconBundle)
          Create a new caching icon bundle which wraps the specified icon bundle.
 
Method Summary
 java.awt.Image getImage(java.awt.Component component, IconTextDirection direction, IconState state, IconSize size)
          Return an icon image in the specified icon text direction, size, and state suitable for the specified component.
 void invalidateCache()
          Invalidate the cache of images.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingIconBundle

public CachingIconBundle(IconBundle iconBundle)
Create a new caching icon bundle which wraps the specified icon bundle.

Parameters:
iconBundle - icon bundle to wrap, must not be null
Method Detail

invalidateCache

public void invalidateCache()
Invalidate the cache of images.


getImage

public java.awt.Image getImage(java.awt.Component component,
                               IconTextDirection direction,
                               IconState state,
                               IconSize size)
Return an icon image in the specified icon text direction, size, and state suitable for the specified component. The specified AWT or Swing component may be null.

Specified by:
getImage in interface IconBundle
Parameters:
component - AWT or Swing component hint, if any
direction - icon text direction, must not be null
state - icon state, must not be null
size - icon size, must not be null
Returns:
an icon image suitable for the specified component


Copyright (c) 2003-2008 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).