/** * Sets the window bounds of the ProductGrabber dialog. * * @param windowBounds the window bounds. */ public void setWindowBounds(final Rectangle windowBounds) { _properties.setPropertyInt(WINDOW_LOCATION_X_KEY, windowBounds.x); _properties.setPropertyInt(WINDOW_LOCATION_Y_KEY, windowBounds.y); _properties.setPropertyInt(WINDOW_WIDTH_KEY, windowBounds.width); _properties.setPropertyInt(WINDOW_HEIGHT_KEY, windowBounds.height); }
/** * Sets a value of type <code>int</code>. * * @param key the key * @param newValue the new value * * @throws IllegalArgumentException */ public void setPropertyInt(String key, int newValue) { setPropertyInt(key, new Integer(newValue)); }
public void copyInto(PropertyMap propertyMap) { propertyMap.setPropertyInt(getLengthKey(), _maxNumEntries); for (int i = 0; i < 100; i++) { propertyMap.setPropertyString(getNumKey(i), null); } final String[] entries = getEntries(); if (entries != null) { for (int i = 0; i < entries.length; i++) { propertyMap.setPropertyString(getNumKey(i), entries[i]); } } }
protected final void setPreferences() { ////////////////////////////////////////////////////////////// // Store file history fileHistory.copyInto(getPreferences()); ////////////////////////////////////////////////////////////// // Store frame properties getPreferences().setPropertyInt("frame.location.x", getMainFrame().getLocation().x); getPreferences().setPropertyInt("frame.location.y", getMainFrame().getLocation().y); getPreferences().setPropertyInt("frame.size.width", getMainFrame().getSize().width); getPreferences().setPropertyInt("frame.size.height", getMainFrame().getSize().height); getPreferences().setPropertyBool("frame.ui.dblbuf", RepaintManager.currentManager(getMainFrame()).isDoubleBufferingEnabled()); ////////////////////////////////////////////////////////////// getPreferences().setPropertyBool(PROPERTY_KEY_APP_DEBUG_ENABLED, debugEnabled); }
private void initPreferences() { preferences = new PropertyMap(); preferences.setPropertyBool(PROPERTY_KEY_APP_DEBUG_ENABLED, false); preferences.setPropertyString(PROPERTY_KEY_APP_UI_FONT_NAME, "SansSerif"); preferences.setPropertyInt(PROPERTY_KEY_APP_UI_FONT_SIZE, 12); preferences.setPropertyBool(PROPERTY_KEY_APP_LOG_ENABLED, false); preferences.setPropertyString(PROPERTY_KEY_APP_LOG_PREFIX, getAppName()); preferences.setPropertyString(PROPERTY_KEY_APP_LOG_LEVEL, SystemUtils.LLS_INFO); preferences.setPropertyBool(PROPERTY_KEY_APP_LOG_ECHO, false); preferencesFile = new File(appUserDir, "preferences.properties"); loadPreferences(); suppressibleOptionPane = new SuppressibleOptionPane(getPreferences()); }
/** * Stores this color palette definition in the given file * * @param colorPaletteDef thje color palette definition * @param file the file * * @throws IOException if an I/O error occurs */ public static void storeColorPaletteDef(ColorPaletteDef colorPaletteDef, File file) throws IOException { final ColorPaletteDef.Point[] points = colorPaletteDef.getPoints(); final PropertyMap propertyMap = new PropertyMap(); final int numPoints = points.length; propertyMap.setPropertyInt(_PROPERTY_KEY_NUM_POINTS, numPoints); propertyMap.setPropertyBool(_PROPERTY_KEY_AUTODISTRIBUTE, colorPaletteDef.isAutoDistribute()); for (int i = 0; i < numPoints; i++) { propertyMap.setPropertyColor(_PROPERTY_KEY_COLOR + i, points[i].getColor()); propertyMap.setPropertyDouble(_PROPERTY_KEY_SAMPLE + i, points[i].getSample()); } propertyMap.store(file, "BEAM Colour Palette Definition File"); /*I18N*/ }
public static void transferConnectionData(ConnectionConfigData connectionConfigData, PropertyMap propertyMap) { ProxyConfig proxyConfig = connectionConfigData.getProxyConfig(); propertyMap.setPropertyBool(KEY_BEAM_REPOSITORY_PROXY_USED, connectionConfigData.isProxyUsed()); propertyMap.setPropertyString(KEY_BEAM_REPOSITORY_PROXY_HOST, proxyConfig.getHost()); propertyMap.setPropertyInt(KEY_BEAM_REPOSITORY_PROXY_PORT, proxyConfig.getPort()); propertyMap.setPropertyBool(KEY_BEAM_REPOSITORY_PROXY_AUTH_USED, proxyConfig.isAuthorizationUsed()); propertyMap.setPropertyString(KEY_BEAM_REPOSITORY_PROXY_USERNAME, proxyConfig.getUsername()); propertyMap.setPropertyString(KEY_BEAM_REPOSITORY_PROXY_PASSWORD, proxyConfig.getScrambledPassword()); }
/** * Tests functionality of set and getPropertyInt */ public void testSetGetPropertyInt() { PropertyMap prop = new PropertyMap(); // "a" is not in the set assertEquals(0, prop.getPropertyInt("a")); // test default assertEquals(8, prop.getPropertyInt("a", 8)); assertEquals(null, prop.getPropertyInt("a", null)); assertEquals(new Integer(8), prop.getPropertyInt("a", new Integer(8))); // "b" is in the set and 23 prop.setPropertyInt("b", 23); assertEquals(23, prop.getPropertyInt("b")); assertEquals(23, prop.getPropertyInt("b", 43)); assertEquals(new Integer(23), prop.getPropertyInt("b", new Integer(43))); assertEquals(new Integer(23), prop.getPropertyInt("b", null)); }
final String propertyKey = "recent.files."; final PropertyMap properties = new PropertyMap(); properties.setPropertyInt(propertyKey + ".length", 3); properties.setPropertyString(propertyKey + ".0", _a.getAbsolutePath()); properties.setPropertyString(propertyKey + ".1", _b.getAbsolutePath());
public void testFail() { final String propertyKey = "test.prop"; final PropertyMap properties = new PropertyMap(); properties.setPropertyInt(propertyKey + ".length", 4); properties.setPropertyString(propertyKey + ".0", "0"); properties.setPropertyString(propertyKey + ".1", "1");