]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
move extensions/Outline.getData() to layoutmgr/LayoutManagerLS.createBookmarkData()
authorWilliam Victor Mote <vmote@apache.org>
Thu, 21 Aug 2003 19:01:24 +0000 (19:01 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Thu, 21 Aug 2003 19:01:24 +0000 (19:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196821 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/extensions/Outline.java
src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java

index 4b4a7830829cf1d946c36c76e63e3e86fe9e0fc7..a2a6520a5734cbdbb21fd7ae12b7ec4f3a5688b1 100644 (file)
@@ -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;
+    }
+
+}
index 0f6036c1c38372bd46733fe7344cea86c0175cd3..9412f9044c53b3caf6426678f446b7cf6c8fd046 100644 (file)
@@ -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;
+    }
+
 }