diff options
author | Glen Mazza <gmazza@apache.org> | 2004-12-01 01:45:21 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-12-01 01:45:21 +0000 |
commit | bfab061fc7b4f6f48120ffb2d04edd7e8d55644f (patch) | |
tree | e41205359967faaf8aefe59b0efe8ddf5216dbfc | |
parent | c25439898af3201381a87360faeccaada821b508 (diff) | |
download | xmlgraphics-fop-bfab061fc7b4f6f48120ffb2d04edd7e8d55644f.tar.gz xmlgraphics-fop-bfab061fc7b4f6f48120ffb2d04edd7e8d55644f.zip |
PR:
Obtained from:
Submitted by:
Reviewed by:
Minor simplifications and more commenting added.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198181 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/area/AreaTreeHandler.java | 3 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/BookmarkData.java | 34 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/pdf/PDFRenderer.java | 2 |
3 files changed, 15 insertions, 24 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java index 881e259bb..aef0179a3 100644 --- a/src/java/org/apache/fop/area/AreaTreeHandler.java +++ b/src/java/org/apache/fop/area/AreaTreeHandler.java @@ -255,13 +255,12 @@ public class AreaTreeHandler extends FOEventHandler { } log.debug("adding bookmarks to area tree"); - BookmarkData data = new BookmarkData(); + BookmarkData data = new BookmarkData(model); for (int count = 0; count < bookmarks.getOutlines().size(); count++) { Outline out = (Outline)(bookmarks.getOutlines()).get(count); data.addSubData(createBookmarkData(out)); } addOffDocumentItem(data); - data.setAreaTreeModel(model); } /** diff --git a/src/java/org/apache/fop/area/BookmarkData.java b/src/java/org/apache/fop/area/BookmarkData.java index 6b1ad7c76..1f301e400 100644 --- a/src/java/org/apache/fop/area/BookmarkData.java +++ b/src/java/org/apache/fop/area/BookmarkData.java @@ -38,11 +38,14 @@ public class BookmarkData extends OffDocumentItem implements Resolvable { /** * Create a new bookmark data object. - * This should only be call by the top level element as the - * id reference will be null. + * This should only be call by the top level element as its + * idref will be null. + * + * @param model the AreaTreeModel for this object */ - public BookmarkData() { + public BookmarkData(AreaTreeModel model) { idRef = null; + areaTreeModel = model; whenToProcess = IMMEDIATELY; } @@ -59,17 +62,6 @@ public class BookmarkData extends OffDocumentItem implements Resolvable { } /** - * Set the area tree model - * This should only be called for the top level element. - * The area tree model is used once resolving is complete. - * - * @param atm the area tree model for the current document - */ - public void setAreaTreeModel(AreaTreeModel atm) { - areaTreeModel = atm; - } - - /** * Get the id reference for this data. * * @return the id reference @@ -127,15 +119,15 @@ public class BookmarkData extends OffDocumentItem implements Resolvable { * @return the child bookmark data */ public BookmarkData getSubData(int count) { - return (BookmarkData)subData.get(count); + return (BookmarkData) subData.get(count); } /** - * Get the page that this resolves to. + * Get the PageViewport object that this bookmark refers to * - * @return the PageViewport that this extension resolves to + * @return the PageViewport that this bookmark points to */ - public PageViewport getPage() { + public PageViewport getPageViewport() { return pageRef; } @@ -165,12 +157,12 @@ public class BookmarkData extends OffDocumentItem implements Resolvable { * resolves id references of child elements that have the same * id reference. * - * @param id the id reference being resolved - * @param pages the list of pages the the id reference resolves to + * @param id the ID which has already been resolved to one or more + * PageViewport objects + * @param pages the list of PageViewport objects the ID resolves to */ public void resolve(String id, List pages) { // this method is buggy - if (!id.equals(idRef)) { BookmarkData bd = (BookmarkData)idRefs.get(id); idRefs.remove(id); diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index aa37362ae..714cd9d0c 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -302,7 +302,7 @@ public class PDFRenderer extends PrintRenderer { private void renderOutline(BookmarkData outline, PDFOutline parentOutline) { PDFOutline outlineRoot = pdfDoc.getOutlineRoot(); PDFOutline pdfOutline = null; - PageViewport pv = outline.getPage(); + PageViewport pv = outline.getPageViewport(); if (pv != null) { Rectangle2D bounds = pv.getViewArea(); double h = bounds.getHeight(); |