Package eu.planets_project.pp.plato.model.measurement

Examples of eu.planets_project.pp.plato.model.measurement.MeasurableProperty


           if (uri == null){
               log.error("found invalid property definition");
           } else {
               // We check if we have that property already. If not, we put
               // the property into the map.
               MeasurableProperty existingP = properties.get(propertyId);
               if (existingP == null) {
                   // this property could not be measured so far - add it to the map
                   properties.put(propertyId, p);
                   // and add the scale of this property too
                   measurementScales.put(uri, p.getScale());
               }
               // We look at all metrics and look
               // a. is the property+metric already mapped to a scale?
               // b. is the metric already listed in the property?
               for(Metric m : p.getPossibleMetrics()) {
                   helperInfo.setMetric(m);
                   uri = helperInfo.getUri();
                   // a. if property+metric isnt yet mapped, we put down the scale.
                   if (!measurementScales.containsKey(uri)) {
                       measurementScales.put(uri, m.getScale());
                   }
                   // If we have an existing property, we have to check if it contains this metric.
                   // If it does not, we add the metric to ist list.
                   if (existingP != null && (!containsMetric(m.getMetricId(), existingP.getPossibleMetrics()))) {
                       existingP.getPossibleMetrics().add(m);
                   }
                  
               }
           }
       }
View Full Code Here


    public void editMapping(){
        if (mpmSelectedLeaf == null) {
            return;
        }
       
        MeasurableProperty leafProp = mpmSelectedLeaf.getMeasurementInfo().getProperty();
        if ((leafProp != null) && (leafProp.getCategory() != null)) {
        }
        mappingStatus.setValue("category");
    }
View Full Code Here

            String name = p.getName();
            propertiesMap.put(name, p);
            propertiesModel.add(new SelectItem(name));
        }
       
        MeasurableProperty leafProp = mpmSelectedLeaf.getMeasurementInfo().getProperty();
        if (leafProp != null) {
            // there was a mapping, try to restore the selected property
            mappingProperty = propertiesMap.get(leafProp.getName());
        } else if (props.size()>0){
            // no mapping was defined, select the first entry
            mappingProperty = props.get(0);
        }
        mappingStatus.setValue("property");
View Full Code Here

     */
    private void addMeasurementInfo(MeasurementInfo info,
            Element parent) {
        Element infoEl = parent.addElement("measurementInfo");

        MeasurableProperty prop = (MeasurableProperty)info.getProperty();
        if (prop != null) {
            Element propertyEl = infoEl.addElement("property");
            addStringElement(propertyEl, "category", prop.getCategory().toString());
            addStringElement(propertyEl, "propertyId", prop.getPropertyId());
            addStringElement(propertyEl, "name", prop.getName());
            addStringElement(propertyEl, "description", prop.getDescription());
            addScale(prop.getScale(), propertyEl);
            // note: we only keep the selected property and metric
            addChangeLog(prop.getChangeLog(), propertyEl);
           
        }
        addMetric(info.getMetric(), infoEl);

        addChangeLog(info.getChangeLog(), infoEl);
View Full Code Here

        SampleObject r = new SampleObject();
        r.getData().setData(data);
        r.setFullname(filename);
       
        Measurement success = new Measurement();
        success.setProperty(new MeasurableProperty(new BooleanScale(), MigrationResult.MIGRES_SUCCESS));
        success.setValue(success.getProperty().getScale().createValue());
       
        Measurement report = new Measurement();
        report.setProperty(new MeasurableProperty(new FreeStringScale(), MigrationResult.MIGRES_REPORT));
        report.setValue(report.getProperty().getScale().createValue());
       
        try {
            MigrationResult result = service.migrate(e.getAction(), r);
            if (result.isSuccessful()) {
View Full Code Here

        this.name = name;
    }

    private List<MeasurableProperty> getMeasurableProperties() {
        List<MeasurableProperty> list = new ArrayList<MeasurableProperty>();
        list.add(new MeasurableProperty(new BooleanScale(),"xcl:imageWidth:equal"));
        list.add(new MeasurableProperty(new BooleanScale(),"xcl:imageHeight:equal"));
        list.add(new MeasurableProperty(new BooleanScale(),"xcl:bitsPerSample:equal"));
        list.add(new MeasurableProperty(new IntegerScale(),"xcl:bitsPerSample:intDiff"));
        list.add(new MeasurableProperty(new BooleanScale(),"xcl:interlace:equal"));
        list.add(new MeasurableProperty(new BooleanScale(),"xcl:transparency:equal"));
        list.add(new MeasurableProperty(new BooleanScale(),"xcl:backgroundColour:equal"));
        list.add(new MeasurableProperty(new PositiveIntegerScale(),"xcl:rgbPalette:hammingDistance"));
        list.add(new MeasurableProperty(new FloatRangeScale(),"xcl:gamma:percDeviation"));
        return list;
    }
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.measurement.MeasurableProperty

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.