diff options
author | Keith Packard <keithp@keithp.com> | 2010-11-13 17:09:51 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-11-13 17:09:51 -0800 |
commit | 11c95f687b1f68d35fa1a0af2c4e7982b8bb226a (patch) | |
tree | e61f8631782eebbdd42060a7bc16f1fd9b10c447 /ao-tools/altosui/AltosAscent.java | |
parent | dcfa56498d1b65a213b8aba9cbd6c4806532383c (diff) |
altosui: Replace flight status table with labels, fix resize.
There's no reason to use a table for the flight status data,
replace that with a selection of widgets instead.
Also, set all of the grid bag constraints for the various flight
status displays so that resize does something sensible.
Adds a scrollbar to the table display so that it can shrink.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosAscent.java')
-rw-r--r-- | ao-tools/altosui/AltosAscent.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ao-tools/altosui/AltosAscent.java b/ao-tools/altosui/AltosAscent.java index 51fa1a89..7525b655 100644 --- a/ao-tools/altosui/AltosAscent.java +++ b/ao-tools/altosui/AltosAscent.java @@ -43,6 +43,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { } public AscentValue (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); + c.weighty = 1; label = new JLabel(text); label.setFont(label_font); @@ -50,6 +51,8 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { c.gridx = 0; c.gridy = y; c.insets = new Insets(10, 10, 10, 10); c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.VERTICAL; + c.weightx = 0; layout.setConstraints(label, c); add(label); @@ -58,8 +61,9 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { value.setHorizontalAlignment(SwingConstants.RIGHT); c.gridx = 1; c.gridy = y; c.anchor = GridBagConstraints.WEST; - c.fill = GridBagConstraints.HORIZONTAL; + c.fill = GridBagConstraints.BOTH; c.gridwidth = 2; + c.weightx = 1; layout.setConstraints(value, c); add(value); } @@ -88,6 +92,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { } public AscentValueHold (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); + c.weighty = 1; label = new JLabel(text); label.setFont(label_font); @@ -95,6 +100,8 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { c.gridx = 0; c.gridy = y; c.insets = new Insets(10, 10, 10, 10); c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.VERTICAL; + c.weightx = 0; layout.setConstraints(label, c); add(label); @@ -103,6 +110,8 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { value.setHorizontalAlignment(SwingConstants.RIGHT); c.gridx = 1; c.gridy = y; c.anchor = GridBagConstraints.EAST; + c.fill = GridBagConstraints.BOTH; + c.weightx = 1; layout.setConstraints(value, c); add(value); @@ -111,6 +120,8 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { max_value.setHorizontalAlignment(SwingConstants.RIGHT); c.gridx = 2; c.gridy = y; c.anchor = GridBagConstraints.EAST; + c.fill = GridBagConstraints.BOTH; + c.weightx = 1; layout.setConstraints(max_value, c); add(max_value); } |