Examples of pathByAddingChild()


Examples of javax.swing.tree.TreePath.pathByAddingChild()

     
      TaskTreeModel taskTreeModel= (TaskTreeModel) this.jTree.getModel();
      taskTreeModel.addNode( this.jTree.getSelectionPath(), newNode );

      //---make sure it is visible
      this.jTree.scrollPathToVisible( treePath.pathByAddingChild( newNode ) );
    }
  }


  /**********************************************************************************
 
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

                node = node.child(s);
                if (node == null) {
                    System.out.println("Did not find child: " + s);
                    return null;
                }
                tp = tp.pathByAddingChild(node);
            }
        }
        return tp;
    }
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

            Element rootElement) {
        TreePath path = new TreePath(root);
        Element child = rootElement.getElement(rootElement.getElementIndex(
                position));

        path = path.pathByAddingChild(rootElement);
        path = path.pathByAddingChild(child);
        while (!child.isLeaf()) {
            child = child.getElement(child.getElementIndex(position));
            path = path.pathByAddingChild(child);
        }
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

        TreePath path = new TreePath(root);
        Element child = rootElement.getElement(rootElement.getElementIndex(
                position));

        path = path.pathByAddingChild(rootElement);
        path = path.pathByAddingChild(child);
        while (!child.isLeaf()) {
            child = child.getElement(child.getElementIndex(position));
            path = path.pathByAddingChild(child);
        }
        return path;
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

        path = path.pathByAddingChild(rootElement);
        path = path.pathByAddingChild(child);
        while (!child.isLeaf()) {
            child = child.getElement(child.getElementIndex(position));
            path = path.pathByAddingChild(child);
        }
        return path;
    }

View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

    List<TreePath> subPaths = new ArrayList<TreePath>();
    for (int i = 0, max = model.getChildCount(node); i < max; i++) {
      Object child = model.getChild(node, i);
      String text = getShownText(child);
      if (text.indexOf(childSubstring) >= 0) {
        subPaths.add(jTreePath.pathByAddingChild(child));
      }
    }
    if (subPaths.isEmpty()) {
      AssertAdapter.fail("No children found");
    }
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

  }

  private TreePath computeChildTreePath(String parentPath, int childIndex) {
    TreePath jTreePath = getTreePath(parentPath);
    Object child = jTree.getModel().getChild(jTreePath.getLastPathComponent(), childIndex);
    return jTreePath.pathByAddingChild(child);
  }

  private void doubleClickOnTreePath(String path) {
    Rectangle rect = setVisible(getTreePath(path));
    if (rect != null) {
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

    TreePath path = (TreePath)((Object[])obj)[1];
                currentPath = path;
    Object[] result = new Object[2];
                Object[] children = getChildren(path.getLastPathComponent());
                for(int j = 0; j < children.length; j++) {
                    result[0] = path.pathByAddingChild(children[j]);
        if(chsr.checkPath((TreePath)result[0], j)) {
      result[1] = Boolean.TRUE;
      return(result);
        }
        if(chsr.hasAsParent((TreePath)result[0], j)) {
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

            int count = model.getChildCount(node);
            if (count == 0) {
                break;
            }
            node = model.getChild(node, count - 1);
            path = path.pathByAddingChild(node);
        }
        tree.scrollPathToVisible(path);
    }

}
View Full Code Here

Examples of javax.swing.tree.TreePath.pathByAddingChild()

        Object parentNode = parentPath.getLastPathComponent();
        int index = dataModel.getIndexOfChild(parentNode, dataNode);
        if (index > 0) // tiene nodo previo
        {
            Object prevNode = dataModel.getChild(parentNode, index - 1);
            return parentPath.pathByAddingChild(prevNode);
        }
        else
        {
            // Es el primero
            return null;
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.