|
@@ -48,10 +48,10 @@ public final class PreferencesDialog implements PreferencesInterface {
|
48
|
48
|
* structure is changed (or anything else that would prevent serialized
|
49
|
49
|
* objects being unserialized with the new class).
|
50
|
50
|
*/
|
51
|
|
- private static final long serialVersionUID = 7;
|
|
51
|
+ private static final long serialVersionUID = 8;
|
52
|
52
|
|
53
|
53
|
/** A previously created instance of PreferencesDialog. */
|
54
|
|
- private static PreferencesDialog me;
|
|
54
|
+ private static PreferencesDialog me = new PreferencesDialog();
|
55
|
55
|
|
56
|
56
|
/** preferences panel. */
|
57
|
57
|
private SwingPreferencesPanel preferencesPanel;
|
|
@@ -66,12 +66,11 @@ public final class PreferencesDialog implements PreferencesInterface {
|
66
|
66
|
}
|
67
|
67
|
|
68
|
68
|
/** Creates the dialog if one doesn't exist, and displays it. */
|
69
|
|
- public static synchronized void showPreferencesDialog() {
|
70
|
|
- if (me == null) {
|
71
|
|
- me = new PreferencesDialog();
|
|
69
|
+ public static void showPreferencesDialog() {
|
|
70
|
+ synchronized (me) {
|
|
71
|
+ me.initComponents();
|
|
72
|
+ me.preferencesPanel.requestFocus();
|
72
|
73
|
}
|
73
|
|
- me.initComponents();
|
74
|
|
- me.preferencesPanel.requestFocus();
|
75
|
74
|
}
|
76
|
75
|
|
77
|
76
|
/**
|
|
@@ -241,12 +240,17 @@ public final class PreferencesDialog implements PreferencesInterface {
|
241
|
240
|
*/
|
242
|
241
|
private void initGUITab() {
|
243
|
242
|
final LookAndFeelInfo[] plaf = UIManager.getInstalledLookAndFeels();
|
|
243
|
+ final String sysLafClass = UIManager.getSystemLookAndFeelClassName();
|
244
|
244
|
final String[] lafs = new String[plaf.length];
|
245
|
245
|
final String tabName = "GUI";
|
|
246
|
+ String sysLafName = "";
|
246
|
247
|
|
247
|
248
|
int i = 0;
|
248
|
249
|
for (LookAndFeelInfo laf : plaf) {
|
249
|
250
|
lafs[i++] = laf.getName();
|
|
251
|
+ if (laf.getClassName().equals(sysLafClass)) {
|
|
252
|
+ sysLafName = laf.getName();
|
|
253
|
+ }
|
250
|
254
|
}
|
251
|
255
|
|
252
|
256
|
preferencesPanel.addCategory(tabName, "");
|
|
@@ -272,7 +276,7 @@ public final class PreferencesDialog implements PreferencesInterface {
|
272
|
276
|
Config.getOptionBool("general", "showcolourdialog"));
|
273
|
277
|
preferencesPanel.addComboboxOption(tabName, "ui.lookandfeel",
|
274
|
278
|
"Look and feel: ", "The Java Look and Feel to use", lafs,
|
275
|
|
- Config.getOption("ui", "lookandfeel"), false);
|
|
279
|
+ Config.getOption("ui", "lookandfeel", sysLafName), false);
|
276
|
280
|
preferencesPanel.addCheckboxOption(tabName, "ui.antialias",
|
277
|
281
|
"System anti-alias: ", "Anti-alias all fonts",
|
278
|
282
|
Config.getOptionBool("ui", "antialias"));
|