Examples of JTreeNode


Examples of com.qspin.qtaste.ui.tools.JTreeNode

        TCTreeNode rootNode = (TCTreeNode) tree.getModel().getRoot();
        Enumeration<?> children = rootNode.children();
        while (children.hasMoreElements()) {
            TCTreeNode childNode = (TCTreeNode) children.nextElement();
            JTreeNode childFileNode = (JTreeNode) childNode.getUserObject();
            if (childFileNode.getFile().getPath().equals(pathString)) {
                TreeNode[] nodes = childNode.getPath();
                TreePath treepath = new TreePath(nodes);
                tree.expandPath(treepath);
            }
        }
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

    public void updateChildCells(TreePath treePath, int col) {
      if (tree.getModel() instanceof TestCampaignTreeModel) {
          TestCampaignTreeModel model = (TestCampaignTreeModel) tree.getModel();
          // get the node associated to the treepath
          TCTreeNode node = (TCTreeNode) treePath.getLastPathComponent();
          JTreeNode fNode = null;
          // retrieve userObject only if based on a JTreeNode
          if (node.getUserObject() instanceof FileNode || node.getUserObject() instanceof TestDataNode) {
              fNode = (JTreeNode) node.getUserObject();
          }
          int childCount = node.getChildCount();
          if (fNode != null) {
              childCount = fNode.getChildren().length;
          } // it can be different is user didn't expand the tree view


          String testbedName = model.getColumnName(col);
          if (fNode != null) {
              model.updateChild(fNode, testbedName);
              return;
          } else {
              // update child from root
              for (int i = 0; i < childCount; i++) {
                  TCTreeNode childNode = (TCTreeNode) node.getChildAt(i);
                  JTreeNode childFileNode = (JTreeNode) childNode.getUserObject();
                  // set the value to child from its parent
                  TristateCheckBox.State rootState = model.getNodeState(node.toString(), testbedName);
                  model.setNodeState(childFileNode, testbedName, rootState);
                  model.updateChild(childFileNode, testbedName);
              }
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

    public TCTreeNode getTreeNode(TCTreeNode parentNode, JTreeNode childNode) {
        Enumeration<?> childrenNodeEnum = parentNode.children();
        while (childrenNodeEnum.hasMoreElements()) {
            TCTreeNode childNodeTC = (TCTreeNode) childrenNodeEnum.nextElement();
            JTreeNode childFileNode = (JTreeNode) childNodeTC.getUserObject();
            if (childFileNode.equals(childNode)) {
                return childNodeTC;
            }
        }
        return null;
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

    public void setValueAt(Object aValue, Object node, int column)
    {
        if (column==0) return;
        TCTreeNode tcNode = (TCTreeNode)node;
        if (tcNode.getUserObject() instanceof JTreeNode) {           
            JTreeNode jTreeNode = (JTreeNode)tcNode.getUserObject();           
            this.setNodeState(jTreeNode, getColumnName(column), (TristateCheckBox.State)aValue);
        }
        else {
            this.setNodeState(tcNode.toString(), getColumnName(column), (TristateCheckBox.State)aValue);
           
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

        int childCount = childNode.getChildren().length;
        if (childCount > 0) {
            // get the stored object maintaining the status of all nodes
            // navigate through the children
            for (int i = 0; i < childCount; i++) {
                JTreeNode childFileNode = null;
                childFileNode = (JTreeNode) childNode.getChildren()[i];
                // retrive the status of its parent (from stored object model)
                TristateCheckBox.State parentValue = this.getNodeState(childNode, testbedName);
                if (parentValue!= TristateCheckBox.DONT_CARE) {
                    // update the object model for this child
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

        int countChecked=0, countUnchecked=0;
        int childCount = ((TCTreeNode)this.getRoot()).getChildCount();
        Enumeration<?> enumChildren = ((TCTreeNode)this.getRoot()).children();
        while (enumChildren.hasMoreElements()) {
            TCTreeNode childParentNode = (TCTreeNode)enumChildren.nextElement();
            JTreeNode childParentFileNode = (JTreeNode)childParentNode.getUserObject();
            TristateCheckBox.State childState = getNodeState(childParentFileNode, testbedName);
            if (childState==TristateCheckBox.SELECTED)
                countChecked++;
            if (childState==TristateCheckBox.NOT_SELECTED)
                countUnchecked++;
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

        File parentFile = childFile.getParentFile();
        if (parentFile==null) return;
        int countChecked = 0;
        int countUnchecked = 0;
        int childCount=0;
        JTreeNode parentNode=null;
        if (parentFile.getParentFile()== null)
        {
            this.updateRootNode(testbedName);
            return;
        }
        else {
            parentNode = this.getTestSuite(parentFile.getPath().replace("\\","/"));
            if (parentNode == null)
            {
                File parentParentFile = parentFile.getParentFile();
                while (parentParentFile.getParentFile()!=null) {
                    parentNode = this.getTestSuite(parentParentFile.getPath().replace("\\","/"));                   
                    if (parentNode!=null) {
                        updateParent(parentNode,testbedName);
                        break;
                    }
                    parentParentFile = parentParentFile.getParentFile();
                   
                }
                this.updateRootNode(testbedName);
               
            }
            if (parentNode==null) return;
            childCount = parentNode.getChildren().length;

            Object[] childParentNodes = (Object[])parentNode.getChildren();
            for (int i=0; i < childParentNodes.length; i++) {
                JTreeNode childParentNode = (JTreeNode)childParentNodes[i];
                TristateCheckBox.State testbedState = getNodeState(childParentNode, testbedName);
                if (testbedState == TristateCheckBox.SELECTED) {
                    countChecked++;
                }
                if (testbedState == TristateCheckBox.NOT_SELECTED) {
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

                    return "MetaCampain";
            default:
                //if (file==null) return TristateCheckBox.DONT_CARE;
                TCTreeNode tcNode = (TCTreeNode)node;
                if (tcNode.getUserObject() instanceof JTreeNode) {
                    JTreeNode jTreeNode = (JTreeNode)tcNode.getUserObject();           
                    return this.getNodeState(jTreeNode, getColumnName(column));
                }
                else
                {
                    return this.getNodeState(tcNode.toString(), getColumnName(column));
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

        if (parentDir.equals(directory))
            return parent;
       
        Object[] childNodes = parent.getChildren();
        for (int i=0; i < childNodes.length; i++) {
            JTreeNode child = (JTreeNode)childNodes[i];
            String childDir = child.getId();
            if (childDir.equals(directory))
                return child;
            if (child.getChildren().length>0) {
                JTreeNode returnValue = getTestSuite(child, directory);
                if (returnValue!=null) return returnValue;
            }
        }
        return null;
       
View Full Code Here

Examples of com.qspin.qtaste.ui.tools.JTreeNode

    public JTreeNode getTestSuite(String directory) {
        TCTreeNode rootNode = (TCTreeNode)this.getRoot();
        Enumeration<?> childNodes = rootNode.children();
        while (childNodes.hasMoreElements()){
            TCTreeNode childNode = (TCTreeNode)childNodes.nextElement();
            JTreeNode child = (JTreeNode)childNode.getUserObject();
            if (child.getId().equals(directory)) {
                return child;
            }
            JTreeNode chidChild = getTestSuite(child, directory);
            if (chidChild!=null) return chidChild;
            if (!child.getFile().getParent().equals("TestSuites")) {
                //getTestSuite
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.