Package eu.planets_project.pp.plato.model.tree

Examples of eu.planets_project.pp.plato.model.tree.TreeNode


        }
    }

    public void removeLibraryNode(Object object) {
        if (object instanceof TreeNode) {
            TreeNode n = (TreeNode)object;
            if (n.getParent() != null) {
                ((Node)n.getParent()).removeChild(n);
                selectedLibNode = null;
                libraryTreeHelper.closeNode(object);
            }
        }
    }
View Full Code Here


    public void processReqSelection(NodeSelectedEvent event) {
        HtmlTree tree = (HtmlTree) event.getComponent();
       
        Object current = tree.getRowData();
        TreeNode t = current instanceof TreeNode ? (TreeNode)current : null;
       
        if (t != null) {
            selectedReqNode = t;
        }
    }
View Full Code Here

    }
    public void processLibSelection(NodeSelectedEvent event) {
        HtmlTree tree = (HtmlTree) event.getComponent();
       
        Object current = tree.getRowData();
        TreeNode currentNode = current instanceof TreeNode ? (TreeNode)current : null;
       
        if (currentNode != null) {
            selectedLibNode = currentNode;
        }
    }
View Full Code Here

    public void useLibraryFragment() {
        if ((selectedLibNode == null) || (selectedReqNode == null)) {
            log.debug("use template is not possible, select first a criterion/requirement of the library, and a requirement in Your tree.");
            return;
        }
        TreeNode node = null;
        if (selectedReqNode.isLeaf()) {
            node = selectedReqNode.getParent();
            ((Node)node).removeChild(selectedReqNode);
            nodesToDelete.add(selectedReqNode);
            selectedReqNode = node;
        } else {
            node = selectedReqNode;
        }
        if (node != null) {
            // append tree fragment
            TreeNode clone = selectedLibNode.clone();
            ((Node)node).addChild(clone);
            treeHelper.expand(clone);
        }
    }
View Full Code Here

   
    private List<TreeNode> nodesToDelete = new ArrayList<TreeNode>();
   
      
    private void resetTransformers(){
        TreeNode root = this.selectedPlan.getTree().getRoot();
        for (Leaf leaf : root.getAllLeaves()) {
            /*
             * maybe the scaletype is not set yet
             * -> leaf.setDefaultTransformer has to handle null-values itself
             */
            if ((leaf.getScale() == null) ||
View Full Code Here

            if (templates.size() != 1) {
                FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, "Unable to load template.");
                return;
            }
           
            TreeNode newRoot = ((TreeNode)templates.get(0).getRoot()).clone();

            newRoot.touchAll(user.getUsername());

            //newtree.adjustScalesToMeasurements(MiniRED.getInstance().getMeasurementsDescriptor());
            newRoot.initWeights();
           
            nodesToDelete.add(selectedPlan.getTree().getRoot());
           
            selectedPlan.getTree().setRoot(newRoot);
           
View Full Code Here

     */
    public void removeNode(Object nodeToRemove) {
        if (nodeToRemove == null) {
            return;
        }
        TreeNode node = (TreeNode) nodeToRemove;
        if (node.getParent() != null) {
            // parent has been changed
            ((Node) node.getParent()).touch();
            ((Node) node.getParent()).removeChild(node);
            if(treeHelper != null) {
                treeHelper.closeNode(node);
            }
        }
        selectedReqNode = null;
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.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.