* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package AltosUI;
+package altosui;
import java.io.*;
import java.util.*;
}
}
public static int font_size() {
- return font_size;
+ synchronized (preferences) {
+ return font_size;
+ }
}
static void set_fonts() {
}
public static void set_font_size(int new_font_size) {
- font_size = new_font_size;
synchronized (preferences) {
+ font_size = new_font_size;
preferences.putInt(fontSizePreference, font_size);
flush_preferences();
Altos.set_fonts(font_size);
}
public static void set_look_and_feel(String new_look_and_feel) {
- look_and_feel = new_look_and_feel;
try {
- UIManager.setLookAndFeel(look_and_feel);
+ UIManager.setLookAndFeel(new_look_and_feel);
} catch (Exception e) {
}
synchronized(preferences) {
+ look_and_feel = new_look_and_feel;
preferences.put(lookAndFeelPreference, look_and_feel);
flush_preferences();
for (AltosUIListener l : ui_listeners)
}
public static String look_and_feel() {
- return look_and_feel;
+ synchronized (preferences) {
+ return look_and_feel;
+ }
}
public static void register_ui_listener(AltosUIListener l) {
}
}
public static void set_serial_debug(boolean new_serial_debug) {
- serial_debug = new_serial_debug;
- AltosLink.set_debug(serial_debug);
+ AltosLink.set_debug(new_serial_debug);
synchronized (preferences) {
+ serial_debug = new_serial_debug;
preferences.putBoolean(serialDebugPreference, serial_debug);
flush_preferences();
}
}
public static boolean serial_debug() {
- return serial_debug;
+ synchronized (preferences) {
+ return serial_debug;
+ }
}
}
\ No newline at end of file