]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Restored plug-in API compatibility with FOP 0.94. Fixes a NoSuchMethodError when...
authorJeremias Maerki <jeremias@apache.org>
Wed, 14 May 2008 14:16:49 +0000 (14:16 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 14 May 2008 14:16:49 +0000 (14:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95@656286 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java
src/java/org/apache/fop/render/Graphics2DAdapter.java
src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java

index bc7bb95a10a0d9d97ad28b97799ef763b912bacd..e91947ba5fe97e9cf6d54267955f2cd20604efb4 100644 (file)
@@ -32,12 +32,13 @@ import java.awt.image.ComponentColorModel;
 import java.awt.image.DataBuffer;
 import java.awt.image.Raster;
 import java.awt.image.WritableRaster;
+import java.io.IOException;
 
 import org.apache.fop.render.RendererContext.RendererContextWrapper;
 import org.apache.fop.util.UnitConv;
 
 /**
- * Graphics2DAdapter implementation for PCL and HP GL/2.
+ * Abstract base class for Graphics2DAdapter implementations.
  */
 public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter {
 
@@ -135,4 +136,12 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter {
             RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
     }
 
+    /** {@inheritDoc} */
+    public void paintImage(Graphics2DImagePainter painter, 
+            RendererContext context,
+            int x, int y, int width, int height) throws IOException {
+        paintImage((org.apache.xmlgraphics.java2d.Graphics2DImagePainter)painter,
+                context, x, y, width, height);
+    }
+    
 }
index 0123e04a168244f1adaed0267ebc34ab7076c908..4fbdbe09ac7578c4cc9093dfa64334fb565215da 100644 (file)
@@ -47,4 +47,23 @@ public interface Graphics2DAdapter {
             RendererContext context,
             int x, int y, int width, int height) throws IOException;
     
+    /**
+     * Paints an arbitrary images on a given Graphics2D instance. The renderer
+     * providing this functionality must set up a Graphics2D instance so that
+     * the image with the given extents (in mpt) can be painted by the painter
+     * passed to this method. The Graphics2DImagePainter is then passed this
+     * Graphics2D instance so the image can be painted.
+     * @param painter the painter which will paint the actual image
+     * @param context the renderer context for the current renderer
+     * @param x X position of the image
+     * @param y Y position of the image
+     * @param width width of the image
+     * @param height height of the image
+     * @throws IOException In case of an I/O error while writing the output format
+     * @deprecated Use the variant with the Graphics2DImagePainter from XML Graphics Commons instead
+     */
+    void paintImage(Graphics2DImagePainter painter, 
+            RendererContext context,
+            int x, int y, int width, int height) throws IOException;
+    
 }
index 48feba135afa16c77e133fef3f401000490a7cee..b29378a96aef33d58ade6b6f00b139558e0403e5 100644 (file)
@@ -28,13 +28,13 @@ import java.io.IOException;
 
 import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
 
-import org.apache.fop.render.Graphics2DAdapter;
+import org.apache.fop.render.AbstractGraphics2DAdapter;
 import org.apache.fop.render.RendererContext;
 
 /**
  * Graphics2DAdapter implementation for Java2D.
  */
-public class Java2DGraphics2DAdapter implements Graphics2DAdapter {
+public class Java2DGraphics2DAdapter extends AbstractGraphics2DAdapter {
 
     /** {@inheritDoc} */
     public void paintImage(Graphics2DImagePainter painter,
index a592b4f44760155ebc52aa7d89f44eaa2abf5dd0..994481d59c1e5d69b42c27a5e83a923345744e0e 100644 (file)
@@ -28,13 +28,13 @@ import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
 import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
 import org.apache.xmlgraphics.ps.PSGenerator;
 
-import org.apache.fop.render.Graphics2DAdapter;
+import org.apache.fop.render.AbstractGraphics2DAdapter;
 import org.apache.fop.render.RendererContext;
 
 /**
  * Graphics2DAdapter implementation for PostScript.
  */
-public class PSGraphics2DAdapter implements Graphics2DAdapter {
+public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter {
 
     private PSGenerator gen;
     private boolean clip = true;