X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=micropeak%2FMicroPeak.java;h=f2f09a10df27c96370ca58585c25c1e8934e33af;hb=2c423d9287c6b9ea7233f5e3430682cb1c865da1;hp=544f3ae00ee7c93b2bff80bca7363d0d01afe896;hpb=93d640de65a1ecedfef89c96521c21632f96f372;p=fw%2Faltos diff --git a/micropeak/MicroPeak.java b/micropeak/MicroPeak.java index 544f3ae0..f2f09a10 100644 --- a/micropeak/MicroPeak.java +++ b/micropeak/MicroPeak.java @@ -101,12 +101,15 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene new MicroDownload(this, device); } - private void Save() { - if (data == null) { + private void no_data() { JOptionPane.showMessageDialog(this, "No data available", "No data", JOptionPane.INFORMATION_MESSAGE); + } + private void Save() { + if (data == null) { + no_data(); return; } MicroSave save = new MicroSave (this, data); @@ -114,6 +117,15 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene SetName(data.name); } + private void Export() { + if (data == null) { + no_data(); + return; + } + MicroExport export = new MicroExport (this, data); + export.runDialog(); + } + private void Close() { setVisible(false); dispose(); @@ -131,6 +143,8 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene SelectFile(); else if ("Download".equals(ev.getActionCommand())) DownloadData(); + else if ("Export".equals(ev.getActionCommand())) + Export(); else if ("Preferences".equals(ev.getActionCommand())) Preferences(); else if ("Save a Copy".equals(ev.getActionCommand())) @@ -169,6 +183,10 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene fileMenu.add(saveAction); saveAction.addActionListener(this); + JMenuItem exportAction = new JMenuItem("Export"); + fileMenu.add(exportAction); + exportAction.addActionListener(this); + JMenuItem preferencesAction = new JMenuItem("Preferences"); fileMenu.add(preferencesAction); preferencesAction.addActionListener(this);