hillion     01/10/15 04:32:56

  Modified:    sources/org/apache/batik/apps/svgbrowser
                        JSVGViewerFrame.java
               sources/org/apache/batik/dom/traversal DOMTreeWalker.java
  Log:
  Fixed a problem with the TreeWalker implementation.
  
  Revision  Changes    Path
  1.59      +2 -2      
xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
  
  Index: JSVGViewerFrame.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- JSVGViewerFrame.java      2001/10/15 11:10:54     1.58
  +++ JSVGViewerFrame.java      2001/10/15 11:32:56     1.59
  @@ -157,7 +157,7 @@
    * This class represents a SVG viewer swing frame.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephane Hillion</a>
  - * @version $Id: JSVGViewerFrame.java,v 1.58 2001/10/15 11:10:54 tkormann Exp $
  + * @version $Id: JSVGViewerFrame.java,v 1.59 2001/10/15 11:32:56 hillion Exp $
    */
   public class JSVGViewerFrame
       extends    JFrame
  @@ -1198,7 +1198,7 @@
                   TreeWalker tw;
                   tw = ((DocumentTraversal)doc).createTreeWalker
                       (doc,
  -                     NodeFilter.SHOW_ALL,
  +                     NodeFilter.SHOW_PROCESSING_INSTRUCTION,
                        null,
                        true);
   
  
  
  
  1.2       +14 -14    
xml-batik/sources/org/apache/batik/dom/traversal/DOMTreeWalker.java
  
  Index: DOMTreeWalker.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/dom/traversal/DOMTreeWalker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMTreeWalker.java        2000/11/22 16:27:02     1.1
  +++ DOMTreeWalker.java        2001/10/15 11:32:56     1.2
  @@ -20,7 +20,7 @@
    * interface.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephane Hillion</a>
  - * @version $Id: DOMTreeWalker.java,v 1.1 2000/11/22 16:27:02 hillion Exp $
  + * @version $Id: DOMTreeWalker.java,v 1.2 2001/10/15 11:32:56 hillion Exp $
    */
   public class DOMTreeWalker implements TreeWalker {
   
  @@ -151,7 +151,7 @@
        * <b>DOM</b>: Implements {@link TreeWalker#previousSibling()}.
        */
       public Node previousSibling() {
  -        Node result = previousSibling(currentNode);
  +        Node result = previousSibling(currentNode, root);
           if (result != null) {
               currentNode = result;
           }
  @@ -162,7 +162,7 @@
        * <b>DOM</b>: Implements {@link TreeWalker#nextSibling()}.
        */
       public Node nextSibling() {
  -        Node result = nextSibling(currentNode);
  +        Node result = nextSibling(currentNode, root);
           if (result != null) {
               currentNode = result;
           }
  @@ -173,7 +173,7 @@
        * <b>DOM</b>: Implements {@link TreeWalker#previousNode()}.
        */
       public Node previousNode() {
  -        Node result = previousSibling(currentNode);
  +        Node result = previousSibling(currentNode, root);
           if (result == null) {
               result = parentNode(currentNode);
               if (result != null) {
  @@ -198,7 +198,7 @@
           if ((result = firstChild(currentNode)) != null) {
               return currentNode = result;
           }
  -        if ((result = nextSibling(currentNode)) != null) {
  +        if ((result = nextSibling(currentNode, root)) != null) {
               return currentNode = result;
           }
           Node parent = currentNode;
  @@ -207,7 +207,7 @@
               if (parent == null) {
                   return null;
               }
  -            if ((result = nextSibling(parent)) != null) {
  +            if ((result = nextSibling(parent, root)) != null) {
                   return currentNode = result;
               }
           }
  @@ -257,7 +257,7 @@
               }
               // Fall through
           default: // NodeFilter.FILTER_REJECT
  -            return nextSibling(result);
  +            return nextSibling(result, n);
           }
       }
   
  @@ -283,14 +283,14 @@
               }
               // Fall through
           default: // NodeFilter.FILTER_REJECT
  -            return previousSibling(result);
  +            return previousSibling(result, n);
           }
       }
   
       /**
        * Returns the previous sibling of the given node.
        */
  -    protected Node previousSibling(Node n) {
  +    protected Node previousSibling(Node n, Node root) {
           if (n == root) {
               return null;
           }
  @@ -301,7 +301,7 @@
                   return null;
               }
               if (acceptNode(result) == NodeFilter.FILTER_SKIP) {
  -                return previousSibling(result);
  +                return previousSibling(result, root);
               }
               return null;
           }
  @@ -315,14 +315,14 @@
               }
               // Fall through
           default: // NodeFilter.FILTER_REJECT
  -            return previousSibling(result);
  +            return previousSibling(result, root);
           }
       }
   
       /**
        * Returns the next sibling of the given node.
        */
  -    protected Node nextSibling(Node n) {
  +    protected Node nextSibling(Node n, Node root) {
           if (n == root) {
               return null;
           }
  @@ -333,7 +333,7 @@
                   return null;
               }
               if (acceptNode(result) == NodeFilter.FILTER_SKIP) {
  -                return nextSibling(result);
  +                return nextSibling(result, root);
               }
               return null;
           }
  @@ -347,7 +347,7 @@
               }
               // Fall through
           default: // NodeFilter.FILTER_REJECT
  -            return nextSibling(result);
  +            return nextSibling(result, root);
           }
       }
   
  
  
  

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

Reply via email to