projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: Rewrite info table to mix with scroll pane well. Fix startup size
[fw/altos]
/
ao-tools
/
altosui
/
AltosFlightUI.java
diff --git
a/ao-tools/altosui/AltosFlightUI.java
b/ao-tools/altosui/AltosFlightUI.java
index ac88aa152ba661467e4dac8447e71953d0ce259f..d5bcdb104d8f63a00224259155fe6fc67cf8a046 100644
(file)
--- a/
ao-tools/altosui/AltosFlightUI.java
+++ b/
ao-tools/altosui/AltosFlightUI.java
@@
-44,7
+44,6
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
AltosLanded landed;
private AltosFlightStatus flightStatus;
AltosLanded landed;
private AltosFlightStatus flightStatus;
- private JScrollPane flightInfoPane;
private AltosInfoTable flightInfo;
static final int tab_pad = 1;
private AltosInfoTable flightInfo;
static final int tab_pad = 1;
@@
-66,14
+65,6
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
return tab_landed;
}
return tab_landed;
}
- public int width() {
- return flightInfo.width();
- }
-
- public int height() {
- return flightStatus.height() + flightInfo.height();
- }
-
void stop_display() {
if (thread != null && thread.isAlive()) {
thread.interrupt();
void stop_display() {
if (thread != null && thread.isAlive()) {
thread.interrupt();
@@
-146,6
+137,7
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
setTitle(String.format("AltOS %s", reader.name));
setTitle(String.format("AltOS %s", reader.name));
+ /* Stick channel selector at top of table for telemetry monitoring */
if (serial >= 0) {
// Channel menu
channels = new AltosChannelMenu(AltosPreferences.channel(serial));
if (serial >= 0) {
// Channel menu
channels = new AltosChannelMenu(AltosPreferences.channel(serial));
@@
-162,6
+154,7
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
bag.add (channels, c);
}
bag.add (channels, c);
}
+ /* Flight status is always visible */
flightStatus = new AltosFlightStatus();
c.gridx = 0;
c.gridy = 1;
flightStatus = new AltosFlightStatus();
c.gridx = 0;
c.gridy = 1;
@@
-169,6
+162,9
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
c.weightx = 1;
bag.add(flightStatus, c);
c.weightx = 1;
bag.add(flightStatus, c);
+ /* The rest of the window uses a tabbed pane to
+ * show one of the alternate data views
+ */
pane = new JTabbedPane();
pad = new AltosPad();
pane = new JTabbedPane();
pad = new AltosPad();
@@
-184,9
+180,9
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
pane.add("Landed", landed);
flightInfo = new AltosInfoTable();
pane.add("Landed", landed);
flightInfo = new AltosInfoTable();
- flightInfoPane = new JScrollPane(flightInfo.box());
- pane.add("Table", flightInfoPane);
+ pane.add("Table", new JScrollPane(flightInfo));
+ /* Make the tabbed pane use the rest of the window space */
c.gridx = 0;
c.gridy = 2;
c.fill = GridBagConstraints.BOTH;
c.gridx = 0;
c.gridy = 2;
c.fill = GridBagConstraints.BOTH;
@@
-194,9
+190,6
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
c.weighty = 1;
bag.add(pane, c);
c.weighty = 1;
bag.add(pane, c);
- this.setSize(this.getPreferredSize());
- this.validate();
-
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
@@
-209,7
+202,8
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
}
});
}
});
- this.setVisible(true);
+ pack();
+ setVisible(true);
thread = new AltosDisplayThread(this, voice, this, reader);
thread = new AltosDisplayThread(this, voice, this, reader);