diff options
author | Karen Lease <klease@apache.org> | 2002-05-26 15:02:44 +0000 |
---|---|---|
committer | Karen Lease <klease@apache.org> | 2002-05-26 15:02:44 +0000 |
commit | cf792550e99092e4137e54393d355263b7e34e5e (patch) | |
tree | 30fe8efe2ca295184c85aa6d89202bcacfc2d8f1 /src/org/apache/fop/area/Area.java | |
parent | 17c3c8e200822fb2856be9358e61bf50539c7cec (diff) | |
download | xmlgraphics-fop-cf792550e99092e4137e54393d355263b7e34e5e.tar.gz xmlgraphics-fop-cf792550e99092e4137e54393d355263b7e34e5e.zip |
PR:
Obtained from:
Submitted by:
Reviewed by:
Separate Position from BreakPoss and create Leaf and NonLeafPosition classes.
Move management of Trait to top level Area class and use HAshMap instead of List.
Generalize handling of Trait in XMLRenderer and AreaTreeBuilder.
Improve handling of word-space and inter-area inline spaces in BP-style layout
managers. Set border and padding traits on InlineParent areas.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194840 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/area/Area.java')
-rw-r--r-- | src/org/apache/fop/area/Area.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/org/apache/fop/area/Area.java b/src/org/apache/fop/area/Area.java index f041f9227..8a3552f0b 100644 --- a/src/org/apache/fop/area/Area.java +++ b/src/org/apache/fop/area/Area.java @@ -10,6 +10,8 @@ package org.apache.fop.area; import java.io.Serializable; import org.apache.fop.fo.FObj; +import java.util.HashMap; + // If the area appears more than once in the output // or if the area has external data it is cached // to keep track of it and to minimize rendered output @@ -126,4 +128,33 @@ public class Area implements Serializable { public FObj getGeneratingFObj() { return this.genFObj; } + + // Do nothing! Let subclasses do something if they can have child areas. + public void addChild(Area child) { + } + + + HashMap props = null; + + public void addTrait(Trait prop) { + if (props == null) { + props = new HashMap(20); + } + props.put(prop.propType, prop.data); + } + + public void addTrait(Object traitCode, Object prop) { + if (props == null) { + props = new HashMap(20); + } + props.put(traitCode, prop); + } + + public HashMap getTraits() { + return this.props; + } + + public Object getTrait(Object oTraitCode) { + return (props != null? props.get(oTraitCode) : null); + } } |