From: William Victor Mote Date: Thu, 21 Aug 2003 19:01:24 +0000 (+0000) Subject: move extensions/Outline.getData() to layoutmgr/LayoutManagerLS.createBookmarkData() X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1182 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dcc9f741f59215f23d50cba549220e8b4f3f9876;p=xmlgraphics-fop.git move extensions/Outline.getData() to layoutmgr/LayoutManagerLS.createBookmarkData() git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196821 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/extensions/Outline.java b/src/java/org/apache/fop/extensions/Outline.java index 4b4a78308..a2a6520a5 100644 --- a/src/java/org/apache/fop/extensions/Outline.java +++ b/src/java/org/apache/fop/extensions/Outline.java @@ -57,7 +57,6 @@ import org.apache.fop.apps.FOPException; import java.util.ArrayList; import org.xml.sax.Attributes; -import org.apache.fop.area.extensions.BookmarkData; /** * The outline object for the pdf bookmark extension. @@ -115,23 +114,6 @@ public class Outline extends ExtensionObj { } } - /** - * Get the bookmark data for this outline. - * This creates a bookmark data with the destination - * and adds all the data from child outlines. - * - * @return the new bookmark data - */ - public BookmarkData getData() { - BookmarkData data = new BookmarkData(internalDestination); - data.setLabel(getLabel()); - for (int count = 0; count < outlines.size(); count++) { - Outline out = (Outline)outlines.get(count); - data.addSubData(out.getData()); - } - return data; - } - /** * Get the label string. * This gets the label string from the child label element. @@ -146,5 +128,16 @@ public class Outline extends ExtensionObj { fotv.serveVisitor(this); } -} + public String getInternalDestination() { + return internalDestination; + } + + public String getExternalDestination() { + return externalDestination; + } + public ArrayList getOutlines() { + return outlines; + } + +} diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java index 0f6036c1c..9412f9044 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java @@ -141,7 +141,7 @@ public class LayoutManagerLS extends LayoutStrategy { BookmarkData data = new BookmarkData(); for (int count = 0; count < document.getBookmarks().getOutlines().size(); count++) { Outline out = (Outline)(document.getBookmarks().getOutlines()).get(count); - data.addSubData(out.getData()); + data.addSubData(createBookmarkData(out)); } // add data to area tree for resolving and handling if (document.getBookmarks().getFOInputHandler() instanceof FOTreeHandler) { @@ -153,4 +153,21 @@ public class LayoutManagerLS extends LayoutStrategy { } } + /** + * Create and return the bookmark data for this outline. + * This creates a bookmark data with the destination + * and adds all the data from child outlines. + * + * @return the new bookmark data + */ + public BookmarkData createBookmarkData(Outline outline) { + BookmarkData data = new BookmarkData(outline.getInternalDestination()); + data.setLabel(outline.getLabel()); + for (int count = 0; count < outline.getOutlines().size(); count++) { + Outline out = (Outline)(outline.getOutlines()).get(count); + data.addSubData(createBookmarkData(out)); + } + return data; + } + }