From: Peter Bernard West Date: Wed, 30 Oct 2002 13:40:47 +0000 (+0000) Subject: Name changes for sparsePropsSet support. X-Git-Tag: Alt-Design_pre_src-java-org~207 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=21aa38300b4fa850afdb350e2089b2effe8c06cb;p=xmlgraphics-fop.git Name changes for sparsePropsSet support. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195377 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/fo/pagination/FoRegionBeforeAfter.java b/src/org/apache/fop/fo/pagination/FoRegionBeforeAfter.java index d48c97f53..e24826d5f 100644 --- a/src/org/apache/fop/fo/pagination/FoRegionBeforeAfter.java +++ b/src/org/apache/fop/fo/pagination/FoRegionBeforeAfter.java @@ -34,23 +34,24 @@ public class FoRegionBeforeAfter extends FONode { private static final String tag = "$Name$"; private static final String revision = "$Revision$"; - /** Map of Integer indices of applicableProps array. + /** Map of Integer indices of sparsePropsSet array. It is indexed by the FO index of the FO associated with a given - position in the applicableProps array. */ - protected static final HashMap applicablePropsHash; + position in the sparsePropsSet array. See + {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. + */ + protected static final HashMap sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ - protected static final int[] applicableIndices; + protected static final int[] sparseIndices; /** The number of applicable properties. This is the size of the - applicableProps array. */ + sparsePropsSet array. */ protected static final int numProps; static { - int propx = 0; // Collect the sets of properties that apply - BitSet propsets = (BitSet)(PropertySets.backgroundSet.clone()); + BitSet propsets = PropertySets.backgroundSetClone(); propsets.or(PropertySets.borderSet); propsets.or(PropertySets.paddingSet); propsets.set(PropNames.CLIP); @@ -62,18 +63,19 @@ public class FoRegionBeforeAfter extends FONode { propsets.set(PropNames.EXTENT); propsets.set(PropNames.PRECEDENCE); - // Map these properties into applicableProps - // applicableProps is a HashMap containing the indicies of the - // applicableProps array, indexed by the FO index of the FO slot - // in applicableProps. - applicablePropsHash = new HashMap(); + // Map these properties into sparsePropsSet + // sparsePropsSet is a HashMap containing the indicies of the + // sparsePropsSet array, indexed by the FO index of the FO slot + // in sparsePropsSet. + sparsePropsMap = new HashMap(); numProps = propsets.cardinality(); - applicableIndices = new int[numProps]; + sparseIndices = new int[numProps]; + int propx = 0; for (int next = propsets.nextSetBit(0); next >= 0; next = propsets.nextSetBit(next + 1)) { - applicableIndices[propx] = next; - applicablePropsHash.put + sparseIndices[propx] = next; + sparsePropsMap.put (Ints.consts.get(next), Ints.consts.get(propx++)); } } @@ -88,7 +90,8 @@ public class FoRegionBeforeAfter extends FONode { (FOTree foTree, int foType, FONode parent, FoXMLEvent event) throws Tree.TreeException, FOPException { - super(foTree, foType, parent, event, FOPropertySets.LAYOUT_SET); + super(foTree, foType, parent, event, FOPropertySets.LAYOUT_SET, + sparsePropsMap, sparseIndices, numProps); } } diff --git a/src/org/apache/fop/fo/pagination/FoRegionStartEnd.java b/src/org/apache/fop/fo/pagination/FoRegionStartEnd.java index 4051e4ba1..cfb70623a 100644 --- a/src/org/apache/fop/fo/pagination/FoRegionStartEnd.java +++ b/src/org/apache/fop/fo/pagination/FoRegionStartEnd.java @@ -34,23 +34,25 @@ public class FoRegionStartEnd extends FONode { private static final String tag = "$Name$"; private static final String revision = "$Revision$"; - /** Map of Integer indices of applicableProps array. + /** Map of Integer indices of sparsePropsSet array. It is indexed by the FO index of the FO associated with a given - position in the applicableProps array. */ - protected static final HashMap applicablePropsHash; + position in the sparsePropsSet array. See + {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. + */ + protected static final HashMap sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ - protected static final int[] applicableIndices; + protected static final int[] sparseIndices; /** The number of applicable properties. This is the size of the - applicableProps array. */ + sparsePropsSet array. */ protected static final int numProps; static { int propx = 0; // Collect the sets of properties that apply - BitSet propsets = (BitSet)(PropertySets.backgroundSet.clone()); + BitSet propsets = PropertySets.backgroundSetClone(); propsets.or(PropertySets.borderSet); propsets.or(PropertySets.paddingSet); propsets.set(PropNames.CLIP); @@ -61,18 +63,18 @@ public class FoRegionStartEnd extends FONode { propsets.set(PropNames.WRITING_MODE); propsets.set(PropNames.EXTENT); - // Map these properties into applicableProps - // applicableProps is a HashMap containing the indicies of the - // applicableProps array, indexed by the FO index of the FO slot - // in applicableProps. - applicablePropsHash = new HashMap(); + // Map these properties into sparsePropsSet + // sparsePropsSet is a HashMap containing the indicies of the + // sparsePropsSet array, indexed by the FO index of the FO slot + // in sparsePropsSet. + sparsePropsMap = new HashMap(); numProps = propsets.cardinality(); - applicableIndices = new int[numProps]; + sparseIndices = new int[numProps]; for (int next = propsets.nextSetBit(0); next >= 0; next = propsets.nextSetBit(next + 1)) { - applicableIndices[propx] = next; - applicablePropsHash.put + sparseIndices[propx] = next; + sparsePropsMap.put (Ints.consts.get(next), Ints.consts.get(propx++)); } } @@ -87,7 +89,8 @@ public class FoRegionStartEnd extends FONode { (FOTree foTree, int foType, FONode parent, FoXMLEvent event) throws Tree.TreeException, FOPException { - super(foTree, foType, parent, event, FOPropertySets.LAYOUT_SET); + super(foTree, foType, parent, event, FOPropertySets.LAYOUT_SET, + sparsePropsMap, sparseIndices, numProps); } }