From: Finn Bock Date: Wed, 20 Oct 2004 18:21:27 +0000 (+0000) Subject: Fourth phase of performance improvement. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~413 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=21faccdc8c9b02f1ebe153ef549d9892c1b5115c;p=xmlgraphics-fop.git Fourth phase of performance improvement. - Remove propertyList from FObj. PR: 31699 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198094 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 54b585133..d50fd98fc 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -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) */ diff --git a/src/java/org/apache/fop/fo/flow/TableRow.java b/src/java/org/apache/fop/fo/flow/TableRow.java index 5da858d95..74a317155 100644 --- a/src/java/org/apache/fop/fo/flow/TableRow.java +++ b/src/java/org/apache/fop/fo/flow/TableRow.java @@ -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. */