Examples of Leaf


Examples of com.slmn.visitor.gui.Leaf

 
  @Override
  public void start(Stage stage) throws Exception {
    Locale.setDefault(Locale.ENGLISH);
    BorderPane pane = new BorderPane();
    Leaf l0 = new Leaf("Leaf_00");
    Leaf l1 = new Leaf("Leaf_01");
    Leaf l2 = new Leaf("Leaf_02");
    Leaf l3 = new Leaf("Leaf_03");
    Leaf l4 = new Leaf("Leaf_04");
    Leaf l5 = new Leaf("Leaf_05");
    Leaf l6 = new Leaf("Leaf_06");
    Leaf l7 = new Leaf("Leaf_07");
    Leaf l8 = new Leaf("Leaf_08");
    HComposite hc1 = new HComposite();
    HComposite hc2 = new HComposite();
    HComposite hc3 = new HComposite();
    HComposite hc4 = new HComposite();
    HComposite hc5 = new HComposite();
View Full Code Here

Examples of com.sun.tools.txw2.model.Leaf

    public Leaf modelGroup(XSModelGroup mg) {
        XSParticle[] children = mg.getChildren();
        if(children.length==0return new Empty(mg.getLocator());

        Leaf l = particle(children[0]);
        for( int i=1; i<children.length; i++ )
            l.merge(particle(children[i]));
        return l;
    }
View Full Code Here

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

    private PositiveIntegerScale posInt = new PositiveIntegerScale();
    private PositiveFloatScale posFloat = new PositiveFloatScale();
   
    @Test
    public void testScaleBooleanValue(){
        Leaf leaf = new Leaf();
        leaf.changeScale(booleanScale);
        // test as parent Scale - this is the way it is used within the application
        Scale scale = leaf.getScale();
        assert("Yes/No".equals(((BooleanScale)scale).getRestriction()));
        ((RestrictedScale)scale).setRestriction("meine/eigene");
        assert("Yes/No".equals(((RestrictedScale)scale).getRestriction()));
        Scale cloned = scale.clone();
        assert(cloned instanceof BooleanScale);
View Full Code Here

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

        assert("Yes/No".equals(((RestrictedScale)cloned).getRestriction()));
    }
   
    @Test
    public void testScaleIntRangeValue(){
        Leaf leaf = new Leaf();
        leaf.changeScale(intRangeScale);
        Scale scale = leaf.getScale();
        assert("0/5".equals(((RestrictedScale)scale).getRestriction()));
        ((RestrictedScale)scale).setRestriction("-5/-1");
        assert("-5/-1".equals(((RestrictedScale)scale).getRestriction()));
        ((RestrictedScale)scale).setRestriction("aa/bbb");
        assert("-5/-1".equals(((RestrictedScale)scale).getRestriction()));
View Full Code Here

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

        assert("mm".equals(cloned.getUnit()));
    }
   
    @Test
    public void testChangeScaleType(){
        Leaf leaf = new Leaf();
        leaf.changeScale(booleanScale);
        leaf.changeScale(intRangeScale);
        Scale scale = leaf.getScale();
       
        assert(scale instanceof IntRangeScale);
        assert("0/5".equals(((RestrictedScale)scale).getRestriction()));
       
        leaf.changeScale(yanScale);
        scale = leaf.getScale();
        assert(scale instanceof YanScale);
        assert("Yes/Acceptable/No".equals(((RestrictedScale)scale).getRestriction()));
        assert("Yes/Acceptable/No".equals(((OrdinalScale)scale).getRestriction()));
        assert("Yes/Acceptable/No".equals(((YanScale)scale).getRestriction()));       
       
View Full Code Here

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

        Node childNode = new Node();
        childNode.setName("Image properties");
        rootN.addChild(childNode);

        Leaf leafWithUnit = new Leaf();
        leafWithUnit.setName("Amount of Pixel");
        leafWithUnit.changeScale(new PositiveIntegerScale());
        leafWithUnit.getScale().setUnit("px");
        childNode.addChild(leafWithUnit);

        Leaf ordinalLeaf = new Leaf();
        ordinalLeaf.setName("Karma");
        OrdinalScale ordinalScale = new OrdinalScale();
        ordinalScale.setRestriction("Good/Bad/Evil");
        ordinalLeaf.changeScale(ordinalScale);
        rootN.addChild(ordinalLeaf);

        Leaf numericLeaf = new Leaf();
        numericLeaf.setName("Filesize (in Relation to Original)");
        numericLeaf.changeScale(new PositiveFloatScale());
        numericLeaf.getScale().setUnit("MB");
        rootN.addChild(numericLeaf);

        Leaf singleLeaf = new Leaf();
        singleLeaf.setName("A Single-Leaf");
        singleLeaf.changeScale(new PositiveFloatScale());
        singleLeaf.getScale().setUnit("tbd");
        singleLeaf.setSingle(true);
        rootN.addChild(singleLeaf);

        Leaf restrictedLeaf = new Leaf();
        restrictedLeaf.setName("IntRange 0-10");
        IntRangeScale range = new IntRangeScale();
        range.setLowerBound(0);
        range.setUpperBound(10);
        restrictedLeaf.changeScale(range);
        rootN.addChild(restrictedLeaf);

        q.getTree().setRoot(rootN);

        q.getTree().initValues(q.getAlternativesDefinition().getAlternatives(),
                q.getSampleRecordsDefinition().getRecords().size());


        int j = 3;
        int alternativeIndex = 0;
        for (Alternative alt : q.getAlternativesDefinition().getAlternatives()) {

            double[] singleLeafValues = { 3.2, 5.2 };
            int[][] leafWithUnitValues = { { 1024, 2048 }, { 2048, 2048 } };
            int[][] ordinalValues = { { 0, 1 }, { 2, 1 } };
            double[][] numericValues = { { 6500.32, 7312, 28 },
                    { 8212.65, 7921.235 } };
            int[][] restrictedValues = { { 8, 5 }, { 3, 7 } };
            ((PositiveFloatValue) singleLeaf.getValueMap().get(alt.getName())
                    .getValue(0)).setValue(singleLeafValues[alternativeIndex]);

            List<String> ordinalOptions = ((OrdinalScale) ordinalLeaf
                    .getScale()).getList();

            for (int i = 0; i < q.getSampleRecordsDefinition().getRecords()
                    .size(); i++) {
                ((PositiveIntegerValue) leafWithUnit.getValueMap().get(
                        alt.getName()).getValue(i))
                        .setValue(leafWithUnitValues[alternativeIndex][i]);
                ((OrdinalValue) ordinalLeaf.getValueMap().get(alt.getName())
                        .getValue(i)).setValue(ordinalOptions
                        .get(ordinalValues[alternativeIndex][i]));
                ((PositiveFloatValue) numericLeaf.getValueMap().get(
                        alt.getName()).getValue(i))
                        .setValue(numericValues[alternativeIndex][i]);
                ((IntRangeValue) restrictedLeaf.getValueMap()
                        .get(alt.getName()).getValue(i))
                        .setValue(restrictedValues[alternativeIndex][i]);
            }
/*
            NumericTransformer nt = (NumericTransformer) singleLeaf
View Full Code Here

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

public class NodeTester {
   
    @Test
    public void isCompletelySpecified(){
        Node node = new Node();
        Leaf leaf = new Leaf();
        leaf.setName("Name");
        node.addChild(leaf);
        node.addChild(leaf);
        Leaf leaf2 = new Leaf();
        leaf2.setName("Name2");
        node.addChild(leaf2);
        node.addChild(leaf2);
        List<String> nodelist = new ArrayList<String>();
        System.out.println(node.getChildren().size());
        node.isCompletelySpecified(nodelist);
View Full Code Here

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

     */
    private void addSubTree(TreeNode data, Element xmlRoot) {
        if (data.isLeaf()) {
            Element leaf = xmlRoot.addElement("leaf");
            addNodeAttributes(data, leaf);
            Leaf l = (Leaf) data;
            leaf.addElement("aggregationMode")
            .addAttribute("value", l.getAggregationMode().name());

            String typename= null;
            /*
             * Scale:
             * A special element is created, depending on the type of the scale
             */
            Scale s = l.getScale();

            if (s != null) {
                typename = deriveElementname(s.getClass());


                addScale(s, leaf);

                // Transformer
                if (l.getTransformer() != null) {
                    Element transformer = leaf.addElement(deriveElementname(l.getTransformer().getClass()));

                    if (l.getTransformer() instanceof OrdinalTransformer) {

                        Map<String,TargetValueObject> mapping = ((OrdinalTransformer) l.getTransformer()).getMapping();
                        Element mappings = transformer.addElement("mappings");
                        for (String ordinal : mapping.keySet()) {
                            mappings.addElement("mapping")
                            .addAttribute("ordinal", ordinal)
                            .addAttribute("target", floatFormatter.formatFloatPrecisly(mapping.get(ordinal).getValue()));
                        }
                    }
                    if (l.getTransformer() instanceof NumericTransformer) {
                        NumericTransformer nt = (NumericTransformer) l.getTransformer();
                        transformer.addElement("mode")
                                   .addAttribute("value", nt.getMode().name());
                        Element thresholds = transformer.addElement("thresholds");
                        thresholds.addElement("threshold1").setText(floatFormatter.formatFloatPrecisly(nt.getThreshold1()));
                        thresholds.addElement("threshold2").setText(floatFormatter.formatFloatPrecisly(nt.getThreshold2()));
                        thresholds.addElement("threshold3").setText(floatFormatter.formatFloatPrecisly(nt.getThreshold3()));
                        thresholds.addElement("threshold4").setText(floatFormatter.formatFloatPrecisly(nt.getThreshold4()));
                        thresholds.addElement("threshold5").setText(floatFormatter.formatFloatPrecisly(nt.getThreshold5()));
                       
                    }
                    addChangeLog(l.getTransformer().getChangeLog(), transformer);
                }
               
                if (l.getMeasurementInfo() != null) {
                    addMeasurementInfo(l.getMeasurementInfo(), leaf);
                }
               
                Element eval = leaf.addElement("evaluation");
                typename = typename.substring(0, typename.lastIndexOf("Scale"));
                /*
                 * keep in mind: there are only values of the considered alternatives in the map
                 */
                for (String a : l.getValueMap().keySet()) {
                    Element alt = eval.addElement("alternative");
                    alt.addAttribute("key", a);
                    addStringElement(alt, "comment", l.getValueMap().get(a).getComment());
                    for (Value v : l.getValueMap().get(a).getList()) {
                        /*
                         * A special element is created, depending on the type of the scale
                         */
                        Element valElement = alt.addElement(typename+"Result");
                        addStringElement(valElement, "value", v.toString());
View Full Code Here

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

     * @param Node
     *            to attach the Leaf to.
     * @return New attached Leaf.
     */
    public Leaf addNewLeaf(Node node) {
        Leaf newLeaf = new Leaf();
        node.addChild(newLeaf);
        // this node has been changed()
        node.touch();
        return newLeaf;
    }
View Full Code Here

Examples of net.opentsdb.tree.Leaf

    branch.setDisplayName("cpu");
    storage.addColumn(branch.compileBranchId(), Tree.TREE_FAMILY(),
        "branch".getBytes(MockBase.ASCII()),
        (byte[])branchToStorageJson.invoke(branch));
   
    Leaf leaf = new Leaf("user", "000001000001000001");
    qualifier = leaf.columnQualifier();
    storage.addColumn(branch.compileBranchId(), Tree.TREE_FAMILY(),
        qualifier, (byte[])LeaftoStorageJson.invoke(leaf));
   
    leaf = new Leaf("nice", "000002000002000002");
    qualifier = leaf.columnQualifier();
    storage.addColumn(branch.compileBranchId(), Tree.TREE_FAMILY(),
        qualifier, (byte[])LeaftoStorageJson.invoke(leaf));
   
    // child branch
    branch = new Branch(1);
    path.put(3, "mboard");
    branch.prependParentPath(path);
    branch.setDisplayName("mboard");
    storage.addColumn(branch.compileBranchId(), Tree.TREE_FAMILY(),
        "branch".getBytes(MockBase.ASCII()),
        (byte[])branchToStorageJson.invoke(branch));
   
    leaf = new Leaf("Asus", "000003000003000003");
    qualifier = leaf.columnQualifier();
    storage.addColumn(branch.compileBranchId(), Tree.TREE_FAMILY(),
        qualifier, (byte[])LeaftoStorageJson.invoke(leaf));
  }
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.