if (file != null) {
String filename = file.getName();
try {
- AltosStateIterable states = null;
+ AltosRecordSet record_set = null;
if (filename.endsWith("eeprom")) {
- FileInputStream in = new FileInputStream(file);
- states = new AltosEepromFile(in);
+ record_set = new AltosEepromRecordSet(new FileReader(file));
} else if (filename.endsWith("telem")) {
FileInputStream in = new FileInputStream(file);
- states = new AltosTelemetryFile(in);
+ record_set = new AltosTelemetryFile(in);
} else {
throw new FileNotFoundException(filename);
}
try {
- new AltosGraphUI(states, file);
+ new AltosGraphUI(record_set, file);
} catch (InterruptedException ie) {
} catch (IOException ie) {
}
fe.getMessage(),
"Cannot open file",
JOptionPane.ERROR_MESSAGE);
+ } catch (IOException ie) {
+ JOptionPane.showMessageDialog(null,
+ ie.getMessage(),
+ "Error reading file file",
+ JOptionPane.ERROR_MESSAGE);
}
}
}