Package eu.scape_project.planning.model.kbrowser

Examples of eu.scape_project.planning.model.kbrowser.CriteriaLeaf


        return new TestSuite(CriteriaHierarchyExporterTest.class);
    }

    public void testExportToFreemindXml_noCriterionMapped() throws Exception {
        // create criteria-hierarchy tree
        CriteriaLeaf leaf1 = new CriteriaLeaf();
        leaf1.setName("leaf1");
        CriteriaLeaf leaf2 = new CriteriaLeaf();
        leaf2.setName("leaf2");
        CriteriaLeaf leaf3 = new CriteriaLeaf();
        leaf3.setName("leaf3");

        CriteriaNode subNode = new CriteriaNode();
        subNode.setName("subNode");
        subNode.addChild(leaf1);
        subNode.addChild(leaf2);
View Full Code Here


        assertXMLEqual(expectedXml, exportedXml);
    }

    public void testExportToFreemindXml_severalMappedCriteria() throws Exception {
        // create criteria-hierarchy tree
        CriteriaLeaf leaf1 = new CriteriaLeaf();
        leaf1.setName("leaf1");
        Measure imageWidthEqualsCrit = new Measure();
        imageWidthEqualsCrit.setUri("outcome://object/image/width#equal");
        leaf1.setMeasure(imageWidthEqualsCrit);
        leaf1.setMapped(true);
        CriteriaLeaf leaf2 = new CriteriaLeaf();
        leaf2.setName("leaf2");
        CriteriaLeaf leaf3 = new CriteriaLeaf();
        leaf3.setName("leaf3");
        Measure textQualityCrit = new Measure();
        textQualityCrit.setUri("outcome://object/image/textQuality");
        leaf3.setMeasure(textQualityCrit);
        leaf3.setMapped(true);

        CriteriaNode subNode = new CriteriaNode();
        subNode.setName("subNode");
        subNode.addChild(leaf1);
        subNode.addChild(leaf2);
View Full Code Here

        assertXMLEqual(expectedXml, exportedXml);
    }

    public void testExportToFreemindXml_setMappingWithNullCriterionIsIgnored() throws Exception {
        // create criteria-hierarchy tree
        CriteriaLeaf leaf1 = new CriteriaLeaf();
        leaf1.setName("leaf1");
        leaf1.setMapped(true);
        leaf1.setMeasure(null);

        CriteriaNode rootNode = new CriteriaNode();
        rootNode.setName("rootNode");
        rootNode.addChild(leaf1);
View Full Code Here

     * @return Node (and its successors) converted into corresponding a CriteriaTreeNodes.
     */
    public CriteriaTreeNode createCriteriaTreeNode(CriteriaManager criteriaManager) {
      // Leaf
        if (isLeaf()) {
            CriteriaLeaf leaf = new CriteriaLeaf();

            // Hint: If the node is mapped its text has a specific format (my property name|outcome:format/image/width)
            // We have to check this
        int stringLength = TEXT.length();
        int mappingSeparatorIndex = TEXT.lastIndexOf('|');
       
        // node has no mapping specified
        if (mappingSeparatorIndex == -1 || mappingSeparatorIndex == (stringLength - 1)) {
          leaf.setMapped(false);
          leaf.setName(TEXT);
        }
        // node has mapping specified
        else {
          String name = TEXT.substring(0, mappingSeparatorIndex);
          String criterionUri = TEXT.substring(mappingSeparatorIndex + 1);
          leaf.setName(name);
          // set criterion only if we can identify it
          Measure crit = criteriaManager.getMeasure(criterionUri);
          if (crit != null) {
            leaf.setMapped(true);
            leaf.setMeasure(new Measure(crit));
          }
          else {
            leaf.setMapped(false);
          }
        }
       
        return leaf;
      // Node
View Full Code Here

                        CriteriaNode criteriaNode = (CriteriaNode) criteriaTreeNode;
                        criteriaNode.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());
                    }
                    // assign relevant data to criteria leaves
                    if (criteriaTreeNode instanceof CriteriaLeaf) {
                        CriteriaLeaf criteriaLeaf = (CriteriaLeaf) criteriaTreeNode;
                        criteriaLeaf.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());
                        if (criteriaLeaf.getMapped()) {
                            criteriaLeaf.setPlanLeaves(getPlanLeavesMatchingCriterion(criteriaLeaf.getMeasure()));
                        }
                    }
                }
                log.debug("Assigned relevant data to all Hierarchy tree nodes.");
