gmazza      2004/12/01 17:59:41

  Modified:    src/java/org/apache/fop/area AreaTreeHandler.java
                        LinkResolver.java Resolvable.java
               src/java/org/apache/fop/area/inline
                        UnresolvedPageNumber.java
  Log:
  More commenting, changed definition of isResolved() somewhat in LinkResolver 
and UnresolvedPageNumber.
  
  Revision  Changes    Path
  1.21      +11 -7     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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- AreaTreeHandler.java      2 Dec 2004 01:36:09 -0000       1.20
  +++ AreaTreeHandler.java      2 Dec 2004 01:59:40 -0000       1.21
  @@ -160,7 +160,7 @@
       /**
        * Add an Resolvable object with an unresolved idref
        * @param idref the idref whose target id has not yet been located
  -     * @param res the Resolvable object with the unresolved idref
  +     * @param res the Resolvable object needing the idref to be resolved
        */
       public void addUnresolvedIDRef(String idref, Resolvable res) {
           Set todo = (Set) unresolvedIDRefs.get(idref);
  @@ -193,15 +193,19 @@
        * @throws SAXException if there is some error
        */
       public void endDocument() throws SAXException {
  -        // deal with unresolved references
  +        /* 
  +         * inform Resolveable objects that certain idrefs
  +         * could not be found
  +         * @todo unsure if this block is needed. 
  +         */
           for (Iterator iter = unresolvedIDRefs.keySet().iterator(); 
                   iter.hasNext();) {
  -            String id = (String)iter.next();
  -            Set list = (Set) unresolvedIDRefs.get(id);
  +            String idref = (String) iter.next();
  +            Set list = (Set) unresolvedIDRefs.get(idref);
               for (Iterator resIter = list.iterator(); resIter.hasNext();) {
  -                Resolvable res = (Resolvable)resIter.next();
  +                Resolvable res = (Resolvable) resIter.next();
                   if (!res.isResolved()) {
  -                    res.resolveIDRef(id, null);
  +                    res.resolveIDRef(idref, null);
                   }
               }
           }
  
  
  
  1.5       +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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LinkResolver.java 2 Dec 2004 01:36:09 -0000       1.4
  +++ LinkResolver.java 2 Dec 2004 01:59:40 -0000       1.5
  @@ -62,8 +62,8 @@
        * Resolve by adding an internal link.
        */
       public void resolveIDRef(String id, List pages) {
  -        resolved = true;
           if (idRef.equals(id) && pages != null) {
  +            resolved = true;
               PageViewport page = (PageViewport)pages.get(0);
               area.addTrait(Trait.INTERNAL_LINK, page.getKey());
           }
  
  
  
  1.4       +9 -5      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Resolvable.java   2 Dec 2004 01:36:09 -0000       1.3
  +++ Resolvable.java   2 Dec 2004 01:59:40 -0000       1.4
  @@ -45,11 +45,15 @@
       String[] getIDs();
   
       /**
  -     * 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.
  +     * This method allows the Resolvable object to resolve one of
  +     * its unresolved idrefs with the actual set of PageViewports
  +     * containing the target ID.  The Resolvable object initially
  +     * identifies to the AreaTreeHandler which idrefs it needs
  +     * resolved.  After the idrefs are resolved, the ATH calls this
  +     * method to allow the Resolvable object to update itself with
  +     * the PageViewport information.
        *
  -     * @param id an ID possibly matching one of the Resolvable object's
  +     * @param id an ID 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
  
  
  
  1.6       +1 -4      
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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- UnresolvedPageNumber.java 2 Dec 2004 01:36:09 -0000       1.5
  +++ UnresolvedPageNumber.java 2 Dec 2004 01:59:40 -0000       1.6
  @@ -60,16 +60,13 @@
        *
        * @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 resolveIDRef(String id, List pages) {
  -        resolved = true;
           if (pages != null) {
  +            resolved = true;
               PageViewport page = (PageViewport)pages.get(0);
               String str = page.getPageNumber();
               text = str;
  -
               /[EMAIL PROTECTED] Update IPD ??? */
           }
       }
  
  
  

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

Reply via email to