Author: tchemit Date: 2010-04-14 14:48:17 +0200 (Wed, 14 Apr 2010) New Revision: 1839 Log: fix new ApplicationConfig api Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java 2010-04-14 12:43:46 UTC (rev 1838) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java 2010-04-14 12:48:17 UTC (rev 1839) @@ -67,30 +67,6 @@ public static final String PROPERTY_FULLSCREEN = "fullscreen"; public static final String PROPERTY_LOCALE = "locale"; public static final String PROPERTY_FONT_SIZE = "fontSize"; -// public static final String ADJUSTING_PROPERTY = "adjusting"; -// -// /** -// * un drapeau pour bloquer la sauvegarde lors de la modification en -// * masse des options via les setter. -// */ -// protected boolean adjusting; -// protected final PropertyChangeListener saveAction = -// new PropertyChangeListener() { -// -// @Override -// public void propertyChange(PropertyChangeEvent evt) { -// if (adjusting) { -// if (log.isDebugEnabled()) { -// log.debug("skip save while adjusting"); -// } -// return; -// } -// if (log.isDebugEnabled()) { -// log.debug("Saving configuration at " + new Date()); -// } -// saveForUser(); -// } -// }; public DemoConfig() { @@ -129,26 +105,12 @@ installSaveUserAction(PROPERTY_FULLSCREEN, PROPERTY_FONT_SIZE, PROPERTY_LOCALE); -// adjusting = true; -// addPropertyChangeListener(PROPERTY_FULLSCREEN, saveAction); -// addPropertyChangeListener(PROPERTY_FONT_SIZE, saveAction); -// addPropertyChangeListener(PROPERTY_LOCALE, saveAction); -// adjusting = false; } public String getCopyrightText() { return "Version " + getVersion() + " Codelutin @ 2008-2009"; } - @Override - public void setOption(String key, String value) { - if (key.equals(ADJUSTING_PROPERTY)) { - setAdjusting(Boolean.valueOf(value)); - return; - } - super.setOption(key, value); - } - /** * @return la version de l'application. */ @@ -180,13 +142,11 @@ public void setFullscreen(boolean fullscreen) { Object oldValue = null; setOption(Option.FULL_SCREEN.key, fullscreen + ""); -// saveForUser(); firePropertyChange(PROPERTY_FULLSCREEN, oldValue, fullscreen); } public void setLocale(Locale newLocale) { setOption(Option.LOCALE.key, newLocale.toString()); -// saveForUser(); firePropertyChange(PROPERTY_LOCALE, null, newLocale); } @@ -196,22 +156,8 @@ log.debug("changing font-size to " + newFontSize); } setOption(Option.FONT_SIZE.key, newFontSize.toString()); -// saveForUser(); firePropertyChange(PROPERTY_FONT_SIZE, oldValue, newFontSize); } -// -// public boolean isAdjusting() { -// return adjusting; -// } -// -// public void setAdjusting(boolean adjusting) { -// if (log.isDebugEnabled()) { -// log.debug("changing adjusting to " + adjusting); -// } -// boolean oldValue = this.adjusting; -// this.adjusting = adjusting; -// firePropertyChange(ADJUSTING_PROPERTY, oldValue, adjusting); -// } /** * Save configuration, in user home directory using the @@ -296,7 +242,12 @@ public boolean _transient; public boolean _final; - Option(String key, String description, String defaultValue, Class<?> type, boolean _transient, boolean _final) { + Option(String key, + String description, + String defaultValue, + Class<?> type, + boolean _transient, + boolean _final) { this.key = key; this.description = description; this.defaultValue = defaultValue;