projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
micropeak: Add command line export option
[fw/altos]
/
micropeak
/
MicroSave.java
diff --git
a/micropeak/MicroSave.java
b/micropeak/MicroSave.java
index cb4b4221d3b0b0d2e14ff7b121cfc7969e8863b8..2664f170c375ba2691ffc32490a774c157394b7e 100644
(file)
--- a/
micropeak/MicroSave.java
+++ b/
micropeak/MicroSave.java
@@
-32,6
+32,12
@@
public class MicroSave extends JFileChooser {
JFrame frame;
MicroData data;
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;
public boolean runDialog() {
int ret;
@@
-76,9
+82,7
@@
public class MicroSave extends JFileChooser {
}
}
try {
}
}
try {
- FileOutputStream fos = new FileOutputStream(file);
- data.save(fos);
- fos.close();
+ save(file, data);
data.set_name(filename);
return true;
} catch (FileNotFoundException fe) {
data.set_name(filename);
return true;
} catch (FileNotFoundException fe) {