Class GUIRunner.TreePathIterator

  • Enclosing class:
    GUIRunner

    static class GUIRunner.TreePathIterator
    extends java.lang.Object
    Represents a path currPath in the tree of testsuites represented by treeModel. This is initialized by setFirstPath() to the uppermost complete path, can be incremented via incPath() and be returned by getPath().
    • 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()
      Increments currPath 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()
      Initializes currPath with the first path in treeModel. **** Shall be invoked by TreePathUpdater only ****
      private int shortenPath()
      Replaces currPath 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • TreePathIterator

        TreePathIterator​(javax.swing.JTree tree,
                         int index)
    • Method Detail

      • updatePathI

        void updatePathI()
      • setFirstPath

        void setFirstPath()
        Initializes currPath with the first path in treeModel. **** Shall be invoked by TreePathUpdater only ****
      • 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()
        Replaces currPath 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 - if currPath cannot be incremented.
      • incPath

        javax.swing.tree.TreePath incPath()
        Increments currPath and returns the result.
      • getPath

        javax.swing.tree.TreePath getPath()