]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
More commenting, slightly clearer method names.
authorGlen Mazza <gmazza@apache.org>
Thu, 2 Dec 2004 01:36:09 +0000 (01:36 +0000)
committerGlen Mazza <gmazza@apache.org>
Thu, 2 Dec 2004 01:36:09 +0000 (01:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198182 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/AreaTreeHandler.java
src/java/org/apache/fop/area/BookmarkData.java
src/java/org/apache/fop/area/LinkResolver.java
src/java/org/apache/fop/area/PageViewport.java
src/java/org/apache/fop/area/Resolvable.java
src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java

index aef0179a33dd400833da82436c326d2dc9c204c0..5cbeeca0f08f551fe4508a6340e15712b86aa678 100644 (file)
@@ -139,7 +139,7 @@ public class AreaTreeHandler extends FOEventHandler {
             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 @@ public class AreaTreeHandler extends FOEventHandler {
             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 @@ public class AreaTreeHandler extends FOEventHandler {
             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);
                 }
index 1f301e4006a0f3584f4a6d95eaf96a561a103c46..d0a49832723e944eb5be09eb3209d072d2eabdd8 100644 (file)
@@ -161,13 +161,13 @@ public class BookmarkData extends OffDocumentItem implements Resolvable {
      *      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();
                 }
index 05e9388f2a2fd6f8f44047d1d77c7d39253bff7a..5da015d8918c92efc9cd55e01134d3ad0ef3486a 100644 (file)
@@ -61,7 +61,7 @@ public class LinkResolver implements Resolvable, Serializable {
     /**
      * 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);
index a0bbe6a5878852fd2fafe4d1e757746c6b97c564..a0c87a5c0e085e107f58c67b9ab43eaf7c2d1149 100644 (file)
@@ -160,13 +160,9 @@ public class PageViewport implements Resolvable, Cloneable {
     }
 
     /**
-     * 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 @@ public class PageViewport implements Resolvable, Cloneable {
                 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 @@ public class PageViewport implements Resolvable, Cloneable {
             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;
         }
index 61de613a084961c0ff5912ec0e8d17d353994ed8..def072885ea64101aaf991fe18a3a189c5b48975 100644 (file)
@@ -45,11 +45,14 @@ public interface Resolvable {
     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);
 }
index 3b56ae281b4f7cd26881899a3ccc5aabcf4ca26f..05bf28c7e888020daaaa06d7de04a86586631e34 100644 (file)
@@ -30,7 +30,7 @@ import java.util.List;
  */
 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 @@ public class UnresolvedPageNumber extends TextArea implements Resolvable {
      * @param id the id reference for resolving this
      */
     public UnresolvedPageNumber(String id) {
-        pageRefId = id;
+        pageIDRef = id;
         text = "?";
     }
 
@@ -48,20 +48,22 @@ public class UnresolvedPageNumber extends TextArea implements Resolvable {
      * @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);