gmazza      2004/03/21 04:38:56

  Modified:    .        build.xml
               src/java/org/apache/fop/image/analyser SVGReader.java
               src/java/org/apache/fop/render/pdf PDFXMLHandler.java
               src/java/org/apache/fop/render/ps PSXMLHandler.java
               src/java/org/apache/fop/svg SVGUserAgent.java
  Removed:     src/codegen properties.xsl
  Log:
  1.) Removed xsl file for property generation (no longer used, due to
  Finn's work.)  Removed build.xml entry.
  
  2.) Disconnected the FOUserAgent from the SVGUserAgent.  This will make
  the SVGUserAgent more portable although at the cost of a more complex
  constructor.
  
  Revision  Changes    Path
  1.106     +0 -3      xml-fop/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-fop/build.xml,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- build.xml 27 Feb 2004 19:36:38 -0000      1.105
  +++ build.xml 21 Mar 2004 12:38:56 -0000      1.106
  @@ -218,10 +218,7 @@
       <property name="jai" value="JAIImage.java"/>
   
       <property name="xslt" value="org.apache.xalan.xslt.Process"/>
  -    <property name="src.properties.xsl" value="${src.codegen}/properties.xsl"/>
  -    <property name="src.propmaker.xsl" value="${src.codegen}/propmaker.xsl"/>
   
  -    <property name="propinc.xsl" value="${src.codegen}/propinc.xsl"/>
       <property name="src.charlist.xsl" 
