|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.model.AbstractModel
com.guiseframework.model.DefaultImageModel
com.guiseframework.model.CachedImageModel<Q,V>
Q - The type of query used to request data from the cache.V - The type of value stored in the cache.
Cache checking and possible fetching is initiated when both the image URI is set using DefaultImageModel.setImageURI(URI) and the cached image key is set using setCachedImageQuery(Object).
The image URI is set automatically when the image is determined to have been fetched into the cache.public class CachedImageModel<Q,V>
An image model that can initiate retrieval of an image from a cache and update the image when fetching succeeds.
| Nested Class Summary | |
|---|---|
protected class |
CachedImageModel.CachedImageListener
A listener that changes the image URI when the an image is fetched into the cache. |
| Field Summary | |
|---|---|
static java.lang.String |
CACHED_IMAGE_QUERY_PROPERTY
The cached image query bound property. |
static java.lang.String |
CACHED_IMAGE_URI_PROPERTY
The cached image URI bound property. |
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.model.PendingImageModel |
|---|
IMAGE_PENDING_PROPERTY |
| Fields inherited from interface com.guiseframework.model.ImageModel |
|---|
IMAGE_URI_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Model |
|---|
PLAIN_TEXT_CONTENT_TYPE, XHTML_CONTENT_TYPE, XHTML_FRAGMENT_CONTENT_TYPE |
| Constructor Summary | |
|---|---|
CachedImageModel(com.globalmentor.cache.Cache<Q,V> cache)
Cache constructor. |
|
CachedImageModel(com.globalmentor.cache.Cache<Q,V> cache,
java.net.URI cachedImageURI)
Cached image URI constructor. |
|
| Method Summary | |
|---|---|
com.globalmentor.cache.Cache<Q,V> |
getCache()
The cache from which images will be retrieved. |
Q |
getCachedImageQuery()
|
java.net.URI |
getCachedImageURI()
|
boolean |
isImagePending()
|
void |
setCachedImageQuery(Q newCachedImageQuery)
The query to request an image from the cache, or null if the image should not be looked up from the cache. |
void |
setCachedImageURI(java.net.URI newCachedImageURI)
Sets the URI of the image. |
protected void |
setImagePending(boolean newImagePending)
Sets whether the current image is in the process of transitioning to some other value. |
protected void |
updatePending()
Initiates pending by both a cached image key and cached image URI are available. |
| Methods inherited from class com.guiseframework.model.DefaultImageModel |
|---|
getImageURI, setImageURI |
| Methods inherited from class com.guiseframework.model.AbstractModel |
|---|
getEventListenerManager, getPlainText |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.guiseframework.model.ImageModel |
|---|
getImageURI, setImageURI |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.globalmentor.beans.PropertyConstrainable |
|---|
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener |
| Field Detail |
|---|
public static final java.lang.String CACHED_IMAGE_QUERY_PROPERTY
public static final java.lang.String CACHED_IMAGE_URI_PROPERTY
| Constructor Detail |
|---|
public CachedImageModel(com.globalmentor.cache.Cache<Q,V> cache)
cache - The cache from which the image will be retrieved.
java.lang.NullPointerException - if the given cache is null.
public CachedImageModel(com.globalmentor.cache.Cache<Q,V> cache,
java.net.URI cachedImageURI)
cache - The cache from which the image will be retrieved.cachedImageURI - The cached image URI, which may be a resource URI, or null if there is no cached image URI.
java.lang.NullPointerException - if the given cache is null.| Method Detail |
|---|
public com.globalmentor.cache.Cache<Q,V> getCache()
public java.net.URI getCachedImageURI()
null if there is no cached image URI.public void setCachedImageURI(java.net.URI newCachedImageURI)
newCachedImageURI - The new URI of the image, which may be a resource URI.
java.lang.IllegalStateException - if the cached image URI is changed while the current image is pending.CACHED_IMAGE_URI_PROPERTYpublic Q getCachedImageQuery()
null if the image should not be looked up from the cache.public void setCachedImageQuery(Q newCachedImageQuery)
null if the image should not be looked up from the cache.
Chaging the cached image query initiates a deferred retrieval of the image from the cache.
This is a bound property.
newCachedImageQuery - The new query to request an image from the cache, or null if the image should not be looked up from the cache.
java.lang.IllegalStateException - if the cached image query is changed while the current image is pending.CACHED_IMAGE_QUERY_PROPERTYpublic boolean isImagePending()
isImagePending in interface PendingImageModelprotected void setImagePending(boolean newImagePending)
Boolean.
newImagePending - true if the current image is a transitional image that is expected to change.PendingImageModel.IMAGE_PENDING_PROPERTYprotected void updatePending()
getCachedImageURI(),
getCachedImageURI()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||