|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.java.feednread.backend.configuration.ImageManager
Central application Image management class. Disposes of a
memory cache for application Images which caches an
Image in memory the first time it is requested. In addition an
icon cache for Favorite icon Images is used
which caches icons from a Favorite's host in a local
persistent cache.
Don't forget to call the dispose() method on application exit to
clear off the memory cache.
| Field Summary | |
private static int |
DEFAULT_ICON_HEIGHT
The default icon Image height |
private static int |
DEFAULT_ICON_WIDTH
The default icon Image width |
private static ImageRegistry |
DEFAULT_REGISTRY
The default ImageRegistry to cache all requested Images.
|
| Constructor Summary | |
ImageManager()
|
|
| Method Summary | |
private static void |
cacheIcon(String hostUrl)
Puts the icon deposited at the specified hostUrl in the
local icon cache.
|
private static ImageDescriptor |
createImageDescriptor(String key)
Gets the ImageDescriptor matching the specified key.
|
static void |
dispose()
Disposes all Image resources created by this
ImageManager.
|
static Image |
getIcon(String favoriteUrl)
Gets the icon Image denoted by the specified
favoriteUrl from the cache using both cache levels, i.e.
|
static Image |
getIcon(String favoriteUrl,
boolean useSecondLevelCache)
Gets the icon Image denoted by the specified
favoriteUrl from the cache.
|
static Image |
getImage(String key)
Gets the Image denoted by the specified key from the internal
ImageRegistry.
|
private static Image |
getImage(String key,
boolean returnMissingOnError,
boolean scaleImage)
Gets the Image denoted by the specified key from the internal
ImageRegistry.
|
static ImageDescriptor |
getImageDescriptor(String key)
Gets the ImageDescriptor denoted by the specified key from the
internal ImageRegistry.
|
static Image |
getNewsFeedTypeImage(String type)
Gets the newsfeed type Image based on the specified
syndication type.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final ImageRegistry DEFAULT_REGISTRY
The default ImageRegistry to cache all requested Images.
private static final int DEFAULT_ICON_WIDTH
The default icon Image width
private static final int DEFAULT_ICON_HEIGHT
The default icon Image height
| Constructor Detail |
public ImageManager()
| Method Detail |
public static void dispose()
Disposes all Image resources created by this
ImageManager.
public static Image getImage(String key)
Gets the Image denoted by the specified key from the internal
ImageRegistry.
An Image is initialized and cached the first time it is requested.
key - the key to query the Image for
Image denoted by the specified key
private static Image getImage(String key,
boolean returnMissingOnError,
boolean scaleImage)
Gets the Image denoted by the specified key from the internal
ImageRegistry.
An Image is initialized and cached the first time it is requested.
key - the key to query the Image forreturnMissingOnError - if true returns a default image;
otherwise returns nullscaleImage - true to scale the Image
to the default size; false to get it in original size
Image denoted by the specified keypublic static ImageDescriptor getImageDescriptor(String key)
Gets the ImageDescriptor denoted by the specified key from the
internal ImageRegistry.
An ImageDescriptor is initialized and cached the first time it is
requested.
key - the key to query the ImageDescriptor for
ImageDescriptor denoted by the specified keypublic static Image getNewsFeedTypeImage(String type)
Gets the newsfeed type Image based on the specified
syndication type.
type - String the syndication typepublic static Image getIcon(String favoriteUrl)
Gets the icon Image denoted by the specified
favoriteUrl from the cache using both cache levels, i.e.
first level and second cache.
favoriteUrl - the url of the Favorite to get the
icon Image for
Image
public static Image getIcon(String favoriteUrl,
boolean useSecondLevelCache)
Gets the icon Image denoted by the specified
favoriteUrl from the cache.
favoriteUrl - the url of the Favorite to get the
icon Image foruseSecondLevelCache - true to also use
second level cache (web) if the icon Image is not found in
the first level cache (local).
Imageprivate static void cacheIcon(String hostUrl)
Puts the icon deposited at the specified hostUrl in the
local icon cache.
hostUrl - the url of the host to get the icon Image
fromprivate static ImageDescriptor createImageDescriptor(String key)
Gets the ImageDescriptor matching the specified key.
key - the key that identifies the image to get the descriptor for
ImageDescriptor matching the specified key
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||