View Full Code Here

                    CriteriaNode criteriaNode = (CriteriaNode) criteriaTreeNode;
                    criteriaNode.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());
                }
                // assign relevant data to criteria leaves
                if (criteriaTreeNode instanceof CriteriaLeaf) {
                    CriteriaLeaf criteriaLeaf = (CriteriaLeaf) criteriaTreeNode;
                    criteriaLeaf.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());
                    if (criteriaLeaf.getMapped()) {
                        criteriaLeaf.setPlanLeaves(getPlanLeavesMatchingCriterion(criteriaLeaf.getMeasure()));
                    }
                }
            }
        }
    }
View Full Code Here

        this.planLeaves = planLeaves;

        // will be updated as soon as a criterion is selected
        this.measurePlanLeaves = new ArrayList<VPlanLeaf>();

        this.criteriaAggregator = new CriteriaLeaf(nrRelevantPlans);

        filterMappedLeaves();
    }
View Full Code Here

    private void evaluateCriterion(Measure measure) {
        List<VPlanLeaf> criterionPlanLeaves = getCriterionPlanLeaves(measure);

        if (criterionPlanLeaves.size() > 0) {
            CriteriaLeaf criteriaLeaf = new CriteriaLeaf(nrRelevantPlans);
            criteriaLeaf.setPlanLeaves(criterionPlanLeaves);

            ImportanceAnalysisProperty importanceAnalysisProperty = new ImportanceAnalysisProperty();
            importanceAnalysisProperty.setCategory(measure.getAttribute().getCategory().getName());
            importanceAnalysisProperty.setAttribute(measure.getAttribute().getName());
            importanceAnalysisProperty.setMeasure(measure.getName());

            importanceAnalysisProperty.setIf1(criteriaLeaf.getImportanceFactorIF1());
            importanceAnalysisProperty.setIf2(criteriaLeaf.getImportanceFactorIF2());
            importanceAnalysisProperty.setIf3(criteriaLeaf.getImportanceFactorIF3());
            importanceAnalysisProperty.setIf4(criteriaLeaf.getImportanceFactorIF4());
            importanceAnalysisProperty.setIf5(criteriaLeaf.getImportanceFactorIF5());
            importanceAnalysisProperty.setIf6(criteriaLeaf.getImportanceFactorIF6());
            importanceAnalysisProperty.setIf7(criteriaLeaf.getImportanceFactorIF7());
            importanceAnalysisProperty.setIf8(criteriaLeaf.getImportanceFactorIF8());
            importanceAnalysisProperty.setIf9(criteriaLeaf.getImportanceFactorIF9());
            importanceAnalysisProperty.setIf10(criteriaLeaf.getImportanceFactorIF10());
            importanceAnalysisProperty.setIf11(criteriaLeaf.getImportanceFactorIF11());
            importanceAnalysisProperty.setIf12(criteriaLeaf.getImportanceFactorIF12());
            importanceAnalysisProperty.setIf13(criteriaLeaf.getImportanceFactorIF13());
            importanceAnalysisProperty.setIf14(criteriaLeaf.getImportanceFactorIF14());
            importanceAnalysisProperty.setIf15(criteriaLeaf.getImportanceFactorIF15());
            importanceAnalysisProperty.setIf16(criteriaLeaf.getImportanceFactorIF16());
            importanceAnalysisProperty.setIf17(criteriaLeaf.getImportanceFactorIF17());
            importanceAnalysisProperty.setIf18(criteriaLeaf.getImportanceFactorIF18());

            importanceAnalysisProperty.setIf19(calculateImportanceFactorIF19(selectedPlans, criteriaLeaf));

            tableRows.add(importanceAnalysisProperty);
        }
View Full Code Here

     *            Node to attach the new leaf to.
     */
    public void addLeafToNode(Object parentNode) {
        if (parentNode instanceof CriteriaNode) {
            CriteriaNode node = (CriteriaNode) parentNode;
            CriteriaLeaf newLeaf = new CriteriaLeaf(planSelection.getSelectedPlans().size());
            node.addChild(newLeaf);
            log.debug("Leaf added to Node");
        }
    }
View Full Code Here

    private void addSubTreeFreemind(Element xmlElement, CriteriaTreeNode criteriaTreeNode) {
        Element element = xmlElement.addElement("node");

        // LEAF
        if (criteriaTreeNode.isLeaf()) {
          CriteriaLeaf leaf = (CriteriaLeaf) criteriaTreeNode;
          String leafText = "";
         
          // mapped leaf
          if (leaf.getMapped() && leaf.getMeasure() != null) {
            leafText = leaf.getName() + "|" + leaf.getMeasure().getUri();
          }
          // unmapped leaf
          else {
            leafText = leaf.getName();
          }
         
          element.addAttribute("TEXT", leafText);
        }
        // NODE
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.kbrowser.CriteriaLeaf

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.