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/PropertyList.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/PropertyList.java')
-rw-r--r-- | src/java/org/apache/fop/fo/PropertyList.java | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java index 373dca8be..d5421c085 100644 --- a/src/java/org/apache/fop/fo/PropertyList.java +++ b/src/java/org/apache/fop/fo/PropertyList.java @@ -33,9 +33,11 @@ import org.apache.fop.fo.properties.PropertyMaker; public class PropertyList extends HashMap { // writing-mode values - private byte[] wmtable = null; + private byte[] writingModeTable = null; + // writing-mode index private int writingMode; + private static boolean[] inheritableProperty; // absolute directions and dimensions @@ -66,11 +68,11 @@ public class PropertyList extends HashMap { /** constant for dimension "inline-progression-dimension" */ public static final int INLINEPROGDIM = 5; - private static final String[] ABS_NAMES = new String[] { + private static final String[] ABS_WM_NAMES = new String[] { "left", "right", "top", "bottom", "height", "width" }; - private static final String[] REL_NAMES = new String[] { + private static final String[] REL_WM_NAMES = new String[] { "start", "end", "before", "after", "block-progression-dimension", "inline-progression-dimension" }; @@ -307,16 +309,25 @@ public class PropertyList extends HashMap { } /** + * Set the writing mode traits for the FO with this property list. + * @param writingMode the writing-mode property to be set for this object + */ + public void setWritingMode(int writingMode) { + this.writingMode = writingMode; + this.writingModeTable = (byte[])WRITING_MODE_TABLES.get(new Integer(writingMode)); + } + + /** * 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 wmMap(int lrtb, int rltb, int tbrl) { + public int getWritingMode(int lrtb, int rltb, int tbrl) { switch (writingMode) { - case Constants.WritingMode.LR_TB: return lrtb; - case Constants.WritingMode.RL_TB: return rltb; - case Constants.WritingMode.TB_RL: return tbrl; + case Constants.WritingMode.LR_TB: return lrtb; + case Constants.WritingMode.RL_TB: return rltb; + case Constants.WritingMode.TB_RL: return tbrl; } return -1; } @@ -324,14 +335,14 @@ public class PropertyList extends HashMap { /** * Uses the stored writingMode. - * @param reldir a writing mode relative direction (start, end, before, after) + * @param relativeWritingMode relative direction (start, end, before, after) * @return the corresponding absolute direction name for the flow object. */ - public String wmRelToAbs(int reldir) { - if (wmtable != null) { - for (int i = 0; i < wmtable.length; i++) { - if (wmtable[i] == reldir) { - return ABS_NAMES[i]; + public String getAbsoluteWritingMode(int relativeWritingMode) { + if (writingModeTable != null) { + for (int i = 0; i < writingModeTable.length; i++) { + if (writingModeTable[i] == relativeWritingMode) { + return ABS_WM_NAMES[i]; } } } @@ -339,15 +350,6 @@ public class PropertyList extends HashMap { } /** - * Set the writing mode traits for the FO with this property list. - * @param writingMode the writing-mode property to be set for this object - */ - public void setWritingMode(int writingMode) { - this.writingMode = writingMode; - this.wmtable = (byte[])WRITING_MODE_TABLES.get(new Integer(writingMode)); - } - - /** * * @param attributes Collection of attributes passed to us from the parser. * @throws FOPException If an error occurs while building the PropertyList |