]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Merged trunk@1356765
authorPeter Hancock <phancock@apache.org>
Tue, 3 Jul 2012 16:01:48 +0000 (16:01 +0000)
committerPeter Hancock <phancock@apache.org>
Tue, 3 Jul 2012 16:01:48 +0000 (16:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_RoundedCorners@1356804 13f79535-47bb-0310-9956-ffa450edef68

13 files changed:
1  2 
src/java/org/apache/fop/afp/AFPResourceManager.java
src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
src/java/org/apache/fop/render/afp/AFPPainter.java
src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java
src/java/org/apache/fop/render/intermediate/IFParser.java
src/java/org/apache/fop/render/intermediate/IFRenderer.java
src/java/org/apache/fop/render/intermediate/IFSerializer.java
src/java/org/apache/fop/render/java2d/Java2DPainter.java
src/java/org/apache/fop/render/pcl/PCLPainter.java
src/java/org/apache/fop/render/pdf/PDFPainter.java
src/java/org/apache/fop/render/ps/PSPainter.java
src/sandbox/org/apache/fop/render/svg/SVGPainter.java

index d427f9d7fa37c9294e0887e660f902dec33dde7f,a0b1e99db9afa037a4cd4885b5bb561a29cbcf19..9c786acf584c90446692b5a055f0bcfb57aefdeb
@@@ -23,7 -23,7 +23,8 @@@ import java.awt.Color
  import java.awt.Dimension;
  import java.awt.geom.AffineTransform;
  import java.io.IOException;
 +import java.util.HashMap;
+ import java.net.URI;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
index 5d8c1a93ff0a70cc98fad815b43bf49930a63d2f,7d659a8b40926ee46695baef64bea150b2019be7..47ff5dba16c7216a28c2cb668841cd5ce80480ff
@@@ -38,22 -32,12 +38,23 @@@ import java.util.Map
  
  import org.w3c.dom.Document;
  
 +import org.apache.commons.logging.Log;
 +import org.apache.commons.logging.LogFactory;
 +
 +import org.apache.xmlgraphics.image.loader.Image;
 +import org.apache.xmlgraphics.image.loader.ImageException;
 +import org.apache.xmlgraphics.image.loader.ImageInfo;
  import org.apache.xmlgraphics.image.loader.ImageProcessingHints;
  import org.apache.xmlgraphics.image.loader.ImageSessionContext;
 +import org.apache.xmlgraphics.image.loader.ImageSize;
 +import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D;
 +import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
  
  import org.apache.fop.afp.AFPBorderPainter;
+ import org.apache.fop.afp.AFPEventProducer;
 +import org.apache.fop.afp.AFPObjectAreaInfo;
  import org.apache.fop.afp.AFPPaintingState;
 +import org.apache.fop.afp.AFPResourceInfo;
  import org.apache.fop.afp.AFPUnitConverter;
  import org.apache.fop.afp.AbstractAFPPainter;
  import org.apache.fop.afp.BorderPaintingInfo;
@@@ -67,13 -51,10 +68,11 @@@ import org.apache.fop.afp.modca.Abstrac
  import org.apache.fop.afp.modca.PresentationTextObject;
  import org.apache.fop.afp.ptoca.PtocaBuilder;
  import org.apache.fop.afp.ptoca.PtocaProducer;
- import org.apache.fop.afp.util.DefaultFOPResourceAccessor;
- import org.apache.fop.afp.util.ResourceAccessor;
+ import org.apache.fop.afp.util.AFPResourceAccessor;
  import org.apache.fop.fonts.Font;
- import org.apache.fop.fonts.FontInfo;
  import org.apache.fop.fonts.FontTriplet;
  import org.apache.fop.fonts.Typeface;
 +import org.apache.fop.render.ImageHandlerUtil;
  import org.apache.fop.render.RenderingContext;
  import org.apache.fop.render.intermediate.AbstractIFPainter;
  import org.apache.fop.render.intermediate.BorderPainter;
@@@ -88,13 -68,10 +86,13 @@@ import org.apache.fop.util.CharUtilitie
  /**
   * IFPainter implementation that produces AFP (MO:DCA).
   */
- public class AFPPainter extends AbstractIFPainter {
+ public class AFPPainter extends AbstractIFPainter<AFPDocumentHandler> {
  
 +
 +
 +
      //** logging instance */
 -    //private static Log log = LogFactory.getLog(AFPPainter.class);
 +    private static Log log = LogFactory.getLog(AFPPainter.class);
  
      private static final int X = 0;
      private static final int Y = 1;
       * @param documentHandler the parent document handler
       */
      public AFPPainter(AFPDocumentHandler documentHandler) {
-         super();
-         this.documentHandler = documentHandler;
+         super(documentHandler);
          this.state = IFState.create();
 +
          this.borderPainter = new AFPBorderPainterAdapter(
 -                new AFPBorderPainter(getPaintingState(), getDataStream()));
 +                new AFPBorderPainter(getPaintingState(), getDataStream()), this, documentHandler);
          this.rectanglePainter = documentHandler.createRectanglePainter();
          this.unitConv = getPaintingState().getUnitConverter();
+         this.eventProducer = AFPEventProducer.Provider.get(getUserAgent().getEventBroadcaster());
      }
  
-     /** {@inheritDoc} */
-     @Override
-     protected IFContext getContext() {
-         return this.documentHandler.getContext();
-     }
-     FontInfo getFontInfo() {
-         return this.documentHandler.getFontInfo();
+     private AFPPaintingState getPaintingState() {
+         return getDocumentHandler().getPaintingState();
      }
  
-     AFPPaintingState getPaintingState() {
-         return this.documentHandler.getPaintingState();
+     private DataStream getDataStream() {
+         return getDocumentHandler().getDataStream();
      }
  
-     DataStream getDataStream() {
-         return this.documentHandler.getDataStream();
+     @Override
+     public String getFontKey(FontTriplet triplet) throws IFException {
+         try {
+             return super.getFontKey(triplet);
+         } catch (IFException e) {
+             eventProducer.invalidConfiguration(null, e);
+             return super.getFontKey(FontTriplet.DEFAULT_FONT_TRIPLET);
+         }
      }
  
      /** {@inheritDoc} */
      /** {@inheritDoc} */
      @Override
      protected RenderingContext createRenderingContext() {
 -        AFPRenderingContext psContext = new AFPRenderingContext(
 +        AFPRenderingContext renderingContext = new AFPRenderingContext(
                  getUserAgent(),
-                 documentHandler.getResourceManager(),
+                 getDocumentHandler().getResourceManager(),
                  getPaintingState(),
                  getFontInfo(),
                  getContext().getForeignAttributes());
index 9d16cb4285e833d543296d5a4eef9be4aec802df,63e947e55f5a1d9d4c93eac771fea75cded316c9..b8947ff6049b255f4c2211ad1684043bc7c92a72
@@@ -260,11 -229,11 +243,11 @@@ public class PSPainter extends Abstract
          if (top != null || bottom != null || left != null || right != null) {
              try {
                  endTextObject();
-                 if (getPSUtil().getRenderingMode() == PSRenderingMode.SIZE
+                 if (getDocumentHandler().getPSUtil().getRenderingMode() == PSRenderingMode.SIZE
                      && hasOnlySolidBorders(top, bottom, left, right)) {
 -                    super.drawBorderRect(rect, top, bottom, left, right);
 +                    super.drawBorderRect(rect, top, bottom, left, right, innerBackgroundColor);
                  } else {
 -                    this.borderPainter.drawBorders(rect, top, bottom, left, right);
 +                    this.borderPainter.drawBorders(rect, top, bottom, left, right, innerBackgroundColor);
                  }
              } catch (IOException ioe) {
                  throw new IFException("I/O error in drawBorderRect()", ioe);