gmazza 2004/12/01 17:36:09 Modified: src/java/org/apache/fop/area AreaTreeHandler.java BookmarkData.java LinkResolver.java PageViewport.java Resolvable.java src/java/org/apache/fop/area/inline UnresolvedPageNumber.java Log: More commenting, slightly clearer method names. Revision Changes Path 1.20 +4 -4 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.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- AreaTreeHandler.java 1 Dec 2004 01:45:21 -0000 1.19 +++ AreaTreeHandler.java 2 Dec 2004 01:36:09 -0000 1.20 @@ -139,7 +139,7 @@ if (todo != null) { for (Iterator iter = todo.iterator(); iter.hasNext();) { Resolvable res = (Resolvable) iter.next(); - res.resolve(id, pvList); + res.resolveIDRef(id, pvList); } unresolvedIDRefs.remove(id); } @@ -201,7 +201,7 @@ for (Iterator resIter = list.iterator(); resIter.hasNext();) { Resolvable res = (Resolvable)resIter.next(); if (!res.isResolved()) { - res.resolve(id, null); + res.resolveIDRef(id, null); } } } @@ -294,7 +294,7 @@ String[] ids = res.getIDs(); for (int count = 0; count < ids.length; count++) { if (idLocations.containsKey(ids[count])) { - res.resolve(ids[count], (List) idLocations.get(ids[count])); + res.resolveIDRef(ids[count], (List) idLocations.get(ids[count])); } else { addUnresolvedIDRef(ids[count], res); } 1.3 +3 -3 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BookmarkData.java 1 Dec 2004 01:45:21 -0000 1.2 +++ BookmarkData.java 2 Dec 2004 01:36:09 -0000 1.3 @@ -161,13 +161,13 @@ * PageViewport objects * @param pages the list of PageViewport objects the ID resolves to */ - public void resolve(String id, List pages) { + public void resolveIDRef(String id, List pages) { // this method is buggy if (!id.equals(idRef)) { BookmarkData bd = (BookmarkData)idRefs.get(id); idRefs.remove(id); if (bd != null) { - bd.resolve(id, pages); + bd.resolveIDRef(id, pages); if (bd.isResolved()) { checkFinish(); } 1.4 +2 -2 xml-fop/src/java/org/apache/fop/area/LinkResolver.java Index: LinkResolver.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/LinkResolver.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LinkResolver.java 24 Oct 2004 00:03:49 -0000 1.3 +++ LinkResolver.java 2 Dec 2004 01:36:09 -0000 1.4 @@ -61,7 +61,7 @@ /** * Resolve by adding an internal link. */ - public void resolve(String id, List pages) { + public void resolveIDRef(String id, List pages) { resolved = true; if (idRef.equals(id) && pages != null) { PageViewport page = (PageViewport)pages.get(0); 1.7 +4 -8 xml-fop/src/java/org/apache/fop/area/PageViewport.java Index: PageViewport.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/PageViewport.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- PageViewport.java 27 Nov 2004 19:58:34 -0000 1.6 +++ PageViewport.java 2 Dec 2004 01:36:09 -0000 1.7 @@ -160,13 +160,9 @@ } /** - * This resolves reference with a list of pages. - * The pages (PageViewport) contain the rectangle of the area. - * @param id the id to resolve - * @param pages the list of pages with the id area - * may be null if not found + * @see org.apache.fop.area.Resolveable#resolveIDRef(String, List) */ - public void resolve(String id, List pages) { + public void resolveIDRef(String id, List pages) { if (page == null) { if (pendingResolved == null) { pendingResolved = new HashMap(); @@ -178,7 +174,7 @@ if (todo != null) { for (int count = 0; count < todo.size(); count++) { Resolvable res = (Resolvable)todo.get(count); - res.resolve(id, pages); + res.resolveIDRef(id, pages); } } } @@ -337,7 +333,7 @@ for (Iterator iter = pendingResolved.keySet().iterator(); iter.hasNext();) { String id = (String) iter.next(); - resolve(id, (List)pendingResolved.get(id)); + resolveIDRef(id, (List)pendingResolved.get(id)); } pendingResolved = null; } 1.3 +10 -7 xml-fop/src/java/org/apache/fop/area/Resolvable.java Index: Resolvable.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/Resolvable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Resolvable.java 27 Nov 2004 19:58:34 -0000 1.2 +++ Resolvable.java 2 Dec 2004 01:36:09 -0000 1.3 @@ -45,11 +45,14 @@ String[] getIDs(); /** - * This resolves reference with a list of pages. - * The pages (PageViewport) contain the rectangle of the area. - * @param id the id to resolve - * @param pages the list of pages with the id area - * may be null if not found + * This method provides the opportunity for a Resolvable object + * to resolve one of its unresolved idrefs with the actual set of + * PageViewports containing the target ID. + * + * @param id an ID possibly matching one of the Resolvable object's + * unresolved idref's. + * @param pages the list of PageViewports with the given ID + * may be null if ID is not tied to any */ - void resolve(String id, List pages); + void resolveIDRef(String id, List pages); } 1.5 +12 -10 xml-fop/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java Index: UnresolvedPageNumber.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- UnresolvedPageNumber.java 24 Oct 2004 00:03:49 -0000 1.4 +++ UnresolvedPageNumber.java 2 Dec 2004 01:36:09 -0000 1.5 @@ -30,7 +30,7 @@ */ public class UnresolvedPageNumber extends TextArea implements Resolvable { private boolean resolved = false; - private String pageRefId; + private String pageIDRef; /** * Create a new unresolvable page number. @@ -38,7 +38,7 @@ * @param id the id reference for resolving this */ public UnresolvedPageNumber(String id) { - pageRefId = id; + pageIDRef = id; text = "?"; } @@ -48,20 +48,22 @@ * @return the id reference for this unresolved page number */ public String[] getIDs() { - return new String[] {pageRefId}; + return new String[] {pageIDRef}; } /** - * Resolve this page number reference. - * This resolves the reference by getting the page number + * Resolve the page number idref + * This resolves the idref for this object by getting the page number * string from the first page in the list of pages that apply - * for the id reference. The word string is then set to the - * page number string. + * for this ID. The page number text is then set to the String value + * of the page number. * - * @param id the id reference being resolved - * @param pages the list of pages for the id reference + * @param id the id associated with the pages parameter + * @param pages the list of PageViewports associated with this ID + * @todo determine why the ID passed in will (always?) equal the pageIDRef, + * explain in comments above */ - public void resolve(String id, List pages) { + public void resolveIDRef(String id, List pages) { resolved = true; if (pages != null) { PageViewport page = (PageViewport)pages.get(0);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]