diff options
author | Keith Packard <keithp@keithp.com> | 2014-10-04 00:10:03 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-10-04 00:10:03 -0700 |
commit | a757fd5af53f5721a949181372548afa4757d6c9 (patch) | |
tree | ebd63f1a395eb4ff08f3e9bdc27796931430bb4c /altosuilib/AltosUIEnable.java | |
parent | 656d8fe17532ca6c7d1d43996f187df2f14f5395 (diff) |
altosui: Update 'Imperial Units' checkbox when units change
If you have two graphs running, make sure the imperial units
checkboxes agree.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUIEnable.java')
-rw-r--r-- | altosuilib/AltosUIEnable.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/altosuilib/AltosUIEnable.java b/altosuilib/AltosUIEnable.java index e227d2b7..c1e4967e 100644 --- a/altosuilib/AltosUIEnable.java +++ b/altosuilib/AltosUIEnable.java @@ -37,12 +37,19 @@ import org.jfree.data.*; public class AltosUIEnable extends Container { - Insets il, ir; - int y; - int x; + Insets il, ir; + int y; + int x; + JCheckBox imperial_units; static final int max_rows = 14; + public void units_changed(boolean imperial_units) { + if (this.imperial_units != null) { + this.imperial_units.setSelected(imperial_units); + } + } + class GraphElement implements ActionListener { AltosUIGrapher grapher; JCheckBox enable; @@ -86,7 +93,7 @@ public class AltosUIEnable extends Container { /* Imperial units setting */ /* Add label */ - JCheckBox imperial_units = new JCheckBox("Imperial Units", AltosUIPreferences.imperial_units()); + imperial_units = new JCheckBox("Imperial Units", AltosUIPreferences.imperial_units()); imperial_units.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JCheckBox item = (JCheckBox) e.getSource(); |