FileDocCategorySizeDatePackage
ImageLoader.javaAPI DocphoneME MR2 API (J2ME)5076Wed May 02 18:00:36 BST 2007com.sun.perseus.model

ImageLoader

public interface ImageLoader
Interface for handling RasterImage resources loading. Implementations can vary in the way they handle security restrictions, caching or advanced loading policies.
version
$Id: ImageLoader.java,v 1.4 2006/06/29 10:47:32 ln156897 Exp $

Fields Summary
Constructors Summary
Methods Summary
public voidaddRasterImageConsumer(java.lang.String absoluteURI, RasterImageConsumer imageNode)
In cases where the ImageLoader may update the images associated to a URI, RasterImageConsumer interested in updates need to register their interest throught this method.

param
absoluteURI the URI the RasterImageConsumer is interested in.
param
imageNode the RasterImageConsumer interested in the URI.

public booleanallowsRelativeURI()
Determines whether this ImageLoader can handle relative uri's

return
true if this ImageLoader can handle relative uri's; false otherwise.

public voiddocumentLoaded(DocumentNode doc)
Some ImageLoader implementations may wish to wait until the end of the Document load to start retrieving resources. This method notifies the implementation that the associated DocumentNode completed loading successfully.

param
doc the DocumentNode which just finised loading.

public com.sun.perseus.j2d.RasterImagegetBrokenImage()
Returns the image that should be used to represent an image which could not be loaded.

return
the image to represent broken uris or content.

public com.sun.perseus.j2d.RasterImagegetImageAndWait(java.lang.String uri)
Requests the given image. This call blocks until an image is returned.

param
uri the requested URI. Should be a resolved URI.
return
the loaded image or the same image as returned by a getBrokenImage call if the image could not be loaded.

public voidgetImageLater(java.lang.String uri, RasterImageConsumer imageNode)
Requests the given image. This call returns immediately and the image is set on the input ImageNode when the image becomes available.

param
uri the requested URI. Should be a resolved URI.
param
imageNode the ImageNode whose image member should be set as a result of loading the image.

public com.sun.perseus.j2d.RasterImagegetLoadingImage()
Returns the image that should be used to represent an image which is loading.

return
the image to use to represent a pending loading.

public voidneedsURI(java.lang.String absoluteURI)
Notifies the URILoader that the given uri will be needed.

param
absoluteURI the requested URI content.

public voidremoveRasterImageConsumer(java.lang.String absoluteURI, RasterImageConsumer imageNode)
In cases where the ImageLoader may update the images associated to a URI, RasterImageConsumer interested in updates need to de-register their interest throught this method.

param
absoluteURI the URI the RasterImageConsumer is interested in.
param
imageNode the RasterImageConsumer interested in the URI.

public java.lang.StringresolveURI(java.lang.String uri, java.lang.String baseURI)
Resolves the input relative and base URI into an absolute URI which can be used in subsequent calls to needsURI, getImageAndWait or getImageLater calls.

param
uri the requested URI content.
param
baseURI the base URI. Needed in case uri is relative.
return
the resolved URI that should be requested in follow on needsURI, getImageAndWait or getImageLater calls or null if the URI cannot be resolved.