projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/telegps-v2.0: Disable external serial port to save ROM
[fw/altos]
/
altosuilib
/
AltosUIEnable.java
diff --git
a/altosuilib/AltosUIEnable.java
b/altosuilib/AltosUIEnable.java
index 368856110f20a9bc43954bd2514fd84d56b8a4ec..4c733b9601496f5d1b54b5d2c6ac021253a147ac 100644
(file)
--- a/
altosuilib/AltosUIEnable.java
+++ b/
altosuilib/AltosUIEnable.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,7
+16,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altosuilib_1;
+package org.altusmetrum.altosuilib_1
1
;
import java.awt.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.event.*;
@@
-23,7
+24,7
@@
import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
import java.util.*;
import java.io.*;
import java.util.concurrent.*;
import java.util.*;
-import org.altusmetrum.altoslib_
2
.*;
+import org.altusmetrum.altoslib_
11
.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
@@
-37,15
+38,22
@@
import org.jfree.data.*;
public class AltosUIEnable extends Container {
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;
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;
class GraphElement implements ActionListener {
AltosUIGrapher grapher;
- J
RadioButton
enable;
+ J
CheckBox
enable;
String name;
public void actionPerformed(ActionEvent ae) {
String name;
public void actionPerformed(ActionEvent ae) {
@@
-55,8
+63,8
@@
public class AltosUIEnable extends Container {
GraphElement (String name, AltosUIGrapher grapher, boolean enabled) {
this.name = name;
this.grapher = grapher;
GraphElement (String name, AltosUIGrapher grapher, boolean enabled) {
this.name = name;
this.grapher = grapher;
- enable = new J
RadioButton
(name, enabled);
- grapher.set_enable(enabled);
+ enable = new J
CheckBox
(name, enabled);
+ grapher.set_enable(enabled);
enable.addActionListener(this);
}
}
enable.addActionListener(this);
}
}
@@
-86,10
+94,10
@@
public class AltosUIEnable extends Container {
/* Imperial units setting */
/* Add label */
/* Imperial units setting */
/* Add label */
-
JRadioButton imperial_units = new JRadioButton
("Imperial Units", AltosUIPreferences.imperial_units());
+
imperial_units = new JCheckBox
("Imperial Units", AltosUIPreferences.imperial_units());
imperial_units.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
imperial_units.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- J
RadioButton item = (JRadioButton
) e.getSource();
+ J
CheckBox item = (JCheckBox
) e.getSource();
boolean enabled = item.isSelected();
AltosUIPreferences.set_imperial_units(enabled);
}
boolean enabled = item.isSelected();
AltosUIPreferences.set_imperial_units(enabled);
}