vmote       2003/08/21 12:01:24

  Modified:    src/java/org/apache/fop/extensions Outline.java
               src/java/org/apache/fop/layoutmgr LayoutManagerLS.java
  Log:
  move extensions/Outline.getData() to layoutmgr/LayoutManagerLS.createBookmarkData()
  
  Revision  Changes    Path
  1.4       +12 -19    xml-fop/src/java/org/apache/fop/extensions/Outline.java
  
  Index: Outline.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/extensions/Outline.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Outline.java      21 Aug 2003 18:17:49 -0000      1.3
  +++ Outline.java      21 Aug 2003 19:01:24 -0000      1.4
  @@ -57,7 +57,6 @@
   import java.util.ArrayList;
   
   import org.xml.sax.Attributes;
  -import org.apache.fop.area.extensions.BookmarkData;
   
   /**
    * The outline object for the pdf bookmark extension.
  @@ -116,23 +115,6 @@
       }
   
       /**
  -     * 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 @@
           fotv.serveVisitor(this);
       }
   
  -}
  +    public String getInternalDestination() {
  +        return internalDestination;
  +    }
  +
  +    public String getExternalDestination() {
  +        return externalDestination;
  +    }
   
  +    public ArrayList getOutlines() {
  +        return outlines;
  +    }
  +
  +}
  
  
  
  1.7       +19 -2     xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java
  
  Index: LayoutManagerLS.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LayoutManagerLS.java      21 Aug 2003 18:17:49 -0000      1.6
  +++ LayoutManagerLS.java      21 Aug 2003 19:01:24 -0000      1.7
  @@ -141,7 +141,7 @@
           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) {
  @@ -151,6 +151,23 @@
               at.addTreeExtension(data);
               data.setAreaTree(at);
           }
  +    }
  +
  +    /**
  +     * 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;
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to