projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make sure to use Google Maps API key for official builds
[fw/altos]
/
altosuilib
/
AltosUIConfigure.java
diff --git
a/altosuilib/AltosUIConfigure.java
b/altosuilib/AltosUIConfigure.java
index 6c9a841e9a294e1eec33a1c64d37ac67385a5a64..920ed8e287a10c126c930cc3f41a2ac3376e1e9e 100644
(file)
--- a/
altosuilib/AltosUIConfigure.java
+++ b/
altosuilib/AltosUIConfigure.java
@@
-15,7
+15,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;
+package org.altusmetrum.altosuilib
_2
;
import java.awt.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.event.*;
@@
-23,10
+23,10
@@
import java.beans.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.*;
import javax.swing.event.*;
-class DelegatingRenderer implements ListCellRenderer {
+class DelegatingRenderer implements ListCellRenderer
<Object>
{
// ...
// ...
- public static void install(JComboBox comboBox) {
+ public static void install(JComboBox
<Object>
comboBox) {
DelegatingRenderer renderer = new DelegatingRenderer(comboBox);
renderer.initialise();
comboBox.setRenderer(renderer);
DelegatingRenderer renderer = new DelegatingRenderer(comboBox);
renderer.initialise();
comboBox.setRenderer(renderer);
@@
-36,7
+36,7
@@
class DelegatingRenderer implements ListCellRenderer {
private final JComboBox comboBox;
// ...
private final JComboBox comboBox;
// ...
- private ListCellRenderer delegate;
+ private ListCellRenderer
<? super Object>
delegate;
// ...
private DelegatingRenderer(JComboBox comboBox) {
// ...
private DelegatingRenderer(JComboBox comboBox) {
@@
-45,21
+45,22
@@
class DelegatingRenderer implements ListCellRenderer {
// ...
private void initialise() {
// ...
private void initialise() {
- delegate = new JComboBox().getRenderer();
+ JComboBox<Object> c = new JComboBox<Object>();
+ delegate = c.getRenderer();
comboBox.addPropertyChangeListener("UI", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
comboBox.addPropertyChangeListener("UI", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
- delegate = new JComboBox().getRenderer();
+ delegate = new JComboBox
<Object>
().getRenderer();
}
});
}
// ...
}
});
}
// ...
- public Component getListCellRendererComponent(JList list,
+ public Component getListCellRendererComponent(JList
<?>
list,
Object value, int index, boolean isSelected, boolean cellHasFocus) {
return delegate.getListCellRendererComponent(list,
Object value, int index, boolean isSelected, boolean cellHasFocus) {
return delegate.getListCellRendererComponent(list,
- ((UIManager.LookAndFeelInfo)
value).getName(),
+ ((UIManager.LookAndFeelInfo)value).getName(),
index, isSelected, cellHasFocus);
}
}
index, isSelected, cellHasFocus);
}
}
@@
-139,7
+140,7
@@
public class AltosUIConfigure
/* Font size setting */
pane.add(new JLabel("Font size"), constraints(0, 1));
/* Font size setting */
pane.add(new JLabel("Font size"), constraints(0, 1));
- final JComboBox
font_size_value = new JComboBox
(font_size_names);
+ final JComboBox
<String> font_size_value = new JComboBox<String>
(font_size_names);
int font_size = AltosUIPreferences.font_size();
font_size_value.setSelectedIndex(font_size - AltosUILib.font_size_small);
font_size_value.addActionListener(new ActionListener() {
int font_size = AltosUIPreferences.font_size();
font_size_value.setSelectedIndex(font_size - AltosUILib.font_size_small);
font_size_value.addActionListener(new ActionListener() {
@@
-181,7
+182,7
@@
public class AltosUIConfigure
final UIManager.LookAndFeelInfo[] look_and_feels = UIManager.getInstalledLookAndFeels();
final UIManager.LookAndFeelInfo[] look_and_feels = UIManager.getInstalledLookAndFeels();
- final JComboBox
look_and_feel_value = new JComboBox
(look_and_feels);
+ final JComboBox
<Object> look_and_feel_value = new JComboBox<Object>
(look_and_feels);
DelegatingRenderer.install(look_and_feel_value);
DelegatingRenderer.install(look_and_feel_value);
@@
-202,9
+203,10
@@
public class AltosUIConfigure
row++;
}
row++;
}
- public void add_
serial_debug
() {
- GridBagConstraints c = new GridBagConstraints();
+ public void add_
position
() {
+ }
+ public void add_serial_debug() {
/* Serial debug setting */
pane.add(new JLabel("Serial Debug"), constraints(0, 1));
/* Serial debug setting */
pane.add(new JLabel("Serial Debug"), constraints(0, 1));
@@
-217,12
+219,8
@@
public class AltosUIConfigure
}
});
serial_debug.setToolTipText("Enable/Disable USB I/O getting sent to the console");
}
});
serial_debug.setToolTipText("Enable/Disable USB I/O getting sent to the console");
- c.gridx = 1;
- c.gridy = row++;
- c.gridwidth = 3;
- c.fill = GridBagConstraints.NONE;
- c.anchor = GridBagConstraints.WEST;
- pane.add(serial_debug, c);
+ pane.add(serial_debug, constraints(1,2));
+ row++;
}
public void add_bluetooth() {
}
public void add_bluetooth() {
@@
-231,8
+229,8
@@
public class AltosUIConfigure
public void add_frequencies() {
}
public void add_frequencies() {
}
- public AltosUIConfigure(JFrame in_owner) {
- super(in_owner,
"Configure AltosUI"
, false);
+ public AltosUIConfigure(JFrame in_owner
, String name, String label
) {
+ super(in_owner,
name
, false);
owner = in_owner;
pane = getContentPane();
owner = in_owner;
pane = getContentPane();
@@
-241,7
+239,7
@@
public class AltosUIConfigure
row = 0;
/* Nice label at the top */
row = 0;
/* Nice label at the top */
- pane.add(new JLabel (
"Configure AltOS UI"
),
+ pane.add(new JLabel (
label
),
constraints(0, 3));
row++;
constraints(0, 3));
row++;
@@
-253,8
+251,10
@@
public class AltosUIConfigure
add_log_dir();
add_callsign();
add_units();
add_log_dir();
add_callsign();
add_units();
+ add_serial_debug();
add_font_size();
add_look_and_feel();
add_font_size();
add_look_and_feel();
+ add_position();
add_bluetooth();
add_frequencies();
add_bluetooth();
add_frequencies();
@@
-271,4
+271,8
@@
public class AltosUIConfigure
setLocationRelativeTo(owner);
setVisible(true);
}
setLocationRelativeTo(owner);
setVisible(true);
}
+
+ public AltosUIConfigure(JFrame in_owner) {
+ this(in_owner, "Configure AltosUI", "Configure AltOS UI");
+ }
}
}