import libaltosJNI.*;
-public class AltosUI extends JFrame {
+public class AltosUI extends AltosFrame {
public AltosVoice voice = new AltosVoice();
public static boolean load_library(Frame frame) {
new AltosFlightUI(voice, reader, device.getSerial());
} catch (FileNotFoundException ee) {
JOptionPane.showMessageDialog(AltosUI.this,
- String.format("Cannot open device \"%s\"",
- device.toShortString()),
+ ee.getMessage(),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} catch (AltosSerialInUseException si) {
if (imgURL != null)
setIconImage(new ImageIcon(imgURL).getImage());
- AltosPreferences.set_component(this);
+ AltosUIPreferences.set_component(this);
pane = getContentPane();
gridbag = new GridBagLayout();
String result;
result = JOptionPane.showInputDialog(AltosUI.this,
"Configure Callsign",
- AltosPreferences.callsign());
+ AltosUIPreferences.callsign());
if (result != null)
- AltosPreferences.set_callsign(result);
+ AltosUIPreferences.set_callsign(result);
}
void ConfigureTeleMetrum() {
else
return new AltosTelemetryIterable(in);
} catch (FileNotFoundException fe) {
- System.out.printf("Cannot open '%s'\n", filename);
+ System.out.printf("%s\n", fe.getMessage());
return null;
}
}
try {
return new AltosCSV(file);
} catch (FileNotFoundException fe) {
- System.out.printf("Cannot open '%s'\n", filename);
+ System.out.printf("%s\n", fe.getMessage());
return null;
}
}
try {
return new AltosKML(file);
} catch (FileNotFoundException fe) {
- System.out.printf("Cannot open '%s'\n", filename);
+ System.out.printf("%s\n", fe.getMessage());
return null;
}
}
public static void main(final String[] args) {
try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ UIManager.setLookAndFeel(AltosUIPreferences.look_and_feel());
} catch (Exception e) {
}
/* Handle batch-mode */