aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-12-17 15:01:21 +0000
committerJeremias Maerki <jeremias@apache.org>2008-12-17 15:01:21 +0000
commitd142add7467c21615699a3799626e6c66563c08d (patch)
tree24f03071dc7341f353dcb3c556c48d68e0431848 /src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java
parent3beeea67b665a3fdd6331f8c6fb99d24dc683f78 (diff)
downloadxmlgraphics-fop-d142add7467c21615699a3799626e6c66563c08d.tar.gz
xmlgraphics-fop-d142add7467c21615699a3799626e6c66563c08d.zip
Added getUserAgent() to IFDocumentHandler (implemented by all implementations already).
Full image support for PSPainter. PostScript output now uses the ImageHandler facility (IF and renderer) for both inline (ImageHandler interface) and form image production (PSImageHandler interface). No more hard-coded image flavor list. Resource optimization extended so images that are only used once are inlined to lower memory requirements in the PostScript VM. Added test cases using Commons' DSC parser to verify the new functionality. Added IFDocumentHandler override possibility in FOUserAgent (just like for FOEventHandler and Renderer). Subject support for PDF output. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@727405 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java')
-rw-r--r--src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java b/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java
index 07d8334d5..ea74a37c8 100644
--- a/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java
+++ b/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java
@@ -209,6 +209,34 @@ public abstract class AbstractIFPainter implements IFPainter {
}
/**
+ * Returns an ImageInfo instance for the given URI. If there's an error, null is returned.
+ * The caller can assume that any exceptions have already been handled properly. The caller
+ * simply skips painting anything in this case.
+ * @param uri the URI identifying the image
+ * @return the ImageInfo instance or null if there has been an error.
+ */
+ protected ImageInfo getImageInfo(String uri) {
+ ImageManager manager = getFopFactory().getImageManager();
+ try {
+ ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
+ return manager.getImageInfo(uri, sessionContext);
+ } catch (ImageException ie) {
+ ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.imageError(this, uri, ie, null);
+ } catch (FileNotFoundException fe) {
+ ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.imageNotFound(this, uri, fe, null);
+ } catch (IOException ioe) {
+ ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.imageIOError(this, uri, ioe, null);
+ }
+ return null;
+ }
+
+ /**
* Default drawing method for handling an image referenced by a URI.
* @param uri the image's URI
* @param rect the rectangle in which to paint the image