## org.apache.batik.gvt
Class GVTTreeWalker

    java.lang.Object
      org.apache.batik.gvt.GVTTreeWalker

public class GVTTreeWalker
extends java.lang.Object

`GVTTreeWalker` objects are used to navigate a GVT tree or subtree.

Field Summary
`protected GraphicsNode` `currentNode` The current GraphicsNode.
`protected GraphicsNode` `gvtRoot` The GVT root into which text is searched.

Constructor Summary
`GVTTreeWalker(GraphicsNode gvtRoot)` Constructs a new `GVTTreeWalker`.

Method Summary
`GraphicsNode` `firstChild()` Returns the first child of the current `GraphicsNode`.
`GraphicsNode` `getCurrentGraphicsNode()` Returns the current `GraphicsNode`.
`GraphicsNode` `getNextSibling()` Returns the next sibling of the current `GraphicsNode`.
`GraphicsNode` `getPreviousSibling()` Returns the next previous of the current `GraphicsNode`.
`GraphicsNode` `getRoot()` Returns the root graphics node.
`GraphicsNode` `lastChild()` Returns the last child of the current `GraphicsNode`.
`GraphicsNode` `nextGraphicsNode()` Returns the next `GraphicsNode`.
`GraphicsNode` `parentGraphicsNode()` Returns the parent of the current `GraphicsNode`.
`GraphicsNode` `previousGraphicsNode()` Returns the previous `GraphicsNode`.
`void` `setCurrentGraphicsNode(GraphicsNode node)` Sets the current GraphicsNode to the specified node.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### gvtRoot

    protected GraphicsNode gvtRoot

  The GVT root into which text is searched.

### currentNode

    protected GraphicsNode currentNode

  The current GraphicsNode.

Constructor Detail

### GVTTreeWalker

    public GVTTreeWalker(GraphicsNode gvtRoot)

  Constructs a new `GVTTreeWalker`.

Parameters:
  `gvtRoot` - the graphics node root

Method Detail

### getRoot

    public GraphicsNode getRoot()

  Returns the root graphics node.

### setCurrentGraphicsNode

    public void setCurrentGraphicsNode(GraphicsNode node)

  Sets the current GraphicsNode to the specified node.

  Parameters:
    `node` - the new current graphics node
  Throws:
    `java.lang.IllegalArgumentException` - if the node is not part of the GVT Tree this walker is dedicated to

### getCurrentGraphicsNode

    public GraphicsNode getCurrentGraphicsNode()

  Returns the current `GraphicsNode`.

### previousGraphicsNode

    public GraphicsNode previousGraphicsNode()

  Returns the previous `GraphicsNode`. If the current graphics node does not have a previous node, returns null and retains the current node.

### nextGraphicsNode

    public GraphicsNode nextGraphicsNode()

  Returns the next `GraphicsNode`. If the current graphics node does not have a next node, returns null and retains the current node.

### parentGraphicsNode

    public GraphicsNode parentGraphicsNode()

  Returns the parent of the current `GraphicsNode`. If the current graphics node has no parent, returns null and retains the current node.

### getNextSibling

    public GraphicsNode getNextSibling()

  Returns the next sibling of the current `GraphicsNode`. If the current graphics node does not have a next sibling, returns null and retains the current node.

### getPreviousSibling

    public GraphicsNode getPreviousSibling()

  Returns the next previous of the current `GraphicsNode`. If the current graphics node does not have a previous sibling, returns null and retains the current node.

### firstChild

    public GraphicsNode firstChild()

  Returns the first child of the current `GraphicsNode`. If the current graphics node does not have a first child, returns null and retains the current node.

### lastChild

    public GraphicsNode lastChild()

  Returns the last child of the current `GraphicsNode`. If the current graphics node does not have a last child, returns null and retains the current node.

Copyright © 2004 Apache Software Foundation. All Rights Reserved.