Package pivot.collections.Sequence.Tree

Examples of pivot.collections.Sequence.Tree.Path


                // Only branch nodes can be affected by this event
                if (nodeInfo instanceof BranchInfo) {
                    BranchInfo branchInfo = (BranchInfo)nodeInfo;

                    // Update the cached entry for this branch
                    Path path = branchInfo.getPath();
                    branchInfo.setCheckState(treeView.getNodeCheckState(path));

                    // Add the branch's children to the queue
                    if (branchInfo.children != null) {
                        for (int i = 0, n = branchInfo.children.getLength(); i < n; i++) {
View Full Code Here


        List<TreeNode> parentData;

        if (n == 1) {
            parentData = (List<TreeNode>)treeData;
        } else {
            Path parentPath = new Path(path, 0, n - 1);
            parentData = (List<TreeNode>)Sequence.Tree.get(treeData, parentPath);
        }

        // Notifying the parent will close the popup
        if (parentData.getComparator() == null) {
            parentData.update(path.get(n - 1), treeNode);
        } else {
            // Save local reference to members variables before they get cleared
            TreeView treeView = this.treeView;
            Path path = this.path;

            parentData.remove(path.get(n - 1), 1);
            parentData.add(treeNode);

            // Re-select the node, and make sure it's visible
            Path newPath = new Path(path, 0, n - 1);
            newPath.add(parentData.indexOf(treeNode));
            treeView.setSelectedPath(newPath);
            treeView.scrollAreaToVisible(treeView.getNodeBounds(newPath));
        }
    }
View Full Code Here

            return nodeInfo;
        }

        @SuppressWarnings("unchecked")
        public Path getPath() {
            Path path = new Path(depth);

            NodeInfo nodeInfo = this;

            while (nodeInfo.parent != null) {
                List<Object> parentData = (List<Object>)nodeInfo.parent.data;
                int index = parentData.indexOf(nodeInfo.data);
                path.insert(index, 0);

                nodeInfo = nodeInfo.parent;
            }

            return path;
View Full Code Here

TOP

Related Classes of pivot.collections.Sequence.Tree.Path

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.