diff options
author | Glen Mazza <gmazza@apache.org> | 2004-06-18 04:13:54 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-06-18 04:13:54 +0000 |
commit | c92ecf9bf2632fe049d641c2fa129d9ba836ea9d (patch) | |
tree | 599dda1364bd99566f375249ee4252a56d22d396 /src/java/org/apache/fop/tools | |
parent | ea13be29f9ebac2fa09fa8770bee8a93ab0d4a52 (diff) | |
download | xmlgraphics-fop-c92ecf9bf2632fe049d641c2fa129d9ba836ea9d.tar.gz xmlgraphics-fop-c92ecf9bf2632fe049d641c2fa129d9ba836ea9d.zip |
1. FOTreeBuilder modified to handle more of the renderer initialization.
2. AreaTree now takes a Renderer as a constructor, handles RenderPagesModel initialization.
3. FontInfo object moved from Driver/Document to fo.FOInputHandler.
4. getFontState/getFontInfo now take a fontInfo object directly instead of a apps.Document.
5. validity checking added to PageSequence.java
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197734 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/tools')
-rw-r--r-- | src/java/org/apache/fop/tools/AreaTreeBuilder.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/tools/AreaTreeBuilder.java b/src/java/org/apache/fop/tools/AreaTreeBuilder.java index 71b36ecbf..d2d0baff9 100644 --- a/src/java/org/apache/fop/tools/AreaTreeBuilder.java +++ b/src/java/org/apache/fop/tools/AreaTreeBuilder.java @@ -160,13 +160,13 @@ public class AreaTreeBuilder { } rend.setLogger(logger); - org.apache.fop.apps.Document doc = new org.apache.fop.apps.Document(null); - rend.setupFontInfo(doc.getFontInfo()); + FontInfo fontInfo = new FontInfo(); + rend.setupFontInfo(fontInfo); FOUserAgent ua = new FOUserAgent(); rend.setUserAgent(ua); StorePagesModel sm = AreaTree.createStorePagesModel(); - TreeLoader tl = new TreeLoader(doc); + TreeLoader tl = new TreeLoader(rend, fontInfo); tl.setLogger(logger); tl.setTreeModel(sm); try { @@ -238,12 +238,14 @@ public class AreaTreeBuilder { class TreeLoader { private AreaTree areaTree; private AreaTreeModel model; - private org.apache.fop.apps.Document document; + private Renderer renderer; + private FontInfo fontInfo; private Font currentFontState; private Log logger = null; - TreeLoader(org.apache.fop.apps.Document doc) { - document = doc; + TreeLoader(Renderer renderer, FontInfo fontInfo) { + this.renderer = renderer; + this.fontInfo = fontInfo; } /** @@ -271,7 +273,7 @@ class TreeLoader { Element root = null; root = doc.getDocumentElement(); - areaTree = new AreaTree(); + areaTree = new AreaTree(renderer); areaTree.setTreeModel(model); readAreaTree(root); @@ -558,8 +560,8 @@ class TreeLoader { Character ch = new Character(getString((Element) obj).charAt(0)); addTraits((Element) obj, ch); - String fname = document.getFontInfo().fontLookup("sans-serif", "normal", Font.NORMAL); - FontMetrics metrics = document.getFontInfo().getMetricsFor(fname); + String fname = fontInfo.fontLookup("sans-serif", "normal", Font.NORMAL); + FontMetrics metrics = fontInfo.getMetricsFor(fname); currentFontState = new Font(fname, metrics, 12000); @@ -583,8 +585,8 @@ class TreeLoader { list.add(leader); } } else if (obj.getNodeName().equals("word")) { - String fname = document.getFontInfo().fontLookup("sans-serif", "normal", Font.NORMAL); - FontMetrics metrics = document.getFontInfo().getMetricsFor(fname); + String fname = fontInfo.fontLookup("sans-serif", "normal", Font.NORMAL); + FontMetrics metrics = fontInfo.getMetricsFor(fname); currentFontState = new Font(fname, metrics, 12000); TextArea text = getText((Element) obj); |