fop 0.93

org.apache.fop.image
Class ImageFactory

java.lang.Object
  extended byorg.apache.fop.image.ImageFactory

public final class ImageFactory
extends java.lang.Object

Create FopImage objects (with a configuration file - not yet implemented).

Author:
Eric SCHAEFFER

Field Summary
protected static org.apache.commons.logging.Log log
          logging instance
 
Constructor Summary
ImageFactory()
          Main constructor for the ImageFactory.
 
Method Summary
 void clearCaches()
          Forces all the image caches to be cleared.
 FopImage getImage(java.lang.String url, FOUserAgent context)
          Get the image from the cache or load.
static java.lang.String getURL(java.lang.String href)
          Get the url string from a wrapped url.
 FopImage loadImage(java.lang.String href, FOUserAgent ua)
          Create an FopImage objects.
 void releaseImage(java.lang.String url, FOUserAgent context)
          Release an image from the cache.
 void removeContext(FOUserAgent context)
          Release the context and all images in the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
logging instance

Constructor Detail

ImageFactory

public ImageFactory()
Main constructor for the ImageFactory.

Method Detail

getURL

public static java.lang.String getURL(java.lang.String href)
Get the url string from a wrapped url.

Parameters:
href - the input wrapped url
Returns:
the raw url

getImage

public FopImage getImage(java.lang.String url,
                         FOUserAgent context)
Get the image from the cache or load. If this returns null then the image could not be loaded due to an error. Messages should be logged. Before calling this the getURL(url) must be used.

Parameters:
url - the url for the image
context - the user agent context
Returns:
the fop image instance

releaseImage

public void releaseImage(java.lang.String url,
                         FOUserAgent context)
Release an image from the cache. This can be used if the renderer has its own cache of the image. The image should then be put into the weak cache.

Parameters:
url - the url for the image
context - the user agent context

removeContext

public void removeContext(FOUserAgent context)
Release the context and all images in the context.

Parameters:
context - the context to remove

loadImage

public FopImage loadImage(java.lang.String href,
                          FOUserAgent ua)
Create an FopImage objects.

Parameters:
href - the url for the image
ua - the user agent context
Returns:
the fop image instance

clearCaches

public void clearCaches()
Forces all the image caches to be cleared. This should normally only be used in testing environments. If you happen to think that you need to call this yourself in a production environment, please notify the development team so we can look into the issue. A call like this shouldn't be necessary anymore like it may have been with FOP 0.20.5.


fop 0.93

Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.