]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fourth phase of performance improvement.
authorFinn Bock <bckfnn@apache.org>
Wed, 20 Oct 2004 18:21:27 +0000 (18:21 +0000)
committerFinn Bock <bckfnn@apache.org>
Wed, 20 Oct 2004 18:21:27 +0000 (18:21 +0000)
- Remove propertyList from FObj.

PR: 31699

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198094 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/FObj.java
src/java/org/apache/fop/fo/flow/TableRow.java

index 54b5851336ffcad544ce112420649af0ace0e30d..d50fd98fc43f08d0b6fbec278be49330712982d3 100644 (file)
@@ -26,7 +26,6 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.fop.fo.flow.Marker;
-import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.PropertyMaker;
 
 import org.xml.sax.Attributes;
@@ -39,9 +38,6 @@ import org.xml.sax.SAXParseException;
 public class FObj extends FONode implements Constants {
     public static PropertyMaker[] propertyListTable = null;
     
-    /** Formatting properties for this fo element. */
-    protected PropertyList propertyList;
-
     /** The immediate child nodes of this node. */
     public ArrayList childNodes = null;
 
@@ -96,9 +92,9 @@ public class FObj extends FONode implements Constants {
     public void processNode(String elementName, Locator locator, 
                             Attributes attlist, PropertyList pList) throws SAXParseException {
         setLocator(locator);
-        propertyList.addAttributesToList(attlist);
-        propertyList.setWritingMode();
-        bind(propertyList);
+        pList.addAttributesToList(attlist);
+        pList.setWritingMode();
+        bind(pList);
     }
 
     /**
@@ -106,8 +102,7 @@ public class FObj extends FONode implements Constants {
      */
     protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException {
         //return foEventHandler.getPropertyListMaker().make(this, parent);
-        propertyList = new StaticPropertyList(this, parent);
-        return propertyList;
+        return new StaticPropertyList(this, parent);
     }
 
     /**
@@ -147,60 +142,6 @@ public class FObj extends FONode implements Constants {
         return isOutOfLineFODescendant;
     }
 
-    /**
-     * Return the property list object for this FO.  PropertyList tends
-     * to hold the base, pre-trait properties for this FO, either explicitly
-     * declared in the input XML or from inherited values.
-     */
-    public PropertyList getPropertyList() {
-        return propertyList;
-    }
-
-    /**
-     * Helper method to quickly obtain the value of a property
-     * for this FO, without querying for the propertyList first.
-     * @param propId - the Constants ID of the desired property to obtain
-     * @return the property
-     */
-    public Property getProperty(int propId) {
-        return propertyList.get(propId);
-    }
-
-    /**
-     * Convenience method to quickly obtain the String value of a property
-     * for this FO, without querying for the propertyList first.
-     * Meaningful only for properties having a string representation
-     * @param propId - the Constants ID of the desired property to obtain
-     * @return the String value of the property value
-     */
-    public String getPropString(int propId) {
-        return propertyList.get(propId).getString();
-    }
-
-    /**
-     * Convenience method to quickly obtain the length value of a property
-     * for this FO, without querying for the propertyList first.
-     * Meaningful only for properties having a length representation
-     * Note: getValue() only correct after resolution completed, therefore
-     * should be called only in layout manager code.
-     * @param propId - the Constants ID of the desired property to obtain
-     * @return the length value of the property value
-     */
-    public int getPropLength(int propId) {
-        return propertyList.get(propId).getLength().getValue();
-    }
-
-    /**
-     * Convenience method to quickly obtain the Constants class enumeration
-     * value of a property for this FO.  Meaningful only for properties
-     * having an enumeration representation
-     * @param propId - the Constants ID of the desired property to obtain
-     * @return the enumeration value of the property value
-     */
-    public int getPropEnum(int propId) {
-        return propertyList.get(propId).getEnum();
-    }
-
     /**
      * @see org.apache.fop.fo.FONode#addChildNode(FONode)
      */
index 5da858d953f7826023a51e26864a4d4a3762b19d..74a317155605c437635943c46e70147f4575dd1b 100644 (file)
@@ -26,7 +26,6 @@ import org.xml.sax.Locator;
 import org.xml.sax.SAXParseException;
 
 // FOP
-import org.apache.fop.datatypes.KeepValue;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
@@ -38,9 +37,6 @@ import org.apache.fop.fo.properties.CommonRelativePosition;
 import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.LengthRangeProperty;
 import org.apache.fop.layoutmgr.table.Row;
-import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.properties.Property;
-
 
 /**
  * Class modelling the fo:table-row object.
@@ -127,21 +123,6 @@ public class TableRow extends FObj {
         }
     }
 
-    private KeepValue getKeepValue(int propId) {
-        Property p = this.propertyList.get(propId);
-        Number n = p.getNumber();
-        if (n != null) {
-            return new KeepValue(KeepValue.KEEP_WITH_VALUE, n.intValue());
-        }
-        switch (p.getEnum()) {
-        case Constants.ALWAYS:
-            return new KeepValue(KeepValue.KEEP_WITH_ALWAYS, 0);
-        case Constants.AUTO:
-        default:
-            return new KeepValue(KeepValue.KEEP_WITH_AUTO, 0);
-        }
-    }
-
     /**
      * Return the "id" property.
      */