value="${src.codegen}/code-point-mapping.xsl"/>
       <property name="encodings.xml" value="${src.codegen}/encodings.xml"/>
       <property name="charlist.xsl" value="${src.codegen}/code-point-mapping.xsl"/>
  
  
  
  1.6       +8 -4      xml-fop/src/java/org/apache/fop/image/analyser/SVGReader.java
  
  Index: SVGReader.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/image/analyser/SVGReader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SVGReader.java    19 Mar 2004 00:53:37 -0000      1.5
  +++ SVGReader.java    21 Mar 2004 12:38:56 -0000      1.6
  @@ -27,6 +27,9 @@
   import org.w3c.dom.Element;
   import org.w3c.dom.svg.SVGDocument;
   
  +// Avalon
  +import org.apache.avalon.framework.logger.Logger;
  +
   // Batik
   import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
   import org.apache.batik.dom.svg.SVGOMDocument;
  @@ -87,7 +90,8 @@
           if (batik) {
               try {
                   Loader loader = new Loader();
  -                return loader.getImage(uri, bis, ua);
  +                return loader.getImage(uri, bis, ua.getLogger(), 
  +                    ua.getPixelUnitToMillimeter());
               } catch (NoClassDefFoundError e) {
                   batik = false;
                   //ua.getLogger().error("Batik not in class path", e);
  @@ -104,7 +108,7 @@
        */
       class Loader {
           private FopImage.ImageInfo getImage(String uri, InputStream fis,
  -                FOUserAgent ua) {
  +                Logger logger, float pixelUnitToMM) {
               // parse document and get the size attributes of the svg element
   
               try {
  @@ -174,8 +178,8 @@
   
                   Element e = doc.getRootElement();
                   String s;
  -                SVGUserAgent userAg =
  -                        new SVGUserAgent(ua, new AffineTransform());
  +                SVGUserAgent userAg = new SVGUserAgent(logger, pixelUnitToMM,
  +                            new AffineTransform());
                   BridgeContext ctx = new BridgeContext(userAg);
                   UnitProcessor.Context uctx =
                           UnitProcessor.createContext(ctx, e);
  
  
  
  1.9       +3 -1      xml-fop/src/java/org/apache/fop/render/pdf/PDFXMLHandler.java
  
  Index: PDFXMLHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFXMLHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PDFXMLHandler.java        19 Mar 2004 00:53:37 -0000      1.8
  +++ PDFXMLHandler.java        21 Mar 2004 12:38:56 -0000      1.9
  @@ -220,7 +220,9 @@
               int yOffset = pdfInfo.currentYPosition;
   
               SVGUserAgent ua
  -                 = new SVGUserAgent(context.getUserAgent(), new AffineTransform());
  +                 = new SVGUserAgent(context.getUserAgent().getLogger(), 
  +                        context.getUserAgent().getPixelUnitToMillimeter(),
  +                        new AffineTransform());
   
               GVTBuilder builder = new GVTBuilder();
               BridgeContext ctx = new BridgeContext(ua);
  
  
  
  1.12      +3 -2      xml-fop/src/java/org/apache/fop/render/ps/PSXMLHandler.java
  
  Index: PSXMLHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSXMLHandler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PSXMLHandler.java 19 Mar 2004 00:53:38 -0000      1.11
  +++ PSXMLHandler.java 21 Mar 2004 12:38:56 -0000      1.12
  @@ -257,8 +257,9 @@
               PSGenerator gen = psInfo.psGenerator;
   
               SVGUserAgent ua
  -                 = new SVGUserAgent(context.getUserAgent(), new AffineTransform());
  -
  +                 = new SVGUserAgent(context.getUserAgent().getLogger(), 
  +                        context.getUserAgent().getPixelUnitToMillimeter(),
  +                        new AffineTransform());
   
               GVTBuilder builder = new GVTBuilder();
               BridgeContext ctx = new BridgeContext(ua);
  
  
  
  1.10      +16 -12    xml-fop/src/java/org/apache/fop/svg/SVGUserAgent.java
  
  Index: SVGUserAgent.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/SVGUserAgent.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SVGUserAgent.java 19 Mar 2004 00:53:38 -0000      1.9
  +++ SVGUserAgent.java 21 Mar 2004 12:38:56 -0000      1.10
  @@ -18,7 +18,7 @@
    
   package org.apache.fop.svg;
   
  -import org.apache.fop.apps.FOUserAgent;
  +import org.apache.fop.apps.FOFileHandler;
   import org.apache.batik.bridge.UserAgentAdapter;
   import org.apache.avalon.framework.logger.Logger;
   
  @@ -34,16 +34,20 @@
    */
   public class SVGUserAgent extends UserAgentAdapter {
       private AffineTransform currentTransform = null;
  -    private FOUserAgent userAgent;
  +    private Logger logger;
  +    private float pixelUnitToMillimeter = 0.0f;
   
       /**
        * Creates a new SVGUserAgent.
  -     * @param ua the FO user agent
  +     * @param log an Avalon logging instance
  +     * @param pixelUnitToMM The pixel to millimeter conversion factor 
  +     *                  currently in effect
        * @param at the current transform
        */
  -    public SVGUserAgent(FOUserAgent ua, AffineTransform at) {
  +    public SVGUserAgent(Logger log, float pixelUnitToMM, AffineTransform at) {
  +        logger = log;
  +        pixelUnitToMillimeter = pixelUnitToMM;
           currentTransform = at;
  -        userAgent = ua;
       }
   
       /**
  @@ -51,7 +55,7 @@
        * @return Logger the logger
        */
       protected final Logger getLogger() {
  -        return this.userAgent.getLogger();
  +        return logger;
       }
   
       /**
  @@ -59,7 +63,7 @@
        * @param message the message to display
        */
       public void displayError(String message) {
  -        getLogger().error(message);
  +        logger.error(message);
       }
   
       /**
  @@ -67,7 +71,7 @@
        * @param ex the exception to display
        */
       public void displayError(Exception ex) {
  -        getLogger().error("SVG Error" + ex.getMessage(), ex);
  +        logger.error("SVG Error" + ex.getMessage(), ex);
       }
   
       /**
  @@ -76,7 +80,7 @@
        * @param message the message to display
        */
       public void displayMessage(String message) {
  -        getLogger().info(message);
  +        logger.info(message);
       }
   
       /**
  @@ -84,7 +88,7 @@
        * @param message the message to display
        */
       public void showAlert(String message) {
  -        getLogger().warn(message);
  +        logger.warn(message);
       }
   
       /**
  @@ -92,7 +96,7 @@
        * @return the pixel unit to millimeter conversion factor
        */
       public float getPixelUnitToMillimeter() {
  -        return userAgent.getPixelUnitToMillimeter();
  +        return pixelUnitToMillimeter;
       }
   
       /**
  @@ -124,7 +128,7 @@
        * @return the XML parser class name
        */
       public String getXMLParserClassName() {
  -        return org.apache.fop.apps.FOFileHandler.getParserClassName();
  +        return FOFileHandler.getParserClassName();
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to