jeremias    2003/03/07 02:47:51

  Modified:    examples/plan/src/org/apache/fop/plan EventList.java
                        PlanRenderer.java ActionInfo.java Main.java
                        PlanElementMapping.java GroupInfo.java
                        PlanElement.java PlanDrawer.java
                        SimplePlanDrawer.java PlanObj.java PlanHints.java
  Log:
  Switched to long licence
  Some general checkstyle fixing
  
  Revision  Changes    Path
  1.2       +53 -8     xml-fop/examples/plan/src/org/apache/fop/plan/EventList.java
  
  Index: EventList.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/EventList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EventList.java    29 Jan 2003 16:35:07 -0000      1.1
  +++ EventList.java    7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,15 +1,60 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
  -import java.util.ArrayList;
  +import java.util.List;
   
   public class EventList {
  -    ArrayList data = new ArrayList();
  +    
  +    private List data = new java.util.ArrayList();
   
       public void addGroupInfo(GroupInfo set) {
           data.add(set);
  
  
  
  1.2       +73 -29    xml-fop/examples/plan/src/org/apache/fop/plan/PlanRenderer.java
  
  Index: PlanRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/PlanRenderer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PlanRenderer.java 29 Jan 2003 16:35:07 -0000      1.1
  +++ PlanRenderer.java 7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,43 +1,87 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
  -import java.util.*;
  -import java.text.*;
  -import java.awt.*;
  -import java.awt.geom.AffineTransform;
  -import java.awt.geom.Rectangle2D;
  -import java.awt.font.FontRenderContext;
  -
  -import org.w3c.dom.*;
  -import org.w3c.dom.svg.*;
  -import org.w3c.dom.css.*;
  +
  +import java.util.Calendar;
  +import java.util.Date;
  +import java.util.HashMap;
  +import java.util.Locale;
  +import java.util.StringTokenizer;
  +
  +import org.w3c.dom.Document;
  +import org.w3c.dom.Element;
  +import org.w3c.dom.Node;
  +import org.w3c.dom.NodeList;
   
   import org.apache.batik.dom.svg.SVGDOMImplementation;
   
   public class PlanRenderer {
  -    final static String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
  -    String fontFamily = "sansserif";
  -    float fontSize = 12;
  +    
  +    private static final String SVG_NAMESPACE = 
SVGDOMImplementation.SVG_NAMESPACE_URI;
  +    
  +    private String fontFamily = "sansserif";
  +    private float fontSize = 12;
       private String type = "";
       private String lang = "";
       private String country = "";
       private String variant = "";
  -    float width;
  -    float height;
  -    float topEdge;
  -    float rightEdge;
  -    HashMap hints = new HashMap();
  -
  -    String[] colours;
  -    String[] darkcolours;
  +    private float width;
  +    private float height;
  +    private float topEdge;
  +    private float rightEdge;
  +    private HashMap hints = new HashMap();
   
  -    public PlanRenderer() {
  -    }
  +    private String[] colours;
  +    private String[] darkcolours;
   
       public void setFontInfo(String fam, float si) {
           fontFamily = fam;
  
  
  
  1.2       +58 -12    xml-fop/examples/plan/src/org/apache/fop/plan/ActionInfo.java
  
  Index: ActionInfo.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/ActionInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ActionInfo.java   29 Jan 2003 16:35:07 -0000      1.1
  +++ ActionInfo.java   7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,23 +1,69 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
   import java.util.Date;
   
   public class ActionInfo {
  -    Date startDate;
  -    Date endDate;
  -    String owner;
  -    String label;
  -    int type = TASK;
  +    
       public static final int TASK = 1;
       public static final int MILESTONE = 2;
       public static final int GROUPING = 3;
  -    String dependant = "";
  +
  +    private Date startDate;
  +    private Date endDate;
  +    private String owner;
  +    private String label;
  +    private int type = TASK;
  +    private String dependant = "";
   
       public void setType(int t) {
           type = t;
  
  
  
  1.2       +72 -13    xml-fop/examples/plan/src/org/apache/fop/plan/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/Main.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Main.java 29 Jan 2003 16:35:07 -0000      1.1
  +++ Main.java 7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,12 +1,58 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
  -import java.io.*;
  +import java.io.InputStream;
  +import java.io.Writer;
  +
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   
  @@ -14,28 +60,36 @@
   import org.apache.batik.transcoder.TranscoderInput;
   import org.apache.batik.transcoder.TranscoderOutput;
   
  +/**
  + * Sample command-line application for converting plan XML to SVG.
  + */
   public class Main {
   
  +    /**
  +     * Main method.
  +     * @param args command-line arguments
  +     */
       public static void main(String[] args) {
           Main main = new Main();
           main.convert(args);
           System.exit(0);
       }
   
  -    public Main() {
  -    }
  -
  +    /**
  +     * Runs the conversion
  +     * @param params command-line arguments
  +     */
       public void convert(String[] params) {
           if (params.length != 2) {
               System.out.println("arguments: plan.xml output.svg");
               return;
           }
           try {
  -            FileInputStream fis = new FileInputStream(params[0]);
  -            Document doc = createSVGDocument(fis);
  +            InputStream is = new java.io.FileInputStream(params[0]);
  +            Document doc = createSVGDocument(is);
               SVGTranscoder svgT = new SVGTranscoder();
               TranscoderInput input = new TranscoderInput(doc);
  -            Writer ostream = new FileWriter(params[1]);
  +            Writer ostream = new java.io.FileWriter(params[1]);
               TranscoderOutput output = new TranscoderOutput(ostream);
               svgT.transcode(input, output);
               ostream.flush();
  @@ -46,6 +100,11 @@
           }
       }
   
  +    /**
  +     * Helper method to create the SVG document from the plan InputStream.
  +     * @param is InputStream
  +     * @return Document a DOM containing the SVG
  +     */
       public Document createSVGDocument(InputStream is) {
           Document doc = null;
   
  
  
  
  1.2       +70 -19    
xml-fop/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java
  
  Index: PlanElementMapping.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PlanElementMapping.java   29 Jan 2003 16:35:07 -0000      1.1
  +++ PlanElementMapping.java   7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,9 +1,53 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
   import org.apache.fop.fo.FOTreeBuilder;
  @@ -15,15 +59,19 @@
   
   import java.util.HashMap;
   
  +/**
  + * This class provides the element mapping for FOP.
  + */
   public class PlanElementMapping implements ElementMapping {
   
  +    /** The namespace for the plan extension */
       public static final String URI = "http://xml.apache.org/fop/plan";;
   
       private static HashMap foObjs = null;
   
       private static synchronized void setupPlan() {
           if (foObjs == null) {
  -            foObjs = new HashMap();
  +            foObjs = new java.util.HashMap();
               foObjs.put("plan", new PE());
               foObjs.put(DEFAULT, new PlanMaker());
   
  @@ -31,6 +79,9 @@
           }
       }
   
  +    /**
  +     * @see org.apache.fop.fo.ElementMapping#addToBuilder(FOTreeBuilder)
  +     */
       public void addToBuilder(FOTreeBuilder builder) {
           setupPlan();
           builder.addMapping(URI, foObjs);
  @@ -51,20 +102,20 @@
       static class PlanConverter implements XMLReader.Converter {
           public FopImage.ImageInfo convert(Document doc) {
               try {
  -            PlanRenderer pr = new PlanRenderer();
  -            pr.setFontInfo("Helvetica", 12);
  -            FopImage.ImageInfo info = new FopImage.ImageInfo();
  -            info.data = pr.createSVGDocument(doc);
  -            info.width = (int)pr.getWidth();
  -            info.height = (int)pr.getHeight();
  -            info.mimeType = "image/svg+xml";
  -            info.str = "http://www.w3.org/2000/svg";;
  -
  -            return info;
  -            } catch(Throwable t) {
  +                PlanRenderer pr = new PlanRenderer();
  +                pr.setFontInfo("Helvetica", 12);
  +                FopImage.ImageInfo info = new FopImage.ImageInfo();
  +                info.data = pr.createSVGDocument(doc);
  +                info.width = (int)pr.getWidth();
  +                info.height = (int)pr.getHeight();
  +                info.mimeType = "image/svg+xml";
  +                info.str = "http://www.w3.org/2000/svg";;
  +    
  +                return info;
  +            } catch (Throwable t) {
  +                /[EMAIL PROTECTED] Log this properly! */
               }
               return null;
  -
           }
       }
   
  
  
  
  1.2       +54 -9     xml-fop/examples/plan/src/org/apache/fop/plan/GroupInfo.java
  
  Index: GroupInfo.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/GroupInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GroupInfo.java    29 Jan 2003 16:35:07 -0000      1.1
  +++ GroupInfo.java    7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,16 +1,61 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
  -import java.util.ArrayList;
  +import java.util.List;
   
   public class GroupInfo {
  -    String name;
  -    ArrayList actions = new ArrayList();
  +    
  +    private String name;
  +    private List actions = new java.util.ArrayList();
   
       public GroupInfo(String n) {
           name = n;
  
  
  
  1.2       +88 -22    xml-fop/examples/plan/src/org/apache/fop/plan/PlanElement.java
  
  Index: PlanElement.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/PlanElement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PlanElement.java  29 Jan 2003 16:35:07 -0000      1.1
  +++ PlanElement.java  7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,9 +1,53 @@
  -/* $Id$
  - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
   import java.awt.geom.Point2D;
  @@ -14,34 +58,47 @@
   import org.w3c.dom.Document;
   import org.xml.sax.Attributes;
   
  +/**
  + * This class defines the plan element.
  + */
   public class PlanElement extends PlanObj {
  -    Document svgDoc = null;
  -    float width;
  -    float height;
  -    boolean converted;
   
  +    private Document svgDoc = null;
  +    private float width;
  +    private float height;
  +    private boolean converted;
  +
  +    /**
  +     * @see org.apache.fop.fo.FONode#FONode(FONode)
  +     */
       public PlanElement(FONode parent) {
           super(parent);
       }
   
  +    /**
  +     * @see org.apache.fop.fo.FONode#handleAttrs(Attributes)
  +     */
       public void handleAttrs(Attributes attlist) throws FOPException {
           super.handleAttrs(attlist);
           createBasicDocument();
       }
   
  +    /**
  +     * Converts the element to SVG.
  +     */
       public void convertToSVG() {
           try {
  -        if(!converted) {
  -            converted = true;
  -            PlanRenderer pr = new PlanRenderer();
  -            pr.setFontInfo("Helvetica", 12);
  -            svgDoc = pr.createSVGDocument(doc);
  -            width = pr.getWidth();
  -            height = pr.getHeight();
  -
  -            doc = svgDoc;
  -        }
  -        } catch(Throwable t) {
  +            if (!converted) {
  +                converted = true;
  +                PlanRenderer pr = new PlanRenderer();
  +                pr.setFontInfo("Helvetica", 12);
  +                svgDoc = pr.createSVGDocument(doc);
  +                width = pr.getWidth();
  +                height = pr.getHeight();
  +    
  +                doc = svgDoc;
  +            }
  +        } catch (Throwable t) {
               getLogger().error("Could not convert Plan to SVG", t);
               width = 0;
               height = 0;
  @@ -49,18 +106,27 @@
   
       }
   
  +    /**
  +     * @see org.apache.fop.fo.XMLObj#getDocument()
  +     */
       public Document getDocument() {
           convertToSVG();
           return doc;
       }
   
  +    /**
  +     * @see org.apache.fop.fo.XMLObj#getDocumentNamespace()
  +     */
       public String getDocumentNamespace() {
  -        if(svgDoc == null) {
  +        if (svgDoc == null) {
               return PlanElementMapping.URI;
           }
           return "http://www.w3.org/2000/svg";;
       }
   
  +    /**
  +     * @see org.apache.fop.fo.XMLObj#getDimension(Point2D)
  +     */
       public Point2D getDimension(Point2D view) {
           convertToSVG();
           return new Point2D.Float(width, height);
  
  
  
  1.2       +55 -7     xml-fop/examples/plan/src/org/apache/fop/plan/PlanDrawer.java
  
  Index: PlanDrawer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/PlanDrawer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PlanDrawer.java   29 Jan 2003 16:35:07 -0000      1.1
  +++ PlanDrawer.java   7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,16 +1,64 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
   import java.util.HashMap;
   
   import org.w3c.dom.Document;
   
  +/**
  + * This interface defines how a plan drawer is converted.
  + */
   public interface PlanDrawer {
  -    public Document createDocument(EventList data, float w, float h,
  +    
  +    Document createDocument(EventList data, float w, float h,
                                      HashMap hints);
   }
  
  
  
  1.2       +143 -77   
xml-fop/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java
  
  Index: SimplePlanDrawer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimplePlanDrawer.java     29 Jan 2003 16:35:07 -0000      1.1
  +++ SimplePlanDrawer.java     7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,52 +1,109 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
  -import org.apache.fop.svg.SVGUtilities;
  -
  -import java.util.*;
  -import java.text.*;
  -import java.awt.*;
  -import java.awt.geom.AffineTransform;
  -import java.awt.geom.Rectangle2D;
  -import java.awt.font.FontRenderContext;
  -
  -import org.w3c.dom.*;
  -import org.w3c.dom.svg.*;
  -import org.w3c.dom.css.*;
  +import java.text.DateFormat;
  +import java.util.Calendar;
  +import java.util.Date;
  +import java.util.HashMap;
  +
  +import org.w3c.dom.DOMImplementation;
  +import org.w3c.dom.Document;
  +import org.w3c.dom.Element;
   
   import org.apache.batik.dom.svg.SVGDOMImplementation;
  +import org.apache.fop.svg.SVGUtilities;
   
  +/**
  + * Simple plan drawer implementation.
  + */
   public class SimplePlanDrawer implements PlanDrawer {
  -    final static String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
  -    float fontSize;
  -    HashMap hints;
  -    java.awt.Font font = null;
  -    boolean bord = false;
  -    float lSpace = 15;
  -    float width;
  -    float height;
  -    float topEdge;
  -    float rightEdge;
  -
  -    String[] colours;
  -    String[] darkcolours;
  -
  -    Date startDate;
  -    Date endDate;
  -
  +    
  +    private static final String SVG_NAMESPACE = 
SVGDOMImplementation.SVG_NAMESPACE_URI;
  +    
  +    private float fontSize;
  +    private HashMap hints;
  +    private java.awt.Font font = null;
  +    private boolean bord = false;
  +    private float lSpace = 15;
  +    private float width;
  +    private float height;
  +    private float topEdge;
  +    private float rightEdge;
  +
  +    private String[] colours;
  +    private String[] darkcolours;
  +
  +    private Date startDate;
  +    private Date endDate;
  +
  +    /**
  +     * Sets the start date.
  +     * @param sd start date
  +     */
       public void setStartDate(Date sd) {
           startDate = sd;
       }
   
  +    /**
  +     * Sets the end date.
  +     * @param ed end date
  +     */
       public void setEndDate(Date ed) {
           endDate = ed;
       }
   
  +    /**
  +     * @see org.apache.fop.plan.PlanDrawer#createDocument(EventList, float, float, 
HashMap)
  +     */
       public Document createDocument(EventList data, float w, float h,
                                      HashMap hints) {
           this.width = w;
  @@ -58,22 +115,23 @@
           String title = "";
   
           DOMImplementation impl =
  -          SVGDOMImplementation.getDOMImplementation();
  -        Document doc = impl.createDocument(svgNS, "svg", null);
  +            SVGDOMImplementation.getDOMImplementation();
  +        Document doc = impl.createDocument(SVG_NAMESPACE, "svg", null);
   
           Element svgRoot = doc.getDocumentElement();
           svgRoot.setAttributeNS(null, "width", "" + width);
           svgRoot.setAttributeNS(null, "height", "" + height);
           svgRoot.setAttributeNS(null, "style",
  -                               "font-size:" + 8 + ";font-family:" +
  -                               hints.get(PlanHints.FONT_FAMILY));
  +                               "font-size:" + 8 
  +                                   + ";font-family:" 
  +                                   + hints.get(PlanHints.FONT_FAMILY));
   
  -        font = new java.awt.Font( (String) hints.get(PlanHints.FONT_FAMILY),
  -                                  java.awt.Font.PLAIN, (int) fontSize);
  +        font = new java.awt.Font((String)hints.get(PlanHints.FONT_FAMILY),
  +                                  java.awt.Font.PLAIN, (int)fontSize);
   
           if (bord) {
               Element border =
  -              SVGUtilities.createRect(doc, 0, 0, width, height);
  +                SVGUtilities.createRect(doc, 0, 0, width, height);
               border.setAttributeNS(null, "style", "stroke:black;fill:none");
               svgRoot.appendChild(border);
           }
  @@ -104,7 +162,7 @@
           Date lastWeek = startDate;
           Date future = endDate;
           Calendar lw = Calendar.getInstance();
  -        if(lastWeek == null || future == null) {
  +        if (lastWeek == null || future == null) {
               int dow = lw.get(Calendar.DAY_OF_WEEK);
               lw.add(Calendar.DATE, -dow - 6);
               lastWeek = lw.getTime();
  @@ -123,15 +181,15 @@
           svgRoot.appendChild(line);
   
           Element clip1 = SVGUtilities.createClip(doc,
  -                                                SVGUtilities.createPath(doc,
  -                                                                        "m0 0l126 
0l0 " + height + "l-126 0z"), "clip1");
  +                SVGUtilities.createPath(doc,
  +                    "m0 0l126 0l0 " + height + "l-126 0z"), "clip1");
           Element clip2 = SVGUtilities.createClip(doc,
  -                                                SVGUtilities.createPath(doc,
  -                                                                        "m130 0l66 
0l0 " + height + "l-66 0z"), "clip2");
  +                SVGUtilities.createPath(doc,
  +                    "m130 0l66 0l0 " + height + "l-66 0z"), "clip2");
           Element clip3 = SVGUtilities.createClip(doc,
  -                                                SVGUtilities.createPath(doc,
  -                                                                        "m200 0l" + 
(width - 200) + " 0l0 " + height + "l-" +
  -                                                                        (width - 
200) + " 0z"), "clip3");
  +                SVGUtilities.createPath(doc,
  +                    "m200 0l" + (width - 200) + " 0l0 " + height + "l-"
  +                        + (width - 200) + " 0z"), "clip3");
           svgRoot.appendChild(clip1);
           svgRoot.appendChild(clip2);
           svgRoot.appendChild(clip3);
  @@ -155,9 +213,10 @@
               offset++;
               if (count % 7 == 0 || count % 7 == 1) {
                   Element rect = SVGUtilities.createRect(doc,
  -                                                       200 + (offset - 1) * (width 
- 200) / (totalDays - 2),
  -                                                       (float)(topEdge + 0.5), 
(width - 200) / (totalDays - 3),
  -                                                       height - 1 - topEdge);
  +                    200 + (offset - 1) * (width - 200) / (totalDays - 2),
  +                    (float)(topEdge + 0.5),
  +                    (width - 200) / (totalDays - 3),
  +                    height - 1 - topEdge);
                   rect.setAttributeNS(null, "style", 
"stroke:none;fill:rgb(230,230,230)");
                   svgRoot.appendChild(rect);
               }
  @@ -208,44 +267,51 @@
                       int left = 200;
                       int right = 500;
   
  -                    int daysToStart = (int)((start.getTime() -
  -                                             lastWeek.getTime() + 43200000) / 
86400000);
  -                    int days = (int)((end.getTime() - start.getTime() +
  -                                      43200000) / 86400000);
  +                    int daysToStart = (int)((start.getTime()
  +                                - lastWeek.getTime() + 43200000) / 86400000);
  +                    int days = (int)((end.getTime() - start.getTime()
  +                                + 43200000) / 86400000);
                       int daysFromEnd =
  -                      (int)((future.getTime() - end.getTime() +
  -                             43200000) / 86400000);
  +                        (int)((future.getTime() - end.getTime()
  +                            + 43200000) / 86400000);
                       Element taskGraphic;
                       switch (type) {
                           case ActionInfo.TASK:
                               taskGraphic = SVGUtilities.createRect(doc,
  -                                                                  left + 
daysToStart * 300 / (totalDays - 2),
  -                                                                  topEdge + 2, days 
* 300 / (totalDays - 2), 10);
  -                            taskGraphic.setAttributeNS(null, "style", 
"stroke:black;fill:blue;stroke-width:1;clip-path:url(#clip3)");
  +                                left + daysToStart * 300 / (totalDays - 2),
  +                                topEdge + 2, days * 300 / (totalDays - 2), 10);
  +                            taskGraphic.setAttributeNS(null, 
  +                                "style", 
  +                                
"stroke:black;fill:blue;stroke-width:1;clip-path:url(#clip3)");
                               g.appendChild(taskGraphic);
                               break;
                           case ActionInfo.MILESTONE:
                               taskGraphic = SVGUtilities.createPath(doc,
  -                                                                  "m " + (left +
  -                                                                          
daysToStart * 300 / (totalDays - 2) - 6) +
  -                                                                  " " + (topEdge + 
6) + "l6 6l6-6l-6-6z");
  -                            taskGraphic.setAttributeNS(null, "style", 
"stroke:black;fill:black;stroke-width:1;clip-path:url(#clip3)");
  +                                "m " + (left
  +                                    + daysToStart * 300 / (totalDays - 2) - 6)
  +                                    + " " + (topEdge + 6) + "l6 6l6-6l-6-6z");
  +                            taskGraphic.setAttributeNS(null, 
  +                                "style", 
  +                                
"stroke:black;fill:black;stroke-width:1;clip-path:url(#clip3)");
                               g.appendChild(taskGraphic);
                               text = SVGUtilities.createText(doc,
  -                                                           left + daysToStart * 300 
/ (totalDays - 2) + 8,
  -                                                           topEdge + 9, 
df.format(start));
  +                                left + daysToStart * 300 / (totalDays - 2) + 8,
  +                                topEdge + 9, df.format(start));
                               g.appendChild(text);
   
                               break;
                           case ActionInfo.GROUPING:
                               taskGraphic = SVGUtilities.createPath(doc,
  -                                                                  "m " + (left +
  -                                                                          
daysToStart * 300 / (totalDays - 2) - 6) +
  -                                                                  " " + (topEdge + 
6) + "l6 -6l" +
  -                                                                  (days * 300 / 
(totalDays - 2)) +
  -                                                                  " 0l6 6l-6 
6l-4-4l" + -
  -                                                                  (days * 300 / 
(totalDays - 2) - 8) + " 0l-4 4l-6-6z");
  -                            taskGraphic.setAttributeNS(null, "style", 
"stroke:black;fill:black;stroke-width:1;clip-path:url(#clip3)");
  +                                "m " + (left 
  +                                    + daysToStart * 300 / (totalDays - 2) - 6)
  +                                    + " " + (topEdge + 6) + "l6 -6l"
  +                                    + (days * 300 / (totalDays - 2))
  +                                    + " 0l6 6l-6 6l-4-4l"
  +                                    + -(days * 300 / (totalDays - 2) - 8)
  +                                    + " 0l-4 4l-6-6z");
  +                            taskGraphic.setAttributeNS(null,
  +                                "style", 
  +                                
"stroke:black;fill:black;stroke-width:1;clip-path:url(#clip3)");
                               g.appendChild(taskGraphic);
                               break;
                           default:
  @@ -262,8 +328,8 @@
               }
           }
           int currentDays =
  -          (int)((currentDate.getTime() - lastWeek.getTime() +
  -                 43200000) / 86400000);
  +          (int)((currentDate.getTime() - lastWeek.getTime()
  +                + 43200000) / 86400000);
   
           text = SVGUtilities.createText(doc,
                                          (float)(200 + (currentDays + 0.5) * 300 / 
35),
  
  
  
  1.2       +54 -7     xml-fop/examples/plan/src/org/apache/fop/plan/PlanObj.java
  
  Index: PlanObj.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/PlanObj.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PlanObj.java      29 Jan 2003 16:35:07 -0000      1.1
  +++ PlanObj.java      7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,9 +1,53 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
   // FOP
  @@ -18,13 +62,16 @@
   public class PlanObj extends XMLObj {
   
       /**
  -     *
  +     * Creates a new Plan object.
        * @param parent the parent formatting object
        */
       public PlanObj(FONode parent) {
           super(parent);
       }
   
  +    /**
  +     * @see org.apache.fop.fo.XMLObj#getNameSpace()
  +     */
       public String getNameSpace() {
           return "http://xml.apache.org/fop/plan";;
       }
  
  
  
  1.2       +64 -7     xml-fop/examples/plan/src/org/apache/fop/plan/PlanHints.java
  
  Index: PlanHints.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/examples/plan/src/org/apache/fop/plan/PlanHints.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PlanHints.java    29 Jan 2003 16:35:07 -0000      1.1
  +++ PlanHints.java    7 Mar 2003 10:47:51 -0000       1.2
  @@ -1,20 +1,77 @@
  -/* $Id$
  - * 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.
  - */
  -
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.plan;
   
  -public class PlanHints {
  +/**
  + * This interface defines some constants for use in the plan package.
  + */
  +public interface PlanHints {
  +    
  +    /** Border attribute */
       public static final String PLAN_BORDER = "border";
  +    /** Legend attribute */
       public static final String PLAN_LEGEND = "legend";
  +    /** Font family attribute */
       public static final String FONT_FAMILY = "font-family";
  +    /** Font size attribute */
       public static final String FONT_SIZE = "font-size";
  +    /** Legent type attribute */
       public static final String LEGEND_TYPE = "legendType";
  +    /** Locale attribute */
       public static final String LOCALE = "locale";
  +    /** Label type attribute */
       public static final String LABEL_TYPE = "labelType";
  +    /** Label font size attribute */
       public static final String LABEL_FONT_SIZE = "labelFontSize";
  +    /** Label font attribute */
       public static final String LABEL_FONT = "labelFont";
   
   }
  
  
  

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

Reply via email to