Package javax.swing.tree

Examples of javax.swing.tree.TreeNode


  }

  @RunsInEDT
  private void selectBranch1AndBranch1_1() {
    DefaultMutableTreeNode root = rootOf(tree);
    TreeNode branch1 = firstChildOf(root);
    TreePath root_branch1 = new TreePath(array(root, branch1));
    TreePath root_branch1_Branch1_1 = new TreePath(array(root, branch1, firstChildOf(branch1)));
    select(root_branch1, root_branch1_Branch1_1);
  }
View Full Code Here


        TreePath path = treeTableArticles.getPathForRow(treeTableArticles
                .getSelectedRow());
        buttonSelect.setEnabled(false);

        if (path != null) {
            TreeNode selectedNode = (ArticleTypeTreeNode) path
                    .getLastPathComponent();
            if (selectedNode.isLeaf()) {
                buttonSelect.setEnabled(true);
            }
        }

        path = treeTableChosen.getPathForRow(treeTableChosen.getSelectedRow());
        buttonDeselect.setEnabled(false);

        if (path != null) {
            TreeNode selectedNode = (OrderLineTreeNode) path
                    .getLastPathComponent();
            if (selectedNode.isLeaf()) {
                buttonDeselect.setEnabled(true);
            }
        }
    }
View Full Code Here

        public boolean dragging;

        public void mousePressed(MouseEvent e) {
            GElement elem = treeGraphView.getElementAtMousePosition(e);
            if(elem != null && elem instanceof AWTreeGraphView.GElementNode) {
                TreeNode node = treeGraphView.getTreeNodeForElement((AWTreeGraphView.GElementNode)elem);
                if(node == null)
                    return;

                boolean shiftKey = (e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) == MouseEvent.SHIFT_DOWN_MASK;
                if(delegate != null)
View Full Code Here

        if(nodeElement == null)
            nodeElement = createGElement(node);

        /** Add all the children of the node */
        for(int index=0; index<node.getChildCount(); index++) {
            TreeNode child = node.getChildAt(index);

            /** Then add it to the parent node */
            addChildElement(nodeElement, createGElement(child));

            /** Recursively build the children of the child */
 
View Full Code Here

     *
     * Note: actually it is slower because of the adjustElement...() method which is called too often
     */
    public void rebuildWithModel() {
        for(int n=0; n<model.getNewNodesCount(); n++) {
            TreeNode parent = model.getNewNodeParentAtIndex(n);
            TreeNode child = model.getNewNodeAtIndex(n);

            GElementNode parentElement = getGElementForNode(parent);
            if(parentElement == null) {
                parentElement = createGElement(root);
                parentElement.move(MARGIN, MARGIN);
View Full Code Here

    public CodeCompletionFilterTree(CodeCompletionFilterTreeModel model) {
        super(new CodeCompletionFilterTreeCellRenderer(), null);
        setModel(model);
        setRootVisible(true);
        TreeNode expandedTreeNode = (TreeNode) getModel().getChild(getModel().getRoot(), 5);
        setExpandedState(TreeUtil.createTreePath(expandedTreeNode), true);
        installSpeedSearch();
        setTransferHandler(new DBNTreeTransferHandler());
    }
View Full Code Here

    private static final Logger LOGGER = LoggerFactory.createLogger();

    public static TreePath createTreePath(TreeNode treeNode) {
        List<TreeNode> list =  new ArrayList<TreeNode>();
        list.add(treeNode);
        TreeNode parent = treeNode.getParent();
        while (parent != null) {
            list.add(0, parent);
            parent = parent.getParent();
        }
        return new TreePath(list.toArray());
    }
View Full Code Here

        return root;
    }

    @Override
    public Object getChild(Object parent, int index) {
        TreeNode treeNode = (TreeNode) parent;
        return treeNode.getChildAt(index);
    }
View Full Code Here

        return treeNode.getChildAt(index);
    }

    @Override
    public int getChildCount(Object parent) {
        TreeNode treeNode = (TreeNode) parent;
        return treeNode.getChildCount();
    }
View Full Code Here

        return treeNode.getChildCount();
    }

    @Override
    public boolean isLeaf(Object node) {
        TreeNode treeNode = (TreeNode) node;
        return treeNode.isLeaf();
    }
View Full Code Here

TOP

Related Classes of javax.swing.tree.TreeNode

Copyright © 2018 www.massapicom. 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.