Examples of ATreeNode


Examples of fr.soleil.salsa.client.view.tool.ATreeNode

     * @param rootDirectoryTreeNode
     *            the root directory of the tree structure.
     */
    public void setTreeContent(DirectoryTreeNode rootDirectoryTreeNode) {
        innerSelection = true;
        ATreeNode selectedNode = this.getSelection();

        int nbRows = configTree.getRowCount();
        Set<ATreeNode> expandedNodesSet = new HashSet<ATreeNode>();
        TreePath treePath;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            if (configTree.isExpanded(rowIndex)) {
                treePath = configTree.getPathForRow(rowIndex);
                Object[] pathElementsArray = treePath.getPath();
                List<ATreeNode> pathElementsList = new ArrayList<ATreeNode>(pathElementsArray.length);
                for (Object element : pathElementsArray) {
                    pathElementsList.add((ATreeNode) ((DefaultMutableTreeNode) element).getUserObject());
                }
                expandedNodesSet.addAll(pathElementsList);
            }
        }

        DefaultMutableTreeNode rootNode = buildJTreeNodeFromWrapper(rootDirectoryTreeNode);

        treeModel = new DefaultTreeModel(rootNode);
        configTree.setModel(treeModel);

        nbRows = configTree.getRowCount();
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            ATreeNode treeNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent()).getUserObject();
            if (expandedNodesSet.contains(treeNode)) {
                configTree.expandRow(rowIndex);
                nbRows = configTree.getRowCount();
            }
        }

        ATreeNode treeNode;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            treeNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent()).getUserObject();
            if (treeNode.equals(selectedNode)) {
                configTree.addSelectionRow(rowIndex);
            }
        }
        innerSelection = false;
    }
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

        boolean select;
        IConfig<?> config1;
        IConfig<?> config2;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            ATreeNode searchNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent())
                    .getUserObject();
            select = treeNode.equals(searchNode);
            if (!select) {
                if (treeNode instanceof ConfigTreeNode && searchNode instanceof ConfigTreeNode) {
                    config1 = ((ConfigTreeNode) treeNode).getConfig();
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

     */
    public void setSelectedConfig(String path) {
        if (path != null) {
            int nbRows = configTree.getRowCount();
            TreePath treePath = null;
            ATreeNode treeNode = null;
            boolean readyToSelect = false;
            for (int rowIndex = 0; (rowIndex < nbRows) && (!readyToSelect); ++rowIndex) {
                treePath = configTree.getPathForRow(rowIndex);
                treeNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent()).getUserObject();
                if (treeNode instanceof ConfigTreeNode) {
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

        boolean select;
        IConfig<?> config1;
        IConfig<?> config2;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            ATreeNode searchNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent())
                    .getUserObject();
            select = treeNode.equals(searchNode);
            if (!select) {
                if (treeNode instanceof ConfigTreeNode && searchNode instanceof ConfigTreeNode) {
                    config1 = ((ConfigTreeNode) treeNode).getConfig();
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

        boolean select;
        IConfig<?> config1;
        IConfig<?> config2;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            ATreeNode searchNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent())
                    .getUserObject();
            select = false;
            for (ATreeNode treeNode : multipleSelection) {
                select = treeNode.equals(searchNode);
                if (!select) {
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

     */
    public List<ATreeNode> getMultipleSelection() {
        List<ATreeNode> multipleSelection = new ArrayList<ATreeNode>();
        int nbRows = configTree.getRowCount();
        TreePath treePath;
        ATreeNode treeNode;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            if (configTree.isRowSelected(rowIndex)) {
                treePath = configTree.getPathForRow(rowIndex);
                treeNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent()).getUserObject();
                multipleSelection.add(treeNode);
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

     * a directory.
     *
     * @return
     */
    public boolean isSelectionConfig() {
        ATreeNode treeNode = this.getSelection();
        return treeNode instanceof ConfigTreeNode;
    }
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

    public void expandNode(ATreeNode treeNode) {
        int nbRows = configTree.getRowCount();
        TreePath treePath;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            ATreeNode searchTreeNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent())
                    .getUserObject();
            if (searchTreeNode.equals(treeNode)) {
                configTree.expandRow(rowIndex);
            }
        }
    }
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

     *
     * @param rootDirectoryTreeNode the root directory of the tree structure.
     */
    public void setTreeContent(DirectoryTreeNode rootDirectoryTreeNode) {
        innerSelection = true;
        ATreeNode selectedNode = this.getSelection();

        int nbRows = configTree.getRowCount();
        Set<ATreeNode> expandedNodesSet = new HashSet<ATreeNode>();
        TreePath treePath;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            if (configTree.isExpanded(rowIndex)) {
                treePath = configTree.getPathForRow(rowIndex);
                Object[] pathElementsArray = treePath.getPath();
                List<ATreeNode> pathElementsList = new ArrayList<ATreeNode>(
                        pathElementsArray.length);
                for (Object element : pathElementsArray) {
                    pathElementsList.add((ATreeNode) ((DefaultMutableTreeNode) element)
                            .getUserObject());
                }
                expandedNodesSet.addAll(pathElementsList);
            }
        }

        DefaultMutableTreeNode rootNode = buildJTreeNodeFromWrapper(rootDirectoryTreeNode);

        treeModel = new DefaultTreeModel(rootNode);
        configTree.setModel(treeModel);

        nbRows = configTree.getRowCount();
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            ATreeNode treeNode = (ATreeNode) ((DefaultMutableTreeNode) treePath
                    .getLastPathComponent()).getUserObject();
            if (expandedNodesSet.contains(treeNode)) {
                configTree.expandRow(rowIndex);
                nbRows = configTree.getRowCount();
            }
        }

        ATreeNode treeNode;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            treeNode = (ATreeNode) ((DefaultMutableTreeNode) treePath.getLastPathComponent())
                    .getUserObject();
            if (treeNode.equals(selectedNode)) {
                configTree.addSelectionRow(rowIndex);
            }
        }
        innerSelection = false;
    }
View Full Code Here

Examples of fr.soleil.salsa.client.view.tool.ATreeNode

        boolean select;
        IConfig<?> config1;
        IConfig<?> config2;
        for (int rowIndex = 0; rowIndex < nbRows; ++rowIndex) {
            treePath = configTree.getPathForRow(rowIndex);
            ATreeNode searchNode = (ATreeNode) ((DefaultMutableTreeNode) treePath
                    .getLastPathComponent()).getUserObject();
            select = treeNode.equals(searchNode);
            if (!select) {
                if (treeNode instanceof ConfigTreeNode && searchNode instanceof ConfigTreeNode) {
                    config1 = ((ConfigTreeNode) treeNode).getConfig();
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.