diff options
author | Glen Mazza <gmazza@apache.org> | 2004-05-22 21:44:38 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-05-22 21:44:38 +0000 |
commit | 63afbbbd99eced56126e226e117f33652d8067b4 (patch) | |
tree | 5034fc18f721ed36ca773f5c0555a0ec3cba2d82 /src/java/org/apache/fop/fo/FObj.java | |
parent | 579ea70d54fbd5a82bc0afe59686c57dae37bc6c (diff) | |
download | xmlgraphics-fop-63afbbbd99eced56126e226e117f33652d8067b4.tar.gz xmlgraphics-fop-63afbbbd99eced56126e226e117f33652d8067b4.zip |
PR:
Obtained from:
Submitted by:
Reviewed by:
Made propertyList member variable of fo.FObj protected (instead of public).
Property value queries routed through FObj instead of PropertyList.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197614 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/FObj.java')
-rw-r--r-- | src/java/org/apache/fop/fo/FObj.java | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index c1cc9891e..cec89be12 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -42,7 +42,7 @@ public class FObj extends FONode implements Constants { /** * Formatting properties for this fo element. */ - public PropertyList propertyList; + protected PropertyList propertyList; /** * Property manager for handling some common properties. @@ -292,10 +292,51 @@ public class FObj extends FONode implements Constants { * @return the property */ public Property getProperty(int propId) { - return (propertyList.get(propId)); + return propertyList.get(propId); } /** + * Return the "nearest" specified value for the given property. + * Implements the from-nearest-specified-value function. + * @param propertyName The name of the property whose value is desired. + * @return The computed value if the property is explicitly set on some + * ancestor of the current FO, else the initial value. + */ + public Property getNearestSpecifiedProperty(int propId) { + return propertyList.getNearestSpecified(propId); + } + + /** + * Return the value explicitly specified on this FO. + * @param propertyName The name of the property whose value is desired. + * It may be a compound name, such as space-before.optimum. + * @return The value if the property is explicitly set, otherwise null. + */ + public Property getExplicitProperty(int propId) { + return propertyList.getExplicit(propId); + } + + /** + * Uses the stored writingMode. + * @param absdir an absolute direction (top, bottom, left, right) + * @return the corresponding writing model relative direction name + * for the flow object. + */ + public int getWritingMode(int lrtb, int rltb, int tbrl) { + return propertyList.getWritingMode(lrtb, rltb, tbrl); + } + + + /** + * Uses the stored writingMode. + * @param relativeWritingMode relative direction (start, end, before, after) + * @return the corresponding absolute direction name for the flow object. + */ + public String getAbsoluteWritingMode(int relativeWritingMode) { + return propertyList.getAbsoluteWritingMode(relativeWritingMode); + } + + /** * 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 |