org.springframework.richclient.image
Interface ImageSource

All Known Implementing Classes:
DefaultImageSource

public interface ImageSource

A interface for retrieving images by key. The key abstracts away the path to the image resource, effectively acting as an alias. For example, the key wizard.pageImage may map to a image resource in the classpath at /images/wizard/title_banner.gif

Image source implementations are responsible for resolving the underlying image resource and loading it into memory. They may also cache image resources.

Author:
Keith Donald

Method Summary
 Image getImage(String key)
          Loads the image with the specified key.
 AwtImageResource getImageResource(String key)
          Returns the image resource indexed by the specified key.
 

Method Detail

getImage

Image getImage(String key)
Loads the image with the specified key. Caching may or may not be performed.

If the load is successful, the image resource is returned. If the load fails, a broken image indicator is returned if it is set for this source. If not set, an exception is thrown.

Parameters:
key - The image key
Returns:
The image.
Throws:
NoSuchImageResourceException, - if no image could be found and no broken image indicator is set.

getImageResource

AwtImageResource getImageResource(String key)
Returns the image resource indexed by the specified key. A resource is a lightweight pointer to the image in the classpath, filesystem, or network, and not the actual loaded image itself.

Parameters:
key - The image key.
Returns:
The image resource.


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