keiron      01/09/17 06:29:53

  Modified:    src/org/apache/fop/apps AWTStarter.java
                        CommandLineOptions.java Driver.java
               src/org/apache/fop/render AbstractRenderer.java
                        PrintRenderer.java
               src/org/apache/fop/render/awt AWTRenderer.java
               src/org/apache/fop/render/mif MIFRenderer.java
               src/org/apache/fop/render/ps PSRenderer.java
               src/org/apache/fop/render/xml XMLRenderer.java
  Log:
  fixed a few awt render problems and a bit more render refactoring
  
  Revision  Changes    Path
  1.9       +4 -7      xml-fop/src/org/apache/fop/apps/AWTStarter.java
  
  Index: AWTStarter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/AWTStarter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AWTStarter.java   2001/08/14 08:56:27     1.8
  +++ AWTStarter.java   2001/09/17 13:29:52     1.9
  @@ -1,5 +1,5 @@
   /*
  - * $Id: AWTStarter.java,v 1.8 2001/08/14 08:56:27 keiron Exp $
  + * $Id: AWTStarter.java,v 1.9 2001/09/17 13:29:52 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -13,7 +13,6 @@
    * Stanislav Gorkhover: [EMAIL PROTECTED]
    * Modified to use streaming API by Mark Lillywhite, [EMAIL PROTECTED]
    */
  -import org.apache.fop.messaging.MessageHandler;
   import org.apache.fop.viewer.*;
   import org.apache.fop.render.awt.*;
   
  @@ -46,7 +45,6 @@
   /**
    * initialize AWT previewer
    */
  -
   public class AWTStarter extends CommandLineStarter {
   
       PreviewDialog frame;
  @@ -90,13 +88,12 @@
           frame = createPreviewDialog(renderer, resource);
           renderer.setProgressListener(frame);
           renderer.setComponent(frame);
  -        MessageHandler.setOutputMethod(MessageHandler.EVENT);
  -        MessageHandler.addListener(frame);
       }
   
   
       public void run() throws FOPException {
           Driver driver = new Driver();
  +        driver.setLogger(log);
           if (errorDump) {
               driver.setErrorDump(true);
           }
  @@ -157,8 +154,8 @@
               URL url = getClass().getResource(path);
               in = url.openStream();
           } catch (Exception ex) {
  -            MessageHandler.logln("Can't find URL to: <" + path + "> "
  -                                 + ex.getMessage());
  +            log.error("Can't find URL to: <" + path + "> "
  +                                 + ex.getMessage(), ex);
           }
           return new SecureResourceBundle(in);
       }
  
  
  
  1.13      +5 -2      xml-fop/src/org/apache/fop/apps/CommandLineOptions.java
  
  Index: CommandLineOptions.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/CommandLineOptions.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CommandLineOptions.java   2001/08/21 06:18:54     1.12
  +++ CommandLineOptions.java   2001/09/17 13:29:52     1.13
  @@ -1,5 +1,5 @@
   /*
  - * $Id: CommandLineOptions.java,v 1.12 2001/08/21 06:18:54 keiron Exp $
  + * $Id: CommandLineOptions.java,v 1.13 2001/09/17 13:29:52 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -139,11 +139,13 @@
           for (int i = 0; i < args.length; i++) {
               if (args[i].equals("-d") || args[i].equals("--full-error-dump")) {
                   errorDump = new Boolean(true);
  +                log.setPriority(Priority.DEBUG);
               } else if (args[i].equals("-x")
                          || args[i].equals("--dump-config")) {
                   dumpConfiguration = new Boolean(true);
               } else if (args[i].equals("-q") || args[i].equals("--quiet")) {
                   quiet = new Boolean(true);
  +                log.setPriority(Priority.ERROR);
               } else if (args[i].equals("-c")) {
                   if ((i + 1 == args.length)
                           || (args[i + 1].charAt(0) == '-')) {
  @@ -416,6 +418,7 @@
                   }
                   throw new FOPException("AWTStarter could not be loaded.", e);
               }
  +        break;
           case PRINT_OUTPUT:
               try {
                   starter = 
((Starter)Class.forName("org.apache.fop.apps.PrintStarter").getConstructor(new Class[] 
{
  @@ -430,7 +433,7 @@
                   throw new FOPException("PrintStarter could not be loaded.",
                                          e);
               }
  -
  +        break;
           default:
               starter = new CommandLineStarter(this);
           }
  
  
  
  1.35      +4 -1      xml-fop/src/org/apache/fop/apps/Driver.java
  
  Index: Driver.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Driver.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Driver.java       2001/08/22 08:29:17     1.34
  +++ Driver.java       2001/09/17 13:29:52     1.35
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Driver.java,v 1.34 2001/08/22 08:29:17 keiron Exp $
  + * $Id: Driver.java,v 1.35 2001/09/17 13:29:52 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -230,6 +230,9 @@
        */
       public synchronized void reset() {
           _areaTree = null;
  +        _source = null;
  +        _stream = null;
  +        _reader = null;
           _treeBuilder.reset();
       }
   
  
  
  
  1.3       +53 -1     xml-fop/src/org/apache/fop/render/AbstractRenderer.java
  
  Index: AbstractRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/AbstractRenderer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractRenderer.java     2001/09/17 11:04:49     1.2
  +++ AbstractRenderer.java     2001/09/17 13:29:53     1.3
  @@ -1,5 +1,5 @@
   /*
  - * $Id: AbstractRenderer.java,v 1.2 2001/09/17 11:04:49 keiron Exp $
  + * $Id: AbstractRenderer.java,v 1.3 2001/09/17 13:29:53 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -62,6 +62,58 @@
       }
   
       protected abstract void doFrame(Area area);
  +
  +    /**
  +     * render area container
  +     *
  +     * @param area the area container to render
  +     */
  +    public void renderAreaContainer(AreaContainer area) {
  +
  +        int saveY = this.currentYPosition;
  +        int saveX = this.currentAreaContainerXPosition;
  +
  +        if (area.getPosition() == Position.ABSOLUTE) {
  +            // XPosition and YPosition give the content rectangle position
  +            this.currentYPosition = area.getYPosition();
  +            this.currentAreaContainerXPosition = area.getXPosition();
  +        } else if (area.getPosition() == Position.RELATIVE) {
  +            this.currentYPosition -= area.getYPosition();
  +            this.currentAreaContainerXPosition += area.getXPosition();
  +        } else if (area.getPosition() == Position.STATIC) {
  +            this.currentYPosition -= area.getPaddingTop()
  +                                     + area.getBorderTopWidth();
  +            /*
  +             * this.currentAreaContainerXPosition +=
  +             * area.getPaddingLeft() + area.getBorderLeftWidth();
  +             */
  +        }
  +
  +        this.currentXPosition = this.currentAreaContainerXPosition;
  +        doFrame(area);
  +
  +        Enumeration e = area.getChildren().elements();
  +        while (e.hasMoreElements()) {
  +            Box b = (Box)e.nextElement();
  +            b.render(this);
  +        }
  +        // Restore previous origin
  +        this.currentYPosition = saveY;
  +        this.currentAreaContainerXPosition = saveX;
  +        if (area.getPosition() == Position.STATIC) {
  +            this.currentYPosition -= area.getHeight();
  +        }
  +
  +        /**
  +         * **
  +         * if (area.getPosition() != Position.STATIC) {
  +         * this.currentYPosition = saveY;
  +         * this.currentAreaContainerXPosition = saveX;
  +         * } else
  +         * this.currentYPosition -= area.getHeight();
  +         * **
  +         */
  +    }
   
       /**
        * render block area
  
  
  
  1.13      +1 -75     xml-fop/src/org/apache/fop/render/PrintRenderer.java
  
  Index: PrintRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/PrintRenderer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PrintRenderer.java        2001/09/17 11:04:49     1.12
  +++ PrintRenderer.java        2001/09/17 13:29:53     1.13
  @@ -1,5 +1,5 @@
   /*
  - * $Id: PrintRenderer.java,v 1.12 2001/09/17 11:04:49 keiron Exp $
  + * $Id: PrintRenderer.java,v 1.13 2001/09/17 13:29:53 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources."
  @@ -177,58 +177,6 @@
           addRect(x, y, w, h, fill, fill);
       }
   
  -    /**
  -     * render area container
  -     * 
  -     * @param area the area container to render
  -     */
  -    public void renderAreaContainer(AreaContainer area) {
  -
  -        int saveY = this.currentYPosition;
  -        int saveX = this.currentAreaContainerXPosition;
  -
  -        if (area.getPosition() == Position.ABSOLUTE) {
  -            // XPosition and YPosition give the content rectangle position
  -            this.currentYPosition = area.getYPosition();
  -            this.currentAreaContainerXPosition = area.getXPosition();
  -        } else if (area.getPosition() == Position.RELATIVE) {
  -            this.currentYPosition -= area.getYPosition();
  -            this.currentAreaContainerXPosition += area.getXPosition();
  -        } else if (area.getPosition() == Position.STATIC) {
  -            this.currentYPosition -= area.getPaddingTop()
  -                                     + area.getBorderTopWidth();
  -            /*
  -             * this.currentAreaContainerXPosition +=
  -             * area.getPaddingLeft() + area.getBorderLeftWidth();
  -             */
  -        }
  -
  -        this.currentXPosition = this.currentAreaContainerXPosition;
  -        doFrame(area);
  -
  -        Enumeration e = area.getChildren().elements();
  -        while (e.hasMoreElements()) {
  -            Box b = (Box)e.nextElement();
  -            b.render(this);
  -        }
  -        // Restore previous origin
  -        this.currentYPosition = saveY;
  -        this.currentAreaContainerXPosition = saveX;
  -        if (area.getPosition() == Position.STATIC) {
  -            this.currentYPosition -= area.getHeight();
  -        }
  -
  -        /**
  -         * **
  -         * if (area.getPosition() != Position.STATIC) {
  -         * this.currentYPosition = saveY;
  -         * this.currentAreaContainerXPosition = saveX;
  -         * } else
  -         * this.currentYPosition -= area.getHeight();
  -         * **
  -         */
  -    }
  -
       public void renderBodyAreaContainer(BodyAreaContainer area) {
           int saveY = this.currentYPosition;
           int saveX = this.currentAreaContainerXPosition;
  @@ -341,28 +289,6 @@
               addFilledRect(rx, ry - h - bottom, w, bottom,
                             new PDFColor(bp.getBorderColor(BorderAndPadding.BOTTOM)));
       }
  -
  -
  -    /**
  -     * render block area
  -     * 
  -     * @param area the block area to render
  -     *
  -    public void renderBlockArea(BlockArea area) {
  -        // KLease: Temporary test to fix block positioning
  -        // Offset ypos by padding and border widths
  -        this.currentYPosition -= (area.getPaddingTop()
  -                                  + area.getBorderTopWidth());
  -        doFrame(area);
  -        Enumeration e = area.getChildren().elements();
  -        while (e.hasMoreElements()) {
  -            Box b = (Box)e.nextElement();
  -            b.render(this);
  -        }
  -        this.currentYPosition -= (area.getPaddingBottom()
  -                                  + area.getBorderBottomWidth());
  -    }
  -*/
   
       /**
        * render display space
  
  
  
  1.34      +1 -44     xml-fop/src/org/apache/fop/render/awt/AWTRenderer.java
  
  Index: AWTRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/awt/AWTRenderer.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- AWTRenderer.java  2001/09/17 11:04:49     1.33
  +++ AWTRenderer.java  2001/09/17 13:29:53     1.34
  @@ -1,5 +1,5 @@
   /*
  - * $Id: AWTRenderer.java,v 1.33 2001/09/17 11:04:49 keiron Exp $
  + * $Id: AWTRenderer.java,v 1.34 2001/09/17 13:29:53 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -390,49 +390,6 @@
            * ....
            * }
            */
  -    }
  -
  -    public void renderAreaContainer(AreaContainer area) {
  -
  -        int saveY = this.currentYPosition;
  -        int saveX = this.currentAreaContainerXPosition;
  -
  -        if (area.getPosition()
  -                == org.apache.fop.fo.properties.Position.ABSOLUTE) {
  -            // Y position is computed assuming positive Y axis, adjust
  -            // for negative postscript one
  -            this.currentYPosition = area.getYPosition()
  -                                    - 2 * area.getPaddingTop()
  -                                    - 2 * area.getBorderTopWidth();
  -            this.currentAreaContainerXPosition = area.getXPosition();
  -        } else if (area.getPosition()
  -                   == org.apache.fop.fo.properties.Position.RELATIVE) {
  -            this.currentYPosition -= area.getYPosition();
  -            this.currentAreaContainerXPosition += area.getXPosition();
  -        } else if (area.getPosition()
  -                   == org.apache.fop.fo.properties.Position.STATIC) {
  -            this.currentYPosition -= area.getPaddingTop()
  -                                     + area.getBorderTopWidth();
  -            this.currentAreaContainerXPosition += area.getPaddingLeft()
  -                                                  + area.getBorderLeftWidth();
  -        }
  -
  -        doFrame(area);
  -
  -        Enumeration e = area.getChildren().elements();
  -        while (e.hasMoreElements()) {
  -            org.apache.fop.layout.Box b =
  -                (org.apache.fop.layout.Box)e.nextElement();
  -            b.render(this);
  -        }
  -
  -        if (area.getPosition()
  -                != org.apache.fop.fo.properties.Position.STATIC) {
  -            this.currentYPosition = saveY;
  -            this.currentAreaContainerXPosition = saveX;
  -        } else {
  -            this.currentYPosition -= area.getHeight();
  -        }
       }
   
       public void renderBodyAreaContainer(BodyAreaContainer area) {
  
  
  
  1.10      +2 -2      xml-fop/src/org/apache/fop/render/mif/MIFRenderer.java
  
  Index: MIFRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/mif/MIFRenderer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MIFRenderer.java  2001/08/21 06:18:55     1.9
  +++ MIFRenderer.java  2001/09/17 13:29:53     1.10
  @@ -1,5 +1,5 @@
   /*
  - * $Id: MIFRenderer.java,v 1.9 2001/08/21 06:18:55 keiron Exp $
  + * $Id: MIFRenderer.java,v 1.10 2001/09/17 13:29:53 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -238,7 +238,7 @@
   
       }
   
  -    private void doFrame(Area area) {
  +    protected void doFrame(Area area) {
           int w, h;
           int rx = this.currentAreaContainerXPosition;
           w = area.getContentWidth();
  
  
  
  1.11      +2 -2      xml-fop/src/org/apache/fop/render/ps/PSRenderer.java
  
  Index: PSRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/ps/PSRenderer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PSRenderer.java   2001/09/05 18:13:19     1.10
  +++ PSRenderer.java   2001/09/17 13:29:53     1.11
  @@ -1,5 +1,5 @@
   /*
  - * $Id: PSRenderer.java,v 1.10 2001/09/05 18:13:19 gears Exp $
  + * $Id: PSRenderer.java,v 1.11 2001/09/17 13:29:53 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -849,7 +849,7 @@
           write(area.getContentWidth() + " 0 RM");
       }
   
  -    private void doFrame(Area area) {
  +    protected void doFrame(Area area) {
           int w, h;
           int rx = this.currentAreaContainerXPosition;
           w = area.getContentWidth();
  
  
  
  1.26      +3 -1      xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java
  
  Index: XMLRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- XMLRenderer.java  2001/08/21 06:18:55     1.25
  +++ XMLRenderer.java  2001/09/17 13:29:53     1.26
  @@ -1,5 +1,5 @@
   /*
  - * $Id: XMLRenderer.java,v 1.25 2001/08/21 06:18:55 keiron Exp $
  + * $Id: XMLRenderer.java,v 1.26 2001/09/17 13:29:53 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -54,6 +54,8 @@
       private boolean consistentOutput = false;
   
       public XMLRenderer() {}
  +
  +    protected void doFrame(Area area) {}
   
       /**
        * set up renderer options
  
  
  

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

Reply via email to