Package eu.planets_project.pp.plato.model.scales

Examples of eu.planets_project.pp.plato.model.scales.Scale.createValue()


                        // This means that I am not entitled to evaluate this measurementInfo and therefore supposed to skip it:
                        continue;
                    }
                    if (ACTION_RETAIN_FILENAME.equals(propertyURI)) {
                        // for all wrapped minimee migrators the output filename can be determined by -o <filename> or something similar 
                        Value v = scale.createValue();
                        v.setComment("obtained from PCDL descriptor");
                        v.parse("Yes");
                        results.put(measurementInfoUri, v);
                    }
                   
View Full Code Here


                            int sampleWidth = Integer.parseInt(extractor.extractText(fitsDocSample,"//fits:imageWidth/text()"));
                            int resultWidth =  Integer.parseInt(extractor.extractText(fitsDocResult,"//fits:imageWidth/text()"));
                           
                            double sampleRatio = ((double)sampleWidth) / sampleHeight;
                            double resultRatio = ((double)resultWidth) / resultHeight;
                            v = scale.createValue();
                            ((BooleanValue)v).bool(0 == Double.compare(sampleRatio, resultRatio));
                            v.setComment(String.format("Reference value: %s\nActual value: %s",
                                    formatter.formatFloat(sampleRatio),formatter.formatFloat(resultRatio)));
                        } catch (NumberFormatException e) {
                            // not all values are available - aspectRatio cannot be calculated
View Full Code Here

                            ((BooleanValue)v).bool(0 == Double.compare(sampleRatio, resultRatio));
                            v.setComment(String.format("Reference value: %s\nActual value: %s",
                                    formatter.formatFloat(sampleRatio),formatter.formatFloat(resultRatio)));
                        } catch (NumberFormatException e) {
                            // not all values are available - aspectRatio cannot be calculated
                            v = scale.createValue();
                            v.setComment("Image width and/or height are not available - aspectRatio cannot be calculated");
                        }
                     }  else if((OBJECT_COMPRESSION_SCHEME + "#equal").equals(propertyURI)) {
                         v = identicalValues(sampleImageCompressionScheme, resultImageCompressionScheme, scale);
                     else if(OBJECT_COMPRESSION_LOSSLESS.equals(propertyURI)) {
View Full Code Here

                     else if((OBJECT_COMPRESSION_SCHEME + "#equal").equals(propertyURI)) {
                         v = identicalValues(sampleImageCompressionScheme, resultImageCompressionScheme, scale);
                     else if(OBJECT_COMPRESSION_LOSSLESS.equals(propertyURI)) {
                         // At the moment we only handle compression schemes of images
                         if ((resultImageCompressionScheme != null) && (!"".equals(resultImageCompressionScheme))) {
                             v = scale.createValue();
                             ((BooleanValue)v).bool(FITS_COMPRESSIONSCHEME_UNCOMPRESSED.equals(resultImageCompressionScheme));
                         }
                     }  else if(OBJECT_COMPRESSION_LOSSY.equals(propertyURI)) {
                         // At the moment we only handle compression schemes of images
                         if ((resultImageCompressionScheme != null) && (!"".equals(resultImageCompressionScheme))) {
View Full Code Here

                             ((BooleanValue)v).bool(FITS_COMPRESSIONSCHEME_UNCOMPRESSED.equals(resultImageCompressionScheme));
                         }
                     }  else if(OBJECT_COMPRESSION_LOSSY.equals(propertyURI)) {
                         // At the moment we only handle compression schemes of images
                         if ((resultImageCompressionScheme != null) && (!"".equals(resultImageCompressionScheme))) {
                             v = scale.createValue();
                             ((BooleanValue)v).bool(! FITS_COMPRESSIONSCHEME_UNCOMPRESSED.equals(resultImageCompressionScheme));
                         }
                     }  else if((OBJECT_IMAGE_COLORENCODING_BITSPERSAMPLE + "#equal").equals(propertyURI)) {
                         String sampleValue = extractor.extractText(fitsDocSample,"//fits:bitsPerSample/text()");
                         String resultValue = extractor.extractText(fitsDocResult,"//fits:bitsPerSample/text()");
View Full Code Here

                // This means that I am not entitled to evaluate this measurementInfo and therefore supposed to skip it:
                continue;
            }
            if (OBJECT_FORMAT_RELATIVEFILESIZE.equals(propertyURI)) {
                // evaluate here
                PositiveFloatValue v = (PositiveFloatValue) scale.createValue();
                double d = ((double)result.getData().getSize())/sample.getData().getSize()*100;
                long l = Math.round(d);
                d = ((double)l)/100;
                v.setValue(d);
                results.put(measurementInfoUri, v);
View Full Code Here

            if (scale == null)  {
                // This means that I am not entitled to evaluate this measurementInfo and therefore supposed to skip it:
                continue;
            }
           
            Value value = scale.createValue();
            String propertyURI = info.getAsURI();
           
            if (ACTION_BATCH_SUPPORT.equals(propertyURI)) {
                if (alternative.getAction() instanceof IMigrationAction) {
                    // this alternative is wrapped as service and therefore provides batch support
View Full Code Here

                    } else if (FORMAT_LICENSE_IPR_PROTECTED.equals(propertyURI)) {
                        boolResult = ipr;
                    } else if (FORMAT_LICENSE_PROPRIETARY.equals(propertyURI)) {
                        boolResult = proprietary;
                    }
                    value = scale.createValue();
                    ((BooleanValue)value).bool(boolResult);
                    value.setComment(comment + "according to MiniREEF/P2 knowledge base");
                    listener.updateStatus("MiniREEF evaluated "+propertyURI);
                }
                listener.updateStatus("P2 does not contain enough information to evaluate "+propertyURI+" for this format.");
View Full Code Here

                       (FORMAT_STABILITY.equals(propertyURI))||
                       (FORMAT_LICENSE.equals(propertyURI)))  {
                if (resultSet.size()>0) {
                    String text = resultSet.getRow(0).get(0);
                    if (text.trim().length() > 0) {
                        value = scale.createValue();
                        value.parse(text);
                        value.setComment("according to miniREEF/P2 knowledge base");
                    }
                    listener.updateStatus("MiniREEF evaluated "+propertyURI);
                } else {
View Full Code Here

                       
                        if (d.compareTo(Scale.MAX_VALUE) == 0) {
                            // No: only evaluation results are returned, no error messages
                            // v.setComment("ImageMagick compare failed or could not be called");
                        } else {
                            v = scale.createValue();
                            ((BooleanValue)v).bool(d.compareTo(0.0) == 0);
                            v.setComment("ImageMagick compare returned "+Double.toString(d)+" different pixels");
                        }
        //                log.debug("difference" + Double.toString(Scale.MAX_VALUE-d));
                    } else {
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.