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 bc...@apache.org on 2004/10/18 22:15:19 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo FONode.java FObj.java

bckfnn      2004/10/18 13:15:19

  Modified:    src/java/org/apache/fop/fo FONode.java FObj.java
  Log:
  First phase of performance improvement.
  
  PR: 31699
  
  Revision  Changes    Path
  1.47      +19 -0     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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- FONode.java	12 Oct 2004 05:07:46 -0000	1.46
  +++ FONode.java	18 Oct 2004 20:15:19 -0000	1.47
  @@ -112,6 +112,18 @@
       }
   
       /**
  +     * Create a property list for this node. Return null if the node does not
  +     * need a property list.
  +     * @param parent the closest parent propertylist. 
  +     * @param foEventHandler The FOEventHandler where the PropertyListMaker 
  +     *              instance can be found.
  +     * @return A new property list.
  +     */
  +    protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException {
  +        return null;
  +    }
  +
  +    /**
        * Checks to make sure, during SAX processing of input document, that the
        * incoming node is valid for the this (parent) node (e.g., checking to
        * see that fo:table is not an immediate child of fo:root)
  @@ -134,6 +146,13 @@
                                    Locator locator) throws SAXParseException {
           // ignore
       }
  +
  +    /**
  +    *
  +    */
  +    protected void startOfNode() throws SAXParseException {
  +        // do nothing by default
  +   }
   
       /**
        *
  
  
  
  1.79      +42 -5     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.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- FObj.java	13 Oct 2004 00:31:46 -0000	1.78
  +++ FObj.java	18 Oct 2004 20:15:19 -0000	1.79
  @@ -103,6 +103,43 @@
       }
   
       /**
  +     * Create a default property list for this element. 
  +     */
  +    protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException {
  +        //return foEventHandler.getPropertyListMaker().make(this, parent);
  +        return null;
  +    }
  +
  +    /**
  +     * Bind property values from the property list to the FO node.
  +     * Must be overriden in all FObj subclasses. 
  +     * @param pList the PropertyList where the properties can be found.
  +     * @throws SAXParseException
  +     */
  +    public void bind(PropertyList pList) throws SAXParseException {
  +        throw new SAXParseException("Unconverted element " + this, locator);
  +    }
  +
  +    /**
  +     * Setup the id for this formatting object.
  +     * Most formatting objects can have an id that can be referenced.
  +     * This methods checks that the id isn't already used by another
  +     * fo and sets the id attribute of this object.
  +     */
  +     protected void checkId(String id) throws SAXParseException {
  +        if (!id.equals("")) {
  +            Set idrefs = getFOEventHandler().getIDReferences();
  +            if (!idrefs.contains(id)) {
  +                idrefs.add(id);
  +            } else {
  +                throw new SAXParseException("Property id \"" + id + 
  +                        "\" previously used; id values must be unique" +
  +                        " in document.", locator);
  +            }
  +        }
  +    }
  +
  +    /**
        * Set properties for this FO based on node attributes
        * @param attlist Collection of attributes passed to us from the parser.
        */
  @@ -236,11 +273,11 @@
        * @return FObj the nearest ancestor FONode that is an FObj
        */
       public FObj findNearestAncestorFObj() {
  -      FONode par = parent;
  -      while (par != null && !(par instanceof FObj)) {
  -          par = par.parent;
  -      }
  -      return (FObj) par;
  +        FONode par = parent;
  +        while (par != null && !(par instanceof FObj)) {
  +            par = par.parent;
  +        }
  +        return (FObj) par;
       }
   
       /**
  
  
  

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