Package eu.simuline.testhelpers
Class GUIRunner.TreePathIterator
- java.lang.Object
-
- eu.simuline.testhelpers.GUIRunner.TreePathIterator
-
- Enclosing class:
- GUIRunner
static class GUIRunner.TreePathIterator extends java.lang.Object
Represents a pathcurrPath
in the tree of testsuites represented bytreeModel
. This is initialized bysetFirstPath()
to the uppermost complete path, can be incremented viaincPath()
and be returned bygetPath()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
GUIRunner.TreePathIterator.TreePathUpdater
Expands the tree along the current path, forGUIRunner.TreePathIterator.TreePathUpdater.Generic
after incrementing the current path.
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.tree.TreePath
currPath
private javax.swing.tree.TreeModel
treeModel
A model of the tree of testsuites and tests.private GUIRunner.TreePathIterator.TreePathUpdater
treePathUpdater
Decides how to update the current path: For the first path, just inkoke ***** .
-
Constructor Summary
Constructors Constructor Description TreePathIterator(javax.swing.JTree tree, int index)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) javax.swing.tree.TreePath
getPath()
(package private) javax.swing.tree.TreePath
incPath()
IncrementscurrPath
and returns the result.(package private) static javax.swing.tree.TreePath
prolonguePath(javax.swing.tree.TreePath path)
Prolongues path as long as possible in each step with 0th child.(package private) void
setFirstPath()
private int
shortenPath()
ReplacescurrPath
removing the last node as long as the last node in the path is the last child of the last but one node and after having done this returns the index of the last node as a child of the last but one node.(package private) void
updatePathI()
-
-
-
Field Detail
-
treeModel
private final javax.swing.tree.TreeModel treeModel
A model of the tree of testsuites and tests.
-
currPath
private javax.swing.tree.TreePath currPath
-
treePathUpdater
private GUIRunner.TreePathIterator.TreePathUpdater treePathUpdater
Decides how to update the current path: For the first path, just inkoke ***** .
-
-
Method Detail
-
updatePathI
void updatePathI()
-
setFirstPath
void setFirstPath()
-
prolonguePath
static javax.swing.tree.TreePath prolonguePath(javax.swing.tree.TreePath path)
Prolongues path as long as possible in each step with 0th child.
-
shortenPath
private int shortenPath()
ReplacescurrPath
removing the last node as long as the last node in the path is the last child of the last but one node and after having done this returns the index of the last node as a child of the last but one node.CAUTION: This method shall be invoked only if
currPath
can be incremented.- Throws:
java.lang.NullPointerException
- ifcurrPath
cannot be incremented.
-
incPath
javax.swing.tree.TreePath incPath()
IncrementscurrPath
and returns the result.
-
getPath
javax.swing.tree.TreePath getPath()
-
-