Examples of pathByAddingChild()


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

        int count = dataModel.getChildCount(parentNode);
        int index = dataModel.getIndexOfChild(parentNode, dataNode);
        if (count > index + 1) // tiene nodo siguiente
        {
            Object nextNode = dataModel.getChild(parentNode, index + 1);
            return parentPath.pathByAddingChild(nextNode);
        }
        else
        {
            // Es el �ltimo
            return null;
View Full Code Here

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

            (DefaultMutableTreeNode)
            (getJTree().getLastSelectedPathComponent());
        if(!node.isLeaf())
        {
          node = (DefaultMutableTreeNode)node.getChildAt(i);
          getJTree().setSelectionPath(path.pathByAddingChild(node));
        }
      }
      else
      {
        getTrainToolTip().setVisible(false);
View Full Code Here

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

    TreeNode aliveAncestor = (TreeNode) mySelectionPath.getPathComponent(aliveIndex);
    TreePath newSelection = TreeUtil.getPathFromRoot(aliveAncestor);
    int childrenLeft = aliveAncestor.getChildCount();
    if (childrenLeft != 0) {
      int newSelectedChildIndex = Math.min(myIndicies[aliveIndex + 1], childrenLeft - 1);
      newSelection = newSelection.pathByAddingChild(aliveAncestor.getChildAt(newSelectedChildIndex));
    }
    return newSelection;
  }

  public void restoreSelection(JTree tree) {
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()

   */
  public Object getUniqueKey(Object objTarget, Object objParentUniqueKey) {
    TreePath objPath = (TreePath)objParentUniqueKey;
    Object objTargetUID = null;
    if(objPath != null){
      objTargetUID = objPath.pathByAddingChild(objTarget);
    }else{
      objTargetUID = new TreePath(objTarget);
    }
    return objTargetUID;
  }
View Full Code Here

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

            }
            BrowserTreeNode lastNode = (BrowserTreeNode)path.getLastPathComponent();
            if (childIndex >= lastNode.getChildCount()) {
                break;
            }
            path = path.pathByAddingChild(lastNode.getChildAt(childIndex));
        }

        JTree tree = treePane.getTree();
        tree.expandPath(path);
        tree.setSelectionPath(path);
View Full Code Here

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

    private static TreePath linkPath(BrowserServices services, int constantPoolIndex) {
       
        TreePath constantPoolPath = services.getBrowserComponent().getTreePane().getPathForCategory(BrowserTreeNode.NODE_CONSTANT_POOL);
        BrowserTreeNode constantPoolNode = (BrowserTreeNode)constantPoolPath.getLastPathComponent();
        TreeNode targetNode = constantPoolNode.getChildAt(constantPoolIndex - 1);
        return constantPoolPath.pathByAddingChild(targetNode);
    }
   
}
View Full Code Here

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

        for (int i = 0; i < childCount; i++) {
            Object childNode = model.getChild(parentNode, i);
            if (childNode == node) {
                continue;
            }
            if (!isPathSelected(parent.pathByAddingChild(childNode))) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

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

      if(currentPath == null)
         currentPath = new TreePath(node);
        
      //System.out.println("Current path:" + currentPath);
      //System.out.println("Added Node:" + addedNode);
      nodeTree.setSelectionPath(currentPath.pathByAddingChild(addedNode));
    }
    else if(changeTypeId.intValue() == NODE_MOVED)
    {
      CMSNode currentParent = (CMSNode)((CMSNode)nodeTree.getLastSelectedPathComponent()).getParent();     
      //System.out.println("node:" + node.getName());
View Full Code Here

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

        } else {
            parentExp.getChildren().moveDown(index);
        }
        tree.setModel(new TreeExpressionModel(me));

        path = parentPath.pathByAddingChild(child);
        tree.expandPath(path);
        tree.setSelectionPath(path);
        updateStatusPanel();
    }
   
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.