You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vm...@apache.org on 2003/09/02 03:31:36 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo/pagination Flow.java PageSequence.java Title.java

vmote       2003/09/01 18:31:36

  Modified:    src/java/org/apache/fop/apps Document.java Driver.java
               src/java/org/apache/fop/fo FONode.java FOText.java
                        FOTreeBuilder.java FOTreeControl.java FObj.java
                        FObjMixed.java
               src/java/org/apache/fop/fo/flow Block.java Leader.java
                        PageNumber.java PageNumberCitation.java
               src/java/org/apache/fop/fo/pagination Flow.java
                        PageSequence.java Title.java
  Log:
  Remove all storage of fo/FOInputHandler from within the FO Tree itself, in favor of storing it one time in apps/Document and getting it from there when needed. Makes everything cleaner, and uses less memory, at the probable expense of some processing time (to go up the tree to get to Document).
  
  Revision  Changes    Path
  1.7       +15 -2     xml-fop/src/java/org/apache/fop/apps/Document.java
  
  Index: Document.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Document.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Document.java	1 Sep 2003 19:21:07 -0000	1.6
  +++ Document.java	2 Sep 2003 01:31:36 -0000	1.7
  @@ -62,6 +62,7 @@
   import org.apache.fop.area.AreaTreeModel;
   
   import org.apache.fop.fo.extensions.Bookmarks;
  +import org.apache.fop.fo.FOInputHandler;
   import org.apache.fop.fo.FOTreeControl;
   import org.apache.fop.fo.FOTreeEvent;
   import org.apache.fop.fo.FOTreeListener;
  @@ -112,6 +113,12 @@
       private Set idReferences = new HashSet();
   
       /**
  +     * Structure handler used to notify structure events
  +     * such as start end element.
  +     */
  +    public FOInputHandler foInputHandler;
  +
  +    /**
        * Main constructor
        * @param driver the Driver object that is the "parent" of this Document
        */
  @@ -383,5 +390,11 @@
           return idReferences;
       }
   
  -}
  +    /**
  +     * @return the FOInputHandler for parsing this FO Tree
  +     */
  +    public FOInputHandler getFOInputHandler() {
  +        return foInputHandler;
  +    }
   
  +}
  
  
  
  1.37      +1 -0      xml-fop/src/java/org/apache/fop/apps/Driver.java
  
  Index: Driver.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- Driver.java	23 Aug 2003 17:38:12 -0000	1.36
  +++ Driver.java	2 Sep 2003 01:31:36 -0000	1.37
  @@ -576,6 +576,7 @@
               currentDocument = new Document(this);
           }
           parser.setContentHandler(getContentHandler());
  +        currentDocument.foInputHandler = foInputHandler;
           /** LayoutStrategy is hard-wired for now, but needs to be made
           accessible through the API and/or configuration */
           if (foInputHandler instanceof FOTreeHandler) {
  
  
  
  1.11      +0 -7      xml-fop/src/java/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FONode.java	1 Sep 2003 18:33:05 -0000	1.10
  +++ FONode.java	2 Sep 2003 01:31:36 -0000	1.11
  @@ -118,13 +118,6 @@
       }
   
       /**
  -     * Sets the structure handler to send events to.
  -     * @param foih FOInputHandler instance
  -     */
  -    public void setFOInputHandler(FOInputHandler foih) {
  -    }
  -
  -    /**
        * Do something with the attributes for this element
        * @param attlist Collection of attributes passed to us from the parser.
        * @throws FOPException for errors or inconsistencies in the attributes
  
  
  
  1.10      +1 -6      xml-fop/src/java/org/apache/fop/fo/FOText.java
  
  Index: FOText.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOText.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FOText.java	22 Aug 2003 05:43:27 -0000	1.9
  +++ FOText.java	2 Sep 2003 01:31:36 -0000	1.10
  @@ -76,7 +76,7 @@
        * the character array containing the text
        */
       public char[] ca;
  -    private int start;
  +    public int start;
   
       /**
        * the length of the character array containing the text
  @@ -137,11 +137,6 @@
           textInfo = ti;
           createBlockPointers();
           textTransform();
  -    }
  -
  -    public void setFOInputHandler(FOInputHandler foih) {
  -        super.setFOInputHandler(foih);
  -        foInputHandler.characters(ca, start, length);
       }
   
       /**
  
  
  
  1.16      +0 -1      xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java
  
  Index: FOTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- FOTreeBuilder.java	1 Sep 2003 18:33:05 -0000	1.15
  +++ FOTreeBuilder.java	2 Sep 2003 01:31:36 -0000	1.16
  @@ -282,7 +282,6 @@
               fobj.setUserAgent(userAgent);
               // set the structure handler so that appropriate
               // elements can signal structure events
  -            fobj.setFOInputHandler(foInputHandler);
   
               fobj.handleAttrs(attlist);
           } catch (FOPException e) {
  
  
  
  1.7       +5 -1      xml-fop/src/java/org/apache/fop/fo/FOTreeControl.java
  
  Index: FOTreeControl.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeControl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FOTreeControl.java	1 Sep 2003 19:21:07 -0000	1.6
  +++ FOTreeControl.java	2 Sep 2003 01:31:36 -0000	1.7
  @@ -114,4 +114,8 @@
        */
       Set getIDReferences();
   
  +    /**
  +     * @return the FOInputHandler for parsing this FO Tree
  +     */
  +    FOInputHandler getFOInputHandler();
   }
  
  
  
  1.17      +0 -19     xml-fop/src/java/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FObj.java	1 Sep 2003 19:21:07 -0000	1.16
  +++ FObj.java	2 Sep 2003 01:31:36 -0000	1.17
  @@ -79,12 +79,6 @@
       protected static PropertyListBuilder plb = null;
   
       /**
  -     * Structure handler used to notify structure events
  -     * such as start end element.
  -     */
  -    protected FOInputHandler foInputHandler;
  -
  -    /**
        * Formatting properties for this fo element.
        */
       public PropertyList properties;
  @@ -249,19 +243,6 @@
               }
               children.add(child);
           }
  -    }
  -
  -    /**
  -     * Set the structure handler for handling structure events.
  -     *
  -     * @param st the structure handler
  -     */
  -    public void setFOInputHandler(FOInputHandler foih) {
  -        foInputHandler = foih;
  -    }
  -
  -    public FOInputHandler getFOInputHandler() {
  -        return foInputHandler;
       }
   
       /**
  
  
  
  1.13      +1 -11     xml-fop/src/java/org/apache/fop/fo/FObjMixed.java
  
  Index: FObjMixed.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObjMixed.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- FObjMixed.java	1 Sep 2003 18:33:05 -0000	1.12
  +++ FObjMixed.java	2 Sep 2003 01:31:36 -0000	1.13
  @@ -57,8 +57,6 @@
   public class FObjMixed extends FObj {
       /** TextInfo for this object */
       protected TextInfo textInfo = null;
  -    /** FontInfo for this object */
  -    protected FOTreeControl fontInfo = null;
   
       /**
        * @param parent FONode that is the parent of this object
  @@ -68,14 +66,6 @@
       }
   
       /**
  -     * @param foih FOInputHandler to set
  -     */
  -    public void setFOInputHandler(FOInputHandler foih) {
  -        super.setFOInputHandler(foih);
  -        fontInfo = foih.getFontInfo();
  -    }
  -
  -    /**
        * @param data array of characters containing text to be added
        * @param start starting array element to add
        * @param length number of characters to add
  @@ -90,7 +80,7 @@
   
           FOText ft = new FOText(data, start, length, textInfo, this);
           ft.setUserAgent(userAgent);
  -        ft.setFOInputHandler(foInputHandler);
  +        getFOTreeControl().getFOInputHandler().characters(ft.ca, ft.start, ft.length);
           addChild(ft);
       }
   
  
  
  
  1.7       +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/Block.java
  
  Index: Block.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Block.java	22 Aug 2003 06:27:34 -0000	1.6
  +++ Block.java	2 Sep 2003 01:31:36 -0000	1.7
  @@ -143,7 +143,7 @@
   
           setupID();
   
  -        foInputHandler.startBlock(this);
  +        getFOTreeControl().getFOInputHandler().startBlock(this);
       }
   
       private void setup() {
  @@ -270,7 +270,7 @@
        */
       public void end() {
           handleWhiteSpace();
  -        foInputHandler.endBlock(this);
  +        getFOTreeControl().getFOInputHandler().endBlock(this);
       }
   
       private void handleWhiteSpace() {
  
  
  
  1.13      +1 -12     xml-fop/src/java/org/apache/fop/fo/flow/Leader.java
  
  Index: Leader.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Leader.java	25 Aug 2003 17:06:46 -0000	1.12
  +++ Leader.java	2 Sep 2003 01:31:36 -0000	1.13
  @@ -79,8 +79,6 @@
       private int ruleThickness;
       private int leaderPattern;
       private int patternWidth;
  -    /** FontInfo for this object */
  -    protected FOTreeControl fontInfo = null;
       /** FontState for this object */
       protected Font fontState;
   
  @@ -91,15 +89,6 @@
           super(parent);
       }
   
  -
  -    /**
  -     * @param foih FOInputHandler to set
  -     */
  -    public void setFOInputHandler(FOInputHandler foih) {
  -        super.setFOInputHandler(foih);
  -        fontInfo = foih.getFontInfo();
  -    }
  -
       public void setup() {
   
           // Common Accessibility Properties
  @@ -113,7 +102,7 @@
           CommonBackground bProps = propMgr.getBackgroundProps();
   
           // Common Font Properties
  -        this.fontState = propMgr.getFontState(fontInfo);
  +        this.fontState = propMgr.getFontState(getFOTreeControl());
   
           // Common Margin Properties-Inline
           CommonMarginInline mProps = propMgr.getMarginInlineProps();
  
  
  
  1.13      +1 -11     xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java
  
  Index: PageNumber.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PageNumber.java	26 Aug 2003 15:49:22 -0000	1.12
  +++ PageNumber.java	2 Sep 2003 01:31:36 -0000	1.13
  @@ -71,8 +71,6 @@
    * Standard.
    */
   public class PageNumber extends FObj {
  -    /** FontInfo for this object */
  -    protected FOTreeControl fontInfo = null;
       /** FontState for this object */
       protected Font fontState;
   
  @@ -88,14 +86,6 @@
           super(parent);
       }
   
  -    /**
  -     * @param foih FOInputHandler to be set
  -     */
  -    public void setFOInputHandler(FOInputHandler foih) {
  -        super.setFOInputHandler(foih);
  -        fontInfo = foih.getFontInfo();
  -    }
  -
       public void setup() {
   
           // Common Accessibility Properties
  @@ -109,7 +99,7 @@
           CommonBackground bProps = propMgr.getBackgroundProps();
   
           // Common Font Properties
  -        this.fontState = propMgr.getFontState(fontInfo);
  +        this.fontState = propMgr.getFontState(getFOTreeControl());
   
           // Common Margin Properties-Inline
           CommonMarginInline mProps = propMgr.getMarginInlineProps();
  
  
  
  1.14      +1 -11     xml-fop/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
  
  Index: PageNumberCitation.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumberCitation.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- PageNumberCitation.java	26 Aug 2003 16:58:57 -0000	1.13
  +++ PageNumberCitation.java	2 Sep 2003 01:31:36 -0000	1.14
  @@ -74,8 +74,6 @@
    * block referenced with the ref-id attribute.
    */
   public class PageNumberCitation extends FObj {
  -    /** FontInfo for this object **/
  -    protected FOTreeControl fontInfo = null;
       /** Fontstate for this object **/
       protected Font fontState;
   
  @@ -95,14 +93,6 @@
       }
   
       /**
  -     * @param foih the FOInputHandler object to set
  -     */
  -    public void setFOInputHandler(FOInputHandler foih) {
  -        super.setFOInputHandler(foih);
  -        fontInfo = foih.getFontInfo();
  -    }
  -
  -    /**
        * @param str string to be measured
        * @return width (in millipoints ??) of the string
        */
  @@ -128,7 +118,7 @@
           CommonBackground bProps = propMgr.getBackgroundProps();
   
           // Common Font Properties
  -        this.fontState = propMgr.getFontState(fontInfo);
  +        this.fontState = propMgr.getFontState(getFOTreeControl());
   
           // Common Margin Properties-Inline
           CommonMarginInline mProps = propMgr.getMarginInlineProps();
  
  
  
  1.5       +3 -3      xml-fop/src/java/org/apache/fop/fo/pagination/Flow.java
  
  Index: Flow.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Flow.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Flow.java	22 Aug 2003 06:27:34 -0000	1.4
  +++ Flow.java	2 Sep 2003 01:31:36 -0000	1.5
  @@ -126,14 +126,14 @@
           // Now done in addChild of page-sequence
           //pageSequence.addFlow(this);
   
  -        foInputHandler.startFlow(this);
  +        getFOTreeControl().getFOInputHandler().startFlow(this);
       }
   
       /**
        * Tell the StructureRenderer that we are at the end of the flow.
        */
       public void end() {
  -        foInputHandler.endFlow(this);
  +        getFOTreeControl().getFOInputHandler().endFlow(this);
       }
   
       /**
  
  
  
  1.12      +2 -2      xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java
  
  Index: PageSequence.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PageSequence.java	27 Aug 2003 00:01:14 -0000	1.11
  +++ PageSequence.java	2 Sep 2003 01:31:36 -0000	1.12
  @@ -331,7 +331,7 @@
        */
       private void startStructuredPageSequence() {
           if (!sequenceStarted) {
  -            foInputHandler.startPageSequence(this);
  +            getFOTreeControl().getFOInputHandler().startPageSequence(this);
               sequenceStarted = true;
           }
       }
  @@ -343,7 +343,7 @@
        */
       public void end() {
           try {
  -            this.foInputHandler.endPageSequence(this);
  +            this.getFOTreeControl().getFOInputHandler().endPageSequence(this);
           } catch (FOPException fopex) {
               getLogger().error("Error in PageSequence.end(): "
                 + fopex.getMessage(), fopex);
  
  
  
  1.9       +2 -2      xml-fop/src/java/org/apache/fop/fo/pagination/Title.java
  
  Index: Title.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Title.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Title.java	27 Aug 2003 19:00:10 -0000	1.8
  +++ Title.java	2 Sep 2003 01:31:36 -0000	1.9
  @@ -91,7 +91,7 @@
           CommonBackground bProps = propMgr.getBackgroundProps();
   
           // Common Font Properties
  -        Font fontState = propMgr.getFontState(foInputHandler.getFontInfo());
  +        Font fontState = propMgr.getFontState(getFOTreeControl().getFOInputHandler().getFontInfo());
   
           // Common Margin Properties-Inline
           CommonMarginInline mProps = propMgr.getMarginInlineProps();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org