Package eu.scape_project.planning.model.tree

Examples of eu.scape_project.planning.model.tree.ObjectiveTree


        log.debug("Start FreeMind import.");
        log.debug("FileName: " + file.getFullname());
        log.debug("HasUnits is: " + includesUnits);

        InputStream istream = new ByteArrayInputStream(file.getData().getData());
        ObjectiveTree newtree = treeLoader.loadFreeMindObjectiveTree(istream, includesUnits, true);

        if (newtree == null) {
            log.error("File is corrupted and new Tree cannot be built out of it.");
            return false;
        }

        // delete old tree
        nodesToDelete.add(plan.getTree().getRoot());

        // set new tree as plan tree
        plan.getTree().setRoot(newtree.getRoot());

        // make sure all scales are set according to measurement infos
        plan.getTree().adjustScalesToMeasurements();
        plan.getTree().setWeightsInitialized(false);
View Full Code Here


        }
        measuresToDelete.clear();
    }
    public boolean createTreeFromPreservationCase(PreservationCase preservationCase) {

        ObjectiveTree newTree = new ObjectiveTree();

        Node root = new Node();
        root.setName(preservationCase.getName());

        newTree.setRoot(root);

        for (ControlPolicy cp : preservationCase.getControlPolicies()) {

            Measure m = criteriaManager.getMeasure(cp.getMeasure().getUri());

            List<String> criteriaHierarchy = criteriaManager.getCategoryHierachy(m.getUri());

            Leaf leaf = createLeafInCriteriaHierarchy(newTree.getRoot(), criteriaHierarchy);

            if (leaf != null) {
                assignMeasureToLeaf(m, leaf);
            }

            log.info(criteriaHierarchy.toString());
        }

        nodesToDelete.add(plan.getTree().getRoot());

        // set new tree as plan tree
        plan.getTree().setRoot(newTree.getRoot());

        // make sure all scales are set according to measurement infos
        plan.getTree().adjustScalesToMeasurements();
        plan.getTree().setWeightsInitialized(false);
View Full Code Here

     */
    public ObjectiveTree loadFreeMindObjectiveTree(InputStream in, boolean hasUnits, boolean hasLeaves) {
        MindMap map = loadFreeMindMap(in);
        if (map != null) {
            // traverse temp structure of map and nodes and create ObjectiveTree
            ObjectiveTree tree = new ObjectiveTree();
            tree.setRoot(map.getObjectiveTreeRoot(hasUnits, hasLeaves));
            if (tree.getRoot().isLeaf()) {
                return null;
            }
            return tree;
        }
        return null;
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.tree.ObjectiveTree

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.