From 63afbbbd99eced56126e226e117f33652d8067b4 Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Sat, 22 May 2004 21:44:38 +0000 Subject: 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 --- src/java/org/apache/fop/fo/PropertyList.java | 46 +++++++++++++++------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'src/java/org/apache/fop/fo/PropertyList.java') 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" }; @@ -306,17 +308,26 @@ public class PropertyList extends HashMap { return null; // Exception in makeProperty! } + /** + * 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,29 +335,20 @@ 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]; } } } return ""; } - /** - * 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. -- cgit v1.2.3