diff options
author | Mike Beattie <mike@ethernal.org> | 2012-09-14 00:25:49 +1200 |
---|---|---|
committer | Mike Beattie <mike@ethernal.org> | 2012-09-14 17:51:18 +1200 |
commit | ec036e8fe057f4b641ba9ee17d6dce2689816047 (patch) | |
tree | 990ffedc2e714c8d4f83c1b6dc6be3f1d782a9af /altosui/AltosUIPreferences.java | |
parent | 0ef8b7148784ed5bcbea21dde313fb02f50ef734 (diff) |
altoslib/altosui: begin moving preferences "backend" into interface
Signed-off-by: Mike Beattie <mike@ethernal.org>
Diffstat (limited to 'altosui/AltosUIPreferences.java')
-rw-r--r-- | altosui/AltosUIPreferences.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/altosui/AltosUIPreferences.java b/altosui/AltosUIPreferences.java index a026d123..03e8e129 100644 --- a/altosui/AltosUIPreferences.java +++ b/altosui/AltosUIPreferences.java @@ -48,12 +48,12 @@ public class AltosUIPreferences extends AltosPreferences { public static void init() { font_listeners = new LinkedList<AltosFontListener>(); - font_size = preferences.getInt(fontSizePreference, Altos.font_size_medium); + font_size = backend.getInt(fontSizePreference, Altos.font_size_medium); Altos.set_fonts(font_size); - look_and_feel = preferences.get(lookAndFeelPreference, UIManager.getSystemLookAndFeelClassName()); + look_and_feel = backend.getString(lookAndFeelPreference, UIManager.getSystemLookAndFeelClassName()); ui_listeners = new LinkedList<AltosUIListener>(); - serial_debug = preferences.getBoolean(serialDebugPreference, false); + serial_debug = backend.getBoolean(serialDebugPreference, false); AltosLink.set_debug(serial_debug); } @@ -107,9 +107,9 @@ public class AltosUIPreferences extends AltosPreferences { } public static void set_font_size(int new_font_size) { - synchronized (preferences) { + synchronized (backend) { font_size = new_font_size; - preferences.putInt(fontSizePreference, font_size); + backend.putInt(fontSizePreference, font_size); flush_preferences(); Altos.set_fonts(font_size); for (AltosFontListener l : font_listeners) @@ -118,13 +118,13 @@ public class AltosUIPreferences extends AltosPreferences { } public static void register_font_listener(AltosFontListener l) { - synchronized (preferences) { + synchronized (backend) { font_listeners.add(l); } } public static void unregister_font_listener(AltosFontListener l) { - synchronized (preferences) { + synchronized (backend) { font_listeners.remove(l); } } @@ -134,9 +134,9 @@ public class AltosUIPreferences extends AltosPreferences { UIManager.setLookAndFeel(new_look_and_feel); } catch (Exception e) { } - synchronized(preferences) { + synchronized(backend) { look_and_feel = new_look_and_feel; - preferences.put(lookAndFeelPreference, look_and_feel); + backend.putString(lookAndFeelPreference, look_and_feel); flush_preferences(); for (AltosUIListener l : ui_listeners) l.ui_changed(look_and_feel); @@ -150,21 +150,21 @@ public class AltosUIPreferences extends AltosPreferences { } public static void register_ui_listener(AltosUIListener l) { - synchronized(preferences) { + synchronized(backend) { ui_listeners.add(l); } } public static void unregister_ui_listener(AltosUIListener l) { - synchronized (preferences) { + synchronized (backend) { ui_listeners.remove(l); } } public static void set_serial_debug(boolean new_serial_debug) { - AltosLink.set_debug(new_serial_debug); - synchronized (preferences) { + AltosLink.set_debug(serial_debug); + synchronized (backend) { serial_debug = new_serial_debug; - preferences.putBoolean(serialDebugPreference, serial_debug); + backend.putBoolean(serialDebugPreference, serial_debug); flush_preferences(); } } @@ -175,4 +175,4 @@ public class AltosUIPreferences extends AltosPreferences { } } -}
\ No newline at end of file +} |