protected final void loadPreferences() { if (preferencesFile == null) { return; } // Note, at this point the logging file is still not open! try { getPreferences().load(preferencesFile); } catch (IOException ignored) { logger.warning("Failed to load user preferences from " + preferencesFile); logger.warning("Using application default values..."); } }
private PropertyMap loadPropertyMap() { final File propertiesFile = getPropertiesFile(); if (!propertiesFile.exists()) { try { propertiesFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } final PropertyMap propertyMap = new PropertyMap(); try { propertyMap.load(propertiesFile); } catch (IOException e) { e.printStackTrace(); } return propertyMap; }
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())); } }
propertyMap.load(file); // Overwrite existing values final int numPoints = propertyMap.getPropertyInt(_PROPERTY_KEY_NUM_POINTS); if (numPoints < 2) {