aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/tools/AreaTreeBuilder.java
diff options
context:
space:
mode:
authorWilliam Victor Mote <vmote@apache.org>2003-08-14 07:42:59 +0000
committerWilliam Victor Mote <vmote@apache.org>2003-08-14 07:42:59 +0000
commit1041ea8c48bebd72fe8544906fbff40f43ca70e0 (patch)
treeefce02ef7a3f813f17c5d0af69cd590cf4474582 /src/java/org/apache/fop/tools/AreaTreeBuilder.java
parentdfadcfe581e7da20c26d08325efa5b40ce63e837 (diff)
downloadxmlgraphics-fop-1041ea8c48bebd72fe8544906fbff40f43ca70e0.tar.gz
xmlgraphics-fop-1041ea8c48bebd72fe8544906fbff40f43ca70e0.zip
1. create control package
2. move layout.FontInfo to control.Document git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196798 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/tools/AreaTreeBuilder.java')
-rw-r--r--src/java/org/apache/fop/tools/AreaTreeBuilder.java39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/java/org/apache/fop/tools/AreaTreeBuilder.java b/src/java/org/apache/fop/tools/AreaTreeBuilder.java
index c2f463dfa..5f06e5bf0 100644
--- a/src/java/org/apache/fop/tools/AreaTreeBuilder.java
+++ b/src/java/org/apache/fop/tools/AreaTreeBuilder.java
@@ -3,34 +3,34 @@
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -42,12 +42,12 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.tools;
// Java
@@ -65,7 +65,8 @@ import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Element;
-import org.w3c.dom.Document;
+/* org.w3c.dom.Document is not imported to avoid conflict with
+ org.apache.fop.control.Document */
// Batik
import org.apache.batik.dom.svg.SVGDOMImplementation;
@@ -99,7 +100,7 @@ import org.apache.fop.area.inline.Leader;
import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.Viewport;
import org.apache.fop.area.inline.Word;
-import org.apache.fop.layout.FontInfo;
+import org.apache.fop.control.Document;
import org.apache.fop.layout.FontState;
import org.apache.fop.render.Renderer;
import org.apache.fop.render.pdf.PDFRenderer;
@@ -168,7 +169,7 @@ public class AreaTreeBuilder extends AbstractLogEnabled {
rend = new SVGRenderer();
}
setupLogger(rend);
- FontInfo fi = new FontInfo();
+ Document fi = new Document();
rend.setupFontInfo(fi);
FOUserAgent ua = new FOUserAgent();
setupLogger(ua);
@@ -247,10 +248,10 @@ public class AreaTreeBuilder extends AbstractLogEnabled {
class TreeLoader extends AbstractLogEnabled {
private AreaTree areaTree;
private AreaTreeModel model;
- private FontInfo fontInfo;
+ private Document fontInfo;
private FontState currentFontState;
- TreeLoader(FontInfo fi) {
+ TreeLoader(Document fi) {
fontInfo = fi;
}
@@ -259,7 +260,7 @@ class TreeLoader extends AbstractLogEnabled {
}
public void buildAreaTree(InputStream is) {
- Document doc = null;
+ org.w3c.dom.Document doc = null;
try {
DocumentBuilderFactory fact =
DocumentBuilderFactory.newInstance();
@@ -558,7 +559,7 @@ class TreeLoader extends AbstractLogEnabled {
Character ch =
new Character(getString((Element) obj).charAt(0));
addTraits((Element) obj, ch);
- String fname = fontInfo.fontLookup("sans-serif", "normal", FontInfo.NORMAL);
+ String fname = fontInfo.fontLookup("sans-serif", "normal", Document.NORMAL);
FontMetrics metrics = fontInfo.getMetricsFor(fname);
currentFontState =
new FontState(fname, metrics, 12000);
@@ -583,7 +584,7 @@ class TreeLoader extends AbstractLogEnabled {
list.add(leader);
}
} else if (obj.getNodeName().equals("word")) {
- String fname = fontInfo.fontLookup("sans-serif", "normal", FontInfo.NORMAL);
+ String fname = fontInfo.fontLookup("sans-serif", "normal", Document.NORMAL);
FontMetrics metrics = fontInfo.getMetricsFor(fname);
currentFontState =
new FontState(fname, metrics, 12000);
@@ -637,7 +638,7 @@ class TreeLoader extends AbstractLogEnabled {
}
ForeignObject getForeignObject(Element root) {
- Document doc;
+ org.w3c.dom.Document doc;
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
NodeList childs = root.getChildNodes();