gmazza 2004/11/30 17:45:21 Modified: src/java/org/apache/fop/area AreaTreeHandler.java BookmarkData.java src/java/org/apache/fop/render/pdf PDFRenderer.java Log: Minor simplifications and more commenting added. Revision Changes Path 1.19 +2 -3 xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java Index: AreaTreeHandler.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- AreaTreeHandler.java 29 Nov 2004 08:45:14 -0000 1.18 +++ AreaTreeHandler.java 1 Dec 2004 01:45:21 -0000 1.19 @@ -255,13 +255,12 @@ } 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); } /** 1.2 +14 -22 xml-fop/src/java/org/apache/fop/area/BookmarkData.java Index: BookmarkData.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/BookmarkData.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BookmarkData.java 28 Oct 2004 00:06:46 -0000 1.1 +++ BookmarkData.java 1 Dec 2004 01:45:21 -0000 1.2 @@ -38,11 +38,14 @@ /** * 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 @@ } /** - * 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 @@ * @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 @@ * 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); 1.61 +1 -1 xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java Index: PDFRenderer.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- PDFRenderer.java 24 Nov 2004 21:07:30 -0000 1.60 +++ PDFRenderer.java 1 Dec 2004 01:45:21 -0000 1.61 @@ -302,7 +302,7 @@ 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();
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]