]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Precursor of the experimental AreaTree code.
authorPeter Bernard West <pbwest@apache.org>
Tue, 7 May 2002 16:29:02 +0000 (16:29 +0000)
committerPeter Bernard West <pbwest@apache.org>
Tue, 7 May 2002 16:29:02 +0000 (16:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@194798 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/layout/AreaTree.java

index 85a987b456440d06ead2b74d3b1c0a427540b5eb..0b048d95957c97ebf77b2ca8fa92bbb2b9939ae5 100644 (file)
@@ -1,97 +1,23 @@
-/*
- * $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
+/**
+ * AreaTree.java
+ *
+ *
+ * Created: Wed Nov  7 21:44:03 2001
+ *
+ * @author <a href="mailto: "Peter B. West</a>
+ * @version
  */
 
 package org.apache.fop.layout;
 
-// FOP
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.apps.StreamRenderer;
-import org.apache.fop.fo.flow.StaticContent;
-import org.apache.fop.svg.*;
-import org.apache.fop.render.Renderer;
-import org.apache.fop.datatypes.IDReferences;
-import org.apache.fop.extensions.ExtensionObj;
-import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.datastructs.Tree;
 
-// Java
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Enumeration;
-import java.util.Stack;
-import java.util.Vector;
-
-/*
- * Modified by Mark Lillywhite, mark-fop@inomial.com. No longer keeps
-   a list of pages in the tree, instead these are passed to the
-   StreamRenderer. No longer keeps it's own list of IDReferences;
-   these are handled by StreamRenderer. In many ways StreamRenderer
-   has taken over from AreaTree and possibly this might be a better
-   place to deal with things in the future..?<P>
-   
-   Any extensions added to the AreaTree while generating a page
-   are given to the Page for the renderer to deal with.
-  */
-
-public class AreaTree {
-
-    /**
-     * object containing information on available fonts, including
-     * metrics
-     */
-    FontInfo fontInfo;
-
-    /**
-     * List of root extension objects
-     */
-    Vector rootExtensions = null;
-
-    private StreamRenderer streamRenderer;
-
-    public AreaTree(StreamRenderer streamRenderer) {
-        this.streamRenderer = streamRenderer;
-    }
-
-    public void setFontInfo(FontInfo fontInfo) {
-        this.fontInfo = fontInfo;
-    }
-
-    public FontInfo getFontInfo() {
-        return this.fontInfo;
+public class AreaTree extends Tree implements Runnable{
+    public AreaTree (){
+        // initialize an empty tree
+        super();
     }
 
-    public Page getNextPage(Page current, boolean isWithinPageSequence,
-                            boolean isFirstCall) {
-        return streamRenderer.getNextPage(current, isWithinPageSequence,isFirstCall);
+    public void run() {
     }
-
-    public Page getPreviousPage(Page current, boolean isWithinPageSequence,
-                                boolean isFirstCall) {
-        return streamRenderer.getPreviousPage(current,isWithinPageSequence,isFirstCall);
-    }
-
-    public void addPage(Page page)
-    throws FOPException {
-        try {
-            page.setExtensions(rootExtensions);
-            rootExtensions = null;
-            streamRenderer.queuePage(page);
-        } catch (IOException e) {
-            throw new FOPException(e);
-        }
-    }
-
-    public IDReferences getIDReferences() {
-        return streamRenderer.getIDReferences();
-    }
-
-    public void addExtension(ExtensionObj obj) {
-        if(rootExtensions ==null)
-            rootExtensions = new Vector();
-        rootExtensions.addElement(obj);
-    }
-
 }