]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Merged in trunk@1356161
authorMehdi Houshmand <mehdi@apache.org>
Mon, 2 Jul 2012 13:23:46 +0000 (13:23 +0000)
committerMehdi Houshmand <mehdi@apache.org>
Mon, 2 Jul 2012 13:23:46 +0000 (13:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_URI_Unification@1356212 13f79535-47bb-0310-9956-ffa450edef68

1  2 
src/java/org/apache/fop/fonts/FontTriplet.java
src/java/org/apache/fop/render/PrintRenderer.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/pcl/PCLPainter.java
src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
src/java/org/apache/fop/render/ps/PSDocumentHandler.java
src/sandbox/org/apache/fop/render/svg/SVGPainter.java

index 86858c3c8e73e8f031f448a70d5063b15853e3ff,592b47eaa133dbd20fe51d5a0f40c207fdc3ae59..7d659a8b40926ee46695baef64bea150b2019be7
@@@ -45,9 -51,9 +51,8 @@@ 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.RenderingContext;
@@@ -202,11 -204,11 +203,11 @@@ public class AFPPainter extends Abstrac
  
              //Do we need to embed an external page segment?
              if (pageSegment.getURI() != null) {
 -                ResourceAccessor accessor = new DefaultFOPResourceAccessor (
 -                        getUserAgent(), null, null);
 +                AFPResourceAccessor accessor = new AFPResourceAccessor(
-                         documentHandler.getUserAgent().getResourceResolver());
++                        getDocumentHandler().getUserAgent().getResourceResolver());
                  try {
                      URI resourceUri = new URI(pageSegment.getURI());
-                     documentHandler.getResourceManager().createIncludedResourceFromExternal(
+                     getDocumentHandler().getResourceManager().createIncludedResourceFromExternal(
                              pageSegment.getName(), resourceUri, accessor);
  
                  } catch (URISyntaxException urie) {
index e86cc435f911a09b0fa9a3ea2177c3c2f980bae4,327eca14ed94d336f650a8b512233a8ae1e5a33b..147b6d54bdc383b8e5386ed9663861dc31b2ac1f
@@@ -45,7 -45,10 +45,9 @@@ import org.apache.xmlgraphics.image.loa
  
  import org.apache.fop.ResourceEventProducer;
  import org.apache.fop.apps.FOUserAgent;
 -import org.apache.fop.apps.FopFactory;
  import org.apache.fop.fo.Constants;
+ import org.apache.fop.fonts.FontInfo;
+ import org.apache.fop.fonts.FontTriplet;
  import org.apache.fop.render.ImageHandler;
  import org.apache.fop.render.ImageHandlerRegistry;
  import org.apache.fop.render.ImageHandlerUtil;
index 2f22424f5ac30ce05a9164fa65cdd56bf622b457,f0d87d542fa5b8370e0da88883753184b635bf6a..614ebf1d23830cfb72207654e42f8a7618fa2509
@@@ -438,16 -428,11 +428,15 @@@ public class PCLPainter extends Abstrac
              final int letterSpacing, final int wordSpacing, final int[][] dp,
              final String text, FontTriplet triplet) throws IFException {
          //Use Java2D to paint different fonts via bitmap
-         final Font font = parent.getFontInfo().getFontInstance(triplet, state.getFontSize());
+         final Font font = getFontInfo().getFontInstance(triplet, state.getFontSize());
  
          //for cursive fonts, so the text isn't clipped
 -        final FontMetricsMapper mapper = (FontMetricsMapper) getFontInfo().getMetricsFor(
 -                font.getFontName());
 +        FontMetricsMapper mapper;
 +        try {
-         mapper = (FontMetricsMapper)parent.getFontInfo().getMetricsFor(
-                 font.getFontName());
++            mapper = (FontMetricsMapper) getFontInfo().getMetricsFor(font.getFontName());
 +        } catch (Exception t) {
 +            throw new RuntimeException(t);
 +        }
          final int maxAscent = mapper.getMaxAscent(font.getFontSize()) / 1000;
          final int ascent = mapper.getAscender(font.getFontSize()) / 1000;
          final int descent = mapper.getDescender(font.getFontSize()) / 1000;
index 1ad8034e097a0d3b535959d42114f83551605847,c56bce218550a75b629cdee9ab49fdf49ecb7acf..dd93205716cf01fa713a6f9f3dfcb1d11998cd66
@@@ -74,25 -72,22 +73,22 @@@ public class PDFDocumentHandler extend
       * Utility class which enables all sorts of features that are not directly connected to the
       * normal rendering process.
       */
-     protected final PDFRenderingUtil pdfUtil;
 -    private PDFRenderingUtil pdfUtil;
++    private final PDFRenderingUtil pdfUtil;
  
      /** the /Resources object of the PDF document being created */
-     protected PDFResources pdfResources;
+     private PDFResources pdfResources;
  
      /** The current content generator */
-     protected PDFContentGenerator generator;
-     /** the current annotation list to add annotations to */
-     protected PDFResourceContext currentContext;
+     private PDFContentGenerator generator;
  
      /** the current page to add annotations to */
-     protected PDFPage currentPage;
+     private PDFPage currentPage;
  
      /** the current page's PDF reference */
-     protected PageReference currentPageRef;
+     private PageReference currentPageRef;
  
      /** Used for bookmarks/outlines. */
-     protected Map<Integer, PageReference> pageReferences = new HashMap<Integer, PageReference>();
+     private Map<Integer, PageReference> pageReferences = new HashMap<Integer, PageReference>();
  
      private final PDFDocumentNavigationHandler documentNavigationHandler
              = new PDFDocumentNavigationHandler(this);
index 488abd55994e30d33f1b8f982dbfb943bed601f3,bf2d95c1d0ef27e49a0995fd35315162a156fb7d..d73beb759953067443ade91831a6e5b53025d490
@@@ -52,10 -50,11 +52,11 @@@ import org.apache.xmlgraphics.ps.dsc.Re
  import org.apache.xmlgraphics.ps.dsc.events.DSCCommentBoundingBox;
  import org.apache.xmlgraphics.ps.dsc.events.DSCCommentHiResBoundingBox;
  
 -import org.apache.fop.apps.FOUserAgent;
  import org.apache.fop.apps.MimeConstants;
 +import org.apache.fop.apps.io.TempResourceURIGenerator;
  import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler;
  import org.apache.fop.render.intermediate.IFContext;
+ import org.apache.fop.render.intermediate.IFDocumentHandler;
  import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
  import org.apache.fop.render.intermediate.IFException;
  import org.apache.fop.render.intermediate.IFPainter;
@@@ -80,15 -77,13 +81,15 @@@ public class PSDocumentHandler extends 
       * Utility class which enables all sorts of features that are not directly connected to the
       * normal rendering process.
       */
-     protected PSRenderingUtil psUtil;
+     private PSRenderingUtil psUtil;
  
      /** The PostScript generator used to output the PostScript */
-     protected PSGenerator gen;
+     PSGenerator gen;
  
      /** the temporary file in case of two-pass processing */
 -    private File tempFile;
 +    private URI tempURI;
 +    private static final TempResourceURIGenerator TEMP_URI_GENERATOR
 +            = new TempResourceURIGenerator("ps-optimize");
  
      private int currentPageNumber = 0;
      private PageDefinition currentPageDefinition;
          return MimeConstants.MIME_POSTSCRIPT;
      }
  
 -    /** {@inheritDoc} */
 -    public void setContext(IFContext context) {
 -        super.setContext(context);
 -        FOUserAgent userAgent = context.getUserAgent();
 -        this.psUtil = new PSRenderingUtil(userAgent);
 -        eventProducer = PSEventProducer.Provider.get(userAgent.getEventBroadcaster());
 -    }
 -
+     PSGenerator getGenerator() {
+         return gen;
+     }
      /** {@inheritDoc} */
      public IFDocumentHandlerConfigurator getConfigurator() {
 -        return new PSRendererConfigurator(getUserAgent());
 +        return new PSRendererConfigurator(getUserAgent(), new PSRendererConfigParser());
      }
  
      PSRenderingUtil getPSUtil() {