Package 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
Fields Modifier and Type Field Description protected GraphicsNode
currentNode
The current GraphicsNode.protected GraphicsNode
gvtRoot
The GVT root into which text is searched.protected GraphicsNode
treeRoot
The root of the subtree of the GVT which is traversed.
-
Constructor Summary
Constructors Constructor Description GVTTreeWalker(GraphicsNode treeRoot)
Constructs a newGVTTreeWalker
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphicsNode
firstChild()
Returns the first child of the currentGraphicsNode
.GraphicsNode
getCurrentGraphicsNode()
Returns the currentGraphicsNode
.protected static GraphicsNode
getFirstChild(GraphicsNode node)
GraphicsNode
getGVTRoot()
Returns the GVT root graphics node.protected static GraphicsNode
getLastChild(GraphicsNode node)
protected GraphicsNode
getNextGraphicsNode(GraphicsNode node)
GraphicsNode
getNextSibling()
Returns the next sibling of the currentGraphicsNode
.protected static GraphicsNode
getNextSibling(GraphicsNode node)
protected GraphicsNode
getPreviousGraphicsNode(GraphicsNode node)
GraphicsNode
getPreviousSibling()
Returns the next previous of the currentGraphicsNode
.protected static GraphicsNode
getPreviousSibling(GraphicsNode node)
GraphicsNode
getRoot()
Returns the root graphics node.GraphicsNode
lastChild()
Returns the last child of the currentGraphicsNode
.GraphicsNode
nextGraphicsNode()
Returns the nextGraphicsNode
.GraphicsNode
parentGraphicsNode()
Returns the parent of the currentGraphicsNode
.GraphicsNode
previousGraphicsNode()
Returns the previousGraphicsNode
.void
setCurrentGraphicsNode(GraphicsNode node)
Sets the current GraphicsNode to the specified node.
-
-
-
Field Detail
-
gvtRoot
protected GraphicsNode gvtRoot
The GVT root into which text is searched.
-
treeRoot
protected GraphicsNode treeRoot
The root of the subtree of the GVT which is traversed.
-
currentNode
protected GraphicsNode currentNode
The current GraphicsNode.
-
-
Constructor Detail
-
GVTTreeWalker
public GVTTreeWalker(GraphicsNode treeRoot)
Constructs a newGVTTreeWalker
.- Parameters:
treeRoot
- the top of the graphics node tree to search
-
-
Method Detail
-
getRoot
public GraphicsNode getRoot()
Returns the root graphics node.
-
getGVTRoot
public GraphicsNode getGVTRoot()
Returns the GVT 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 currentGraphicsNode
.
-
previousGraphicsNode
public GraphicsNode previousGraphicsNode()
Returns the previousGraphicsNode
. If the current graphics node does not have a previous node, returns null and retains the current node.
-
nextGraphicsNode
public GraphicsNode nextGraphicsNode()
Returns the nextGraphicsNode
. 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 currentGraphicsNode
. 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 currentGraphicsNode
. 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 currentGraphicsNode
. 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 currentGraphicsNode
. 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 currentGraphicsNode
. If the current graphics node does not have a last child, returns null and retains the current node.
-
getNextGraphicsNode
protected GraphicsNode getNextGraphicsNode(GraphicsNode node)
-
getPreviousGraphicsNode
protected GraphicsNode getPreviousGraphicsNode(GraphicsNode node)
-
getLastChild
protected static GraphicsNode getLastChild(GraphicsNode node)
-
getPreviousSibling
protected static GraphicsNode getPreviousSibling(GraphicsNode node)
-
getFirstChild
protected static GraphicsNode getFirstChild(GraphicsNode node)
-
getNextSibling
protected static GraphicsNode getNextSibling(GraphicsNode node)
-
-