/** * Gets a value of type <code>double</code>. * * @param key the key * * @return the value for the given key, or <code>0.0</code> (zero) if the key is not contained in this property * set. */ public double getPropertyDouble(String key) { return getPropertyDouble(key, 0.0); }
private void setPixelOffsetY(final PropertyMap preferences) { _pixelOffsetY = (float) preferences.getPropertyDouble(VisatApp.PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_Y, VisatApp.PROPERTY_DEFAULT_PIXEL_OFFSET_FOR_DISPLAY); }
private void setPixelOffsetX(final PropertyMap preferences) { _pixelOffsetX = (float) preferences.getPropertyDouble(VisatApp.PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_X, VisatApp.PROPERTY_DEFAULT_PIXEL_OFFSET_FOR_DISPLAY); }
final double lat1 = map1.getPropertyDouble(KEY_PRODUCT_CENTER_LAT, 180); final double lon1 = map1.getPropertyDouble(KEY_PRODUCT_CENTER_LON, -90); final double lat2 = map2.getPropertyDouble(KEY_PRODUCT_CENTER_LAT, 180); final double lon2 = map2.getPropertyDouble(KEY_PRODUCT_CENTER_LON, -90);
private void setPixelOffsetX(final PropertyMap preferences) { pixelInfoView.setPixelOffsetX((float) preferences.getPropertyDouble( VisatApp.PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_X, VisatApp.PROPERTY_DEFAULT_PIXEL_OFFSET_FOR_DISPLAY)); }
private void setPixelOffsetY(final PropertyMap preferences) { pixelInfoView.setPixelOffsetY((float) preferences.getPropertyDouble( VisatApp.PROPERTY_KEY_PIXEL_OFFSET_FOR_DISPLAY_Y, VisatApp.PROPERTY_DEFAULT_PIXEL_OFFSET_FOR_DISPLAY)); }
private float getGeolocationEps() { return (float) visatApp.getPreferences().getPropertyDouble(VisatApp.PROPERTY_KEY_GEOLOCATION_EPS, VisatApp.PROPERTY_DEFAULT_GEOLOCATION_EPS); }
/** * Sets a value of type <code>Double</code>. * * @param key the key * @param newValue the value * * @throws IllegalArgumentException */ public void setPropertyDouble(String key, Double newValue) { Guardian.assertNotNullOrEmpty("key", key); Double oldValue = getPropertyDouble(key, null); changeInternalProperty(key, oldValue, newValue); }
private float getGeolocationEps() { return (float) VisatApp.getApp().getPreferences().getPropertyDouble(VisatApp.PROPERTY_KEY_GEOLOCATION_EPS, VisatApp.PROPERTY_DEFAULT_GEOLOCATION_EPS); }
public Object getData(final RepositoryEntry entry, final Repository repository) throws IOException { final String productName = entry.getProductFile().getName(); final PropertyMap propertyMap = repository.getPropertyMap(); final String boundaryPathString = propertyMap.getPropertyString(productName + KEY_BOUNDARY_PATH, null); final Double latValue = propertyMap.getPropertyDouble(productName + KEY_PRODUCT_CENTER_LAT, null); final Double lonValue = propertyMap.getPropertyDouble(productName + KEY_PRODUCT_CENTER_LON, null); final PropertyMap dataMap = new PropertyMap(); dataMap.setPropertyString(KEY_BOUNDARY_PATH, boundaryPathString); dataMap.setPropertyDouble(KEY_PRODUCT_CENTER_LAT, latValue); dataMap.setPropertyDouble(KEY_PRODUCT_CENTER_LON, lonValue); return dataMap; }
static void setNoDataLayerStyle(PropertyMap configuration, Layer layer) { final PropertySet layerConfiguration = layer.getConfiguration(); final Color color = configuration.getPropertyColor("noDataOverlay.color", NoDataLayerType.DEFAULT_COLOR); layerConfiguration.setValue(NoDataLayerType.PROPERTY_NAME_COLOR, color); final double transparency = configuration.getPropertyDouble("noDataOverlay.transparency", 0.3); layer.setTransparency(transparency); }
/** * Tests the functionality for set and getPropertyDouble */ public void testSetGetPropertyDouble() { PropertyMap prop = new PropertyMap(); // "a" is not in the set assertEquals(0.0, prop.getPropertyDouble("a"), 1e-10); // test default assertEquals(8.34, prop.getPropertyDouble("a", 8.34), 1e-10); assertEquals(null, prop.getPropertyDouble("a", null)); assertEquals(new Double(8.34), prop.getPropertyDouble("a", new Double(8.34))); // "b" is in the set and 23.4 prop.setPropertyDouble("b", 23.4); assertEquals(23.4, prop.getPropertyDouble("b"), 1e-10); assertEquals(23.4, prop.getPropertyDouble("b", 43.2), 1e-10); assertEquals(new Double(23.4), prop.getPropertyDouble("b", new Double(43.2))); assertEquals(new Double(23.4), prop.getPropertyDouble("b", null)); }
GraticuleLayerType.DEFAULT_RES_PIXELS)); layerConfiguration.setValue(GraticuleLayerType.PROPERTY_NAME_RES_LAT, configuration.getPropertyDouble(GraticuleLayerType.PROPERTY_NAME_RES_LAT, GraticuleLayerType.DEFAULT_RES_LAT)); layerConfiguration.setValue(GraticuleLayerType.PROPERTY_NAME_RES_LON, configuration.getPropertyDouble(GraticuleLayerType.PROPERTY_NAME_RES_LON, GraticuleLayerType.DEFAULT_RES_LON)); GraticuleLayerType.DEFAULT_LINE_COLOR)); layerConfiguration.setValue(GraticuleLayerType.PROPERTY_NAME_LINE_WIDTH, configuration.getPropertyDouble(GraticuleLayerType.PROPERTY_NAME_LINE_WIDTH, GraticuleLayerType.DEFAULT_LINE_WIDTH)); layerConfiguration.setValue(GraticuleLayerType.PROPERTY_NAME_LINE_TRANSPARENCY, configuration.getPropertyDouble( GraticuleLayerType.PROPERTY_NAME_LINE_TRANSPARENCY, GraticuleLayerType.DEFAULT_LINE_TRANSPARENCY)); GraticuleLayerType.DEFAULT_TEXT_BG_COLOR)); layerConfiguration.setValue(GraticuleLayerType.PROPERTY_NAME_TEXT_BG_TRANSPARENCY, configuration.getPropertyDouble( GraticuleLayerType.PROPERTY_NAME_TEXT_BG_TRANSPARENCY, GraticuleLayerType.DEFAULT_TEXT_BG_TRANSPARENCY));
private void importMaskFromBmd(File file) { final PropertyMap propertyMap = new PropertyMap(); try { propertyMap.load(file); // Overwrite existing values final String name = propertyMap.getPropertyString("bitmaskName", "bitmask"); final String description = propertyMap.getPropertyString("bitmaskDesc", null); final String expression = propertyMap.getPropertyString("bitmaskExpr", ""); final Color color = propertyMap.getPropertyColor("bitmaskColor", Color.yellow); final float transparency = (float) propertyMap.getPropertyDouble("bitmaskTransparency", 0.5); final Product product = getMaskForm().getProduct(); product.addMask(name, expression, description, color, transparency); } catch (Exception e) { showErrorDialog(String.format("Failed to import mask(s): %s", e.getMessage())); } }
static void setBaseImageLayerStyle(PropertyMap configuration, Layer layer) { final boolean borderShown = configuration.getPropertyBool("image.border.shown", ImageLayer.DEFAULT_BORDER_SHOWN); final double borderWidth = configuration.getPropertyDouble("image.border.size", ImageLayer.DEFAULT_BORDER_WIDTH); final Color borderColor = configuration.getPropertyColor("image.border.color", ImageLayer.DEFAULT_BORDER_COLOR); final boolean pixelBorderShown = configuration.getPropertyBool("pixel.border.shown", ImageLayer.DEFAULT_PIXEL_BORDER_SHOWN); final double pixelBorderWidth = configuration.getPropertyDouble("pixel.border.size", ImageLayer.DEFAULT_PIXEL_BORDER_WIDTH); final Color pixelBorderColor = configuration.getPropertyColor("pixel.border.color", ImageLayer.DEFAULT_PIXEL_BORDER_COLOR); final PropertySet layerConfiguration = layer.getConfiguration(); layerConfiguration.setValue(ImageLayer.PROPERTY_NAME_BORDER_SHOWN, borderShown); layerConfiguration.setValue(ImageLayer.PROPERTY_NAME_BORDER_WIDTH, borderWidth); layerConfiguration.setValue(ImageLayer.PROPERTY_NAME_BORDER_COLOR, borderColor); layerConfiguration.setValue(ImageLayer.PROPERTY_NAME_PIXEL_BORDER_SHOWN, pixelBorderShown); layerConfiguration.setValue(ImageLayer.PROPERTY_NAME_PIXEL_BORDER_WIDTH, pixelBorderWidth); layerConfiguration.setValue(ImageLayer.PROPERTY_NAME_PIXEL_BORDER_COLOR, pixelBorderColor); }
private Layer createNoDataLayer() { final LayerType noDataType = LayerTypeRegistry.getLayerType(NoDataLayerType.class); final PropertySet configTemplate = noDataType.createLayerConfig(null); final Color color = configuration.getPropertyColor("noDataOverlay.color", Color.ORANGE); configTemplate.setValue(NoDataLayerType.PROPERTY_NAME_COLOR, color); configTemplate.setValue(NoDataLayerType.PROPERTY_NAME_RASTER, getRaster()); final Layer layer = noDataType.createLayer(this, configTemplate); final double transparency = configuration.getPropertyDouble("noDataOverlay.transparency", 0.3); layer.setTransparency(transparency); return layer; }
final ColorPaletteDef.Point point = new ColorPaletteDef.Point(); final Color color = propertyMap.getPropertyColor(_PROPERTY_KEY_COLOR + i); double sample = propertyMap.getPropertyDouble(_PROPERTY_KEY_SAMPLE + i); if (i > 0 && sample < lastSample) { sample = lastSample + 1.0;
protected Mask createNewMask(Mask.ImageType type) { final Product product = maskForm.getProduct(); final ProductNodeGroup<Mask> productNodeGroup = product.getMaskGroup(); String maskName = getNewMaskName(productNodeGroup); final Mask mask = new Mask(maskName, product.getSceneRasterWidth(), product.getSceneRasterHeight(), type); final VisatApp visatApp = VisatApp.getApp(); if(visatApp != null) { final PropertyMap preferences = visatApp.getPreferences(); mask.setImageColor(preferences.getPropertyColor("mask.color", Mask.ImageType.DEFAULT_COLOR)); mask.setImageTransparency(preferences.getPropertyDouble("mask.transparency", Mask.ImageType.DEFAULT_TRANSPARENCY)); } return mask; }