import java.io.*;
import java.util.concurrent.*;
import java.util.*;
-import org.altusmetrum.AltosLib.*;
-import org.altusmetrum.altosuilib.*;
+import org.altusmetrum.altoslib_1.*;
+import org.altusmetrum.altosuilib_1.*;
public class MicroSave extends JFileChooser {
JFrame frame;
MicroData data;
+ public static void save(File file, MicroData data) throws FileNotFoundException, IOException {
+ FileOutputStream fos = new FileOutputStream(file);
+ data.save(fos);
+ fos.close();
+ }
+
public boolean runDialog() {
int ret;
}
}
try {
- FileOutputStream fos = new FileOutputStream(file);
- data.save(fos);
- fos.close();
+ save(file, data);
data.set_name(filename);
return true;
} catch (FileNotFoundException fe) {
setFileFilter(new FileNameExtensionFilter("MicroPeak data file",
"mpd"));
setCurrentDirectory(AltosUIPreferences.logdir());
+ setSelectedFile(MicroFile.make());
}
}