summaryrefslogtreecommitdiff
path: root/altosui/AltosIdleMonitorUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-11-11 22:24:22 -0800
committerKeith Packard <keithp@keithp.com>2011-11-11 22:24:22 -0800
commit7ecde50fbebe68a2e2200a2f8d081fd37074f840 (patch)
tree63f2baf059ea416815c4bc3e6e48852c42eda8e6 /altosui/AltosIdleMonitorUI.java
parent713bd503902526c17a7657c18be947ef8fa6a47a (diff)
altosui: Make UI Look&Feel configurable
Saves the preferred style and uses that for all current and new windows. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosIdleMonitorUI.java')
-rw-r--r--altosui/AltosIdleMonitorUI.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java
index 988a797c..a5f41e25 100644
--- a/altosui/AltosIdleMonitorUI.java
+++ b/altosui/AltosIdleMonitorUI.java
@@ -255,7 +255,7 @@ class AltosIdleMonitor extends Thread {
}
}
-public class AltosIdleMonitorUI extends JFrame implements AltosFlightDisplay {
+public class AltosIdleMonitorUI extends AltosFrame implements AltosFlightDisplay, AltosFontListener {
AltosDevice device;
JTabbedPane pane;
AltosPad pad;
@@ -289,6 +289,10 @@ public class AltosIdleMonitorUI extends JFrame implements AltosFlightDisplay {
flightInfo.set_font();
}
+ public void font_size_changed(int font_size) {
+ set_font();
+ }
+
public void show(AltosState state, int crc_errors) {
try {
pad.show(state, crc_errors);
@@ -377,12 +381,16 @@ public class AltosIdleMonitorUI extends JFrame implements AltosFlightDisplay {
bag.add(pane, c);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+
+ AltosPreferences.register_font_listener(this);
+
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
disconnect();
setVisible(false);
dispose();
+ AltosPreferences.unregister_font_listener(AltosIdleMonitorUI.this);
}
});