diff options
author | Kelly Campbell <kellyc@apache.org> | 2001-02-06 07:34:48 +0000 |
---|---|---|
committer | Kelly Campbell <kellyc@apache.org> | 2001-02-06 07:34:48 +0000 |
commit | 4e96b8b7a7647e183a5a916a1c42deddbd91c6af (patch) | |
tree | 0cdbe16d0b2ebe56d997d912d8672a7cbf2477b6 /src/org/apache/fop/fo/pagination | |
parent | 1a3636171f599e31d9964fbcf6e32cfc3e6fbbf3 (diff) | |
download | xmlgraphics-fop-4e96b8b7a7647e183a5a916a1c42deddbd91c6af.tar.gz xmlgraphics-fop-4e96b8b7a7647e183a5a916a1c42deddbd91c6af.zip |
Added support for PDF outlines (aka bookmarks). See the example in
docs/examples/fo/pdfoutline.fo for an example.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194025 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/pagination')
-rw-r--r-- | src/org/apache/fop/fo/pagination/Root.java | 106 |
1 files changed, 58 insertions, 48 deletions
diff --git a/src/org/apache/fop/fo/pagination/Root.java b/src/org/apache/fop/fo/pagination/Root.java index 23546b083..58eb8ab28 100644 --- a/src/org/apache/fop/fo/pagination/Root.java +++ b/src/org/apache/fop/fo/pagination/Root.java @@ -57,69 +57,79 @@ import org.apache.fop.fo.flow.*; import org.apache.fop.fo.properties.*; import org.apache.fop.layout.AreaTree; import org.apache.fop.apps.FOPException; +import org.apache.fop.extensions.ExtensionObj; // Java import java.util.Vector; import java.util.Enumeration; +/** + * The fo:root formatting object. Contains page masters, root extensions, + * page-sequences. + */ public class Root extends FObj { - public static class Maker extends FObj.Maker { - public FObj make(FObj parent, PropertyList propertyList) throws FOPException { - return new Root(parent, propertyList); - } - } - - public static FObj.Maker maker() + + public static class Maker extends FObj.Maker { + public FObj make(FObj parent, PropertyList propertyList) + throws FOPException { - return new Root.Maker(); - } - - LayoutMasterSet layoutMasterSet; - Vector pageSequences; - - protected Root(FObj parent, PropertyList propertyList) throws FOPException - { - super(parent, propertyList); - this.name = "fo:root"; - - pageSequences = new Vector(); - if (parent != null) - { - throw new FOPException("root must be root element"); - } - } - - - public void addPageSequence(PageSequence pageSequence) - { - this.pageSequences.addElement(pageSequence); - } - - - public LayoutMasterSet getLayoutMasterSet() - { - return this.layoutMasterSet; + return new Root(parent, propertyList); } + } + public static FObj.Maker maker() + { + return new Root.Maker(); + } - public void format(AreaTree areaTree) throws FOPException - { -// MessageHandler.errorln(" Root[" + marker + "] "); - if(layoutMasterSet == null) - { - throw new FOPException("No layout master set."); - } + LayoutMasterSet layoutMasterSet; + Vector pageSequences; - Enumeration e = pageSequences.elements(); - while (e.hasMoreElements()) - { - ((PageSequence) e.nextElement()).format(areaTree); - } + protected Root(FObj parent, PropertyList propertyList) throws FOPException + { + super(parent, propertyList); + this.name = "fo:root"; - } + pageSequences = new Vector(); + if (parent != null) + { + throw new FOPException("root must be root element"); + } + } + /** @deprecated handled by addChild now + */ + public void addPageSequence(PageSequence pageSequence) + { + this.pageSequences.addElement(pageSequence); + } + + + public LayoutMasterSet getLayoutMasterSet() + { + return this.layoutMasterSet; + } public void setLayoutMasterSet(LayoutMasterSet layoutMasterSet) { this.layoutMasterSet = layoutMasterSet; } + + public void format(AreaTree areaTree) throws FOPException + { + // MessageHandler.errorln(" Root[" + marker + "] "); + if(layoutMasterSet == null) { + throw new FOPException("No layout master set."); + } + + Enumeration e = children.elements(); + while (e.hasMoreElements()) { + Object o = e.nextElement(); + if (o instanceof PageSequence) { + ((PageSequence) o).format(areaTree); + } + else if (o instanceof ExtensionObj) { + ((ExtensionObj)o).format(areaTree); + } + } + } } |