diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-05-03 13:47:18 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-05-03 13:47:18 +0000 |
commit | fc3f1a4c0a64e7f5559e30fbd2664900326d8359 (patch) | |
tree | d2acf51af5b2b65b746f14c527a766250714617d /src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java | |
parent | 48d632c3c572444f32df26859e7d876eaed1dc2f (diff) | |
download | xmlgraphics-fop-fc3f1a4c0a64e7f5559e30fbd2664900326d8359.tar.gz xmlgraphics-fop-fc3f1a4c0a64e7f5559e30fbd2664900326d8359.zip |
Some refactoring in the XML handling area which results in more code reuse and less redundancy.
Support for i-f-o for the AFPRenderer including a Graphics2DAdapter so extensions like Barcode4J can paint barcodes more efficiently (i.e. not via SVG).
The SVGConverter class could now be removed except for the writeImage() method because the same functionality is now covered by the Graphics2DAdapter via renderDocument() in the renderer.
PCL and AFP now use practically the same extension painting code (both render to bitmap images).
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@399306 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java')
-rw-r--r-- | src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java index d843de5ae..54accb5b8 100644 --- a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java +++ b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java @@ -22,6 +22,7 @@ import java.awt.Color; import java.awt.Rectangle; import java.awt.geom.Rectangle2D; import java.util.List; +import java.util.Map; import org.apache.fop.area.Area; import org.apache.fop.area.Block; @@ -29,12 +30,14 @@ import org.apache.fop.area.BlockViewport; import org.apache.fop.area.CTM; import org.apache.fop.area.RegionViewport; import org.apache.fop.area.Trait; +import org.apache.fop.area.inline.ForeignObject; import org.apache.fop.area.inline.InlineArea; import org.apache.fop.area.inline.Viewport; import org.apache.fop.fo.Constants; import org.apache.fop.fonts.FontMetrics; import org.apache.fop.image.FopImage; import org.apache.fop.traits.BorderProps; +import org.w3c.dom.Document; /** * Abstract base class for renderers like PDF and PostScript where many painting operations @@ -661,8 +664,18 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * Draw an image at the indicated location. * @param url the URI/URL of the image * @param pos the position of the image + * @param foreignAttributes an optional Map with foreign attributes, may be null */ - protected abstract void drawImage(String url, Rectangle2D pos); + protected abstract void drawImage(String url, Rectangle2D pos, Map foreignAttributes); + + /** + * Draw an image at the indicated location. + * @param url the URI/URL of the image + * @param pos the position of the image + */ + protected final void drawImage(String url, Rectangle2D pos) { + drawImage(url, pos, null); + } /** * Draw a border segment of an XSL-FO style border. @@ -678,5 +691,15 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { */ protected abstract void drawBorderLine(float x1, float y1, float x2, float y2, boolean horz, boolean startOrBefore, int style, Color col); + + /** + * @see org.apache.fop.render.AbstractRenderer#renderForeignObject(ForeignObject, Rectangle2D) + */ + public void renderForeignObject(ForeignObject fo, Rectangle2D pos) { + endTextObject(); + Document doc = fo.getDocument(); + String ns = fo.getNameSpace(); + renderDocument(doc, ns, pos, fo.getForeignAttributes()); + } } |