aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/layout/AreaTree.java
blob: 12554efd0779e57c8cead1eb6149d9efd632bd55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
 * $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.
 */

package org.apache.fop.layout;

// FOP
import org.apache.fop.apps.FOPException;
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;

// 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;

    public AreaTree() {
    }

    public void setFontInfo(FontInfo fontInfo) {
        this.fontInfo = fontInfo;
    }

    public FontInfo getFontInfo() {
        return this.fontInfo;
    }

    public Page getNextPage(Page current, boolean isWithinPageSequence,
                            boolean isFirstCall) {
        //return streamRenderer.getNextPage(current, isWithinPageSequence,isFirstCall);
	return null; // This will go away in new layout!
    }

    public Page getPreviousPage(Page current, boolean isWithinPageSequence,
                                boolean isFirstCall) {
        //return streamRenderer.getPreviousPage(current,isWithinPageSequence,isFirstCall);
	return null; // This will go away in new layout!
    }

    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 null;//streamRenderer.getIDReferences();
    }

    public void addExtension(ExtensionObj obj) {
        if(rootExtensions ==null)
            rootExtensions = new Vector();
        rootExtensions.addElement(obj);
    }

}