From: Peter Bernard West Date: Wed, 18 Sep 2002 05:51:13 +0000 (+0000) Subject: Many changes to protected mode. resolve() against node instead of tree. X-Git-Tag: Alt-Design_pre_Properties_split~105 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=922dff0db807279d46039f12708993a8b821bf44;p=xmlgraphics-fop.git Many changes to protected mode. resolve() against node instead of tree. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195215 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/datatypes/IndirectValue.java b/src/org/apache/fop/datatypes/IndirectValue.java index 6b6706139..932294a78 100644 --- a/src/org/apache/fop/datatypes/IndirectValue.java +++ b/src/org/apache/fop/datatypes/IndirectValue.java @@ -6,7 +6,7 @@ import org.apache.fop.fo.expr.PropertyValue; import org.apache.fop.fo.expr.PropertyTriplet; import org.apache.fop.fo.Properties; import org.apache.fop.fo.PropertyConsts; -import org.apache.fop.fo.FOTree; +import org.apache.fop.fo.FONode; /* * $Id$ @@ -43,14 +43,14 @@ public class IndirectValue extends AbstractPropertyValue { * The property from which the inherited value is to be derived. This * may be different from the target property. */ - private int sourceProperty; + protected int sourceProperty; /** * The PropertyTriplet from which this object is being * inherited. Set when the inheritance cannot be immediately resolved, * e.g. when the specified value is a percentage. */ - private PropertyTriplet inheritedValue = null; + protected PropertyTriplet inheritedValue = null; /** * @param property - the int index of the property on which @@ -60,7 +60,7 @@ public class IndirectValue extends AbstractPropertyValue { * which the inherited value is derived. * @exception PropertyException */ - public IndirectValue(int property, int type, int sourceProperty) + protected IndirectValue(int property, int type, int sourceProperty) throws PropertyException { super(property, type); @@ -73,7 +73,7 @@ public class IndirectValue extends AbstractPropertyValue { * @param type - the type of PropertyValue. * @exception PropertyException */ - public IndirectValue(int property, int type) + protected IndirectValue(int property, int type) throws PropertyException { this(property, type, property); @@ -87,7 +87,7 @@ public class IndirectValue extends AbstractPropertyValue { * from which the inherited value is derived. * @exception PropertyException */ - public IndirectValue + protected IndirectValue (String propertyName, int type, String sourcePropertyName) throws PropertyException { @@ -101,7 +101,7 @@ public class IndirectValue extends AbstractPropertyValue { * @param type - the type of PropertyValue. * @exception PropertyException */ - public IndirectValue(String propertyName, int type) + protected IndirectValue(String propertyName, int type) throws PropertyException { this(propertyName, type, propertyName); @@ -153,20 +153,24 @@ public class IndirectValue extends AbstractPropertyValue { } /** - * Attempt to resove the IndirectValue object. If no bequeathing - * PropertyTriplet is associated with this object, get it - * from the foTree. If the computed value of that triplet is + * Attempt to resolve the IndirectValue object. + * If no bequeathing PropertyTriplet, assume that the + * bequeathing node is the parent node. This is true for the + * Inherit, InheritedValue and FromParent + * objects. FromNearestSpecified objects must override this + * method to ensure that resolution is carried out against the correct + * triplet. + *

If the computed value of that triplet is * null, return this object. If not, return the computed value. - * @param foTree - the FOTree with which this object is - * associated. + * @param node - the FONode with which this object is associated. * @return - a PropertyValue as described above. A return of * the same IndirectValue object implies that the inherited * computed value has not yet been resolved in the ancestor. */ - public PropertyValue resolve(FOTree foTree) throws PropertyException { + protected PropertyValue resolve(FONode node) throws PropertyException { PropertyValue pv; if (inheritedValue == null) - inheritedValue = foTree.getInheritedTriplet(sourceProperty); + inheritedValue = node.getParentTriplet(sourceProperty); if ((pv = inheritedValue.getComputed()) == null) return this; // Check that the property is the same