+ JButton graph;
+ AltosFlightReader reader;
+
+ public void actionPerformed(ActionEvent e) {
+ String cmd = e.getActionCommand();
+
+ if (cmd.equals("graph")) {
+ File file = reader.backing_file();
+ if (file != null) {
+ String filename = file.getName();
+ try {
+ AltosRecordIterable records = null;
+ if (filename.endsWith("eeprom")) {
+ FileInputStream in = new FileInputStream(file);
+ records = new AltosEepromIterable(in);
+ } else if (filename.endsWith("telem")) {
+ FileInputStream in = new FileInputStream(file);
+ records = new AltosTelemetryIterable(in);
+ } else if (filename.endsWith("mega")) {
+ FileInputStream in = new FileInputStream(file);
+ records = new AltosEepromMegaIterable(in);
+ } else {
+ throw new FileNotFoundException(filename);
+ }
+ try {
+ new AltosGraphUI(records, file);
+ } catch (InterruptedException ie) {
+ } catch (IOException ie) {
+ }
+ } catch (FileNotFoundException fe) {
+ JOptionPane.showMessageDialog(null,
+ fe.getMessage(),
+ "Cannot open file",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ }
+ }
+
+ public String getName() {
+ return "Landed";
+ }
+
+ public AltosLanded(AltosFlightReader in_reader) {