projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename existing turnon_telebt script, create a new one for v4.0
[fw/altos]
/
micropeak
/
MicroPeak.java
diff --git
a/micropeak/MicroPeak.java
b/micropeak/MicroPeak.java
index 871d5cc34658e98d835ac2d6b5a94f730321540a..9023f452df7f4d4578beda8b13b857c1351723e2 100644
(file)
--- a/
micropeak/MicroPeak.java
+++ b/
micropeak/MicroPeak.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-23,17
+24,18
@@
import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
import java.util.*;
import java.io.*;
import java.util.concurrent.*;
import java.util.*;
-import org.altusmetrum.altoslib_1.*;
-import org.altusmetrum.altosuilib_1.*;
+import org.altusmetrum.altoslib_1
1
.*;
+import org.altusmetrum.altosuilib_1
1
.*;
public class MicroPeak extends MicroFrame implements ActionListener, ItemListener {
File filename;
MicroGraph graph;
AltosUIEnable enable;
public class MicroPeak extends MicroFrame implements ActionListener, ItemListener {
File filename;
MicroGraph graph;
AltosUIEnable enable;
- MicroStatsTable stats;
+ MicroStatsTable stats
Table
;
MicroRaw raw;
MicroData data;
MicroRaw raw;
MicroData data;
+ MicroStats stats;
Container container;
JTabbedPane pane;
static int number_of_windows;
Container container;
JTabbedPane pane;
static int number_of_windows;
@@
-45,8
+47,9
@@
public class MicroPeak extends MicroFrame implements ActionListener, ItemListene
return mp.SetData(data);
}
this.data = data;
return mp.SetData(data);
}
this.data = data;
+ stats = new MicroStats(data);
graph.setDataSet(data);
graph.setDataSet(data);
- stats
.setData(data
);
+ stats
Table.setStats(stats
);
raw.setData(data);
setTitle(data.name);
return this;
raw.setData(data);
setTitle(data.name);
return this;
@@
-62,6
+65,11
@@
public class MicroPeak extends MicroFrame implements ActionListener, ItemListene
FileInputStream fis = new FileInputStream(filename);
try {
data = new MicroData((InputStream) fis, filename.getName());
FileInputStream fis = new FileInputStream(filename);
try {
data = new MicroData((InputStream) fis, filename.getName());
+ AltosUIPreferences.set_last_logdir(filename);
+ } catch (MicroData.NonHexcharException nhe) {
+ data = null;
+ } catch (MicroData.FileEndedException nhe) {
+ data = null;
} catch (InterruptedException ie) {
data = null;
} finally {
} catch (InterruptedException ie) {
data = null;
} finally {
@@
-100,7
+108,7
@@
public class MicroPeak extends MicroFrame implements ActionListener, ItemListene
private void DownloadData() {
AltosDevice device = MicroDeviceDialog.show(this);
private void DownloadData() {
AltosDevice device = MicroDeviceDialog.show(this);
-
+
if (device != null)
new MicroDownload(this, device);
}
if (device != null)
new MicroDownload(this, device);
}
@@
-121,7
+129,7
@@
public class MicroPeak extends MicroFrame implements ActionListener, ItemListene
if (save.runDialog())
SetName(data.name);
}
if (save.runDialog())
SetName(data.name);
}
-
+
private void Export() {
if (data == null) {
no_data();
private void Export() {
if (data == null) {
no_data();
@@
-183,10
+191,25
@@
public class MicroPeak extends MicroFrame implements ActionListener, ItemListene
public void itemStateChanged(ItemEvent e) {
}
public void itemStateChanged(ItemEvent e) {
}
+ /* OSXAdapter interfaces */
+ public void macosx_file_handler(String path) {
+ CommandGraph(new File(path));
+ }
+
+ public void macosx_quit_handler() {
+ System.exit(0);
+ }
+
+ public void macosx_preferences_handler() {
+ Preferences();
+ }
+
public MicroPeak() {
++number_of_windows;
public MicroPeak() {
++number_of_windows;
+ register_for_macosx_events();
+
AltosUIPreferences.set_component(this);
container = getContentPane();
AltosUIPreferences.set_component(this);
container = getContentPane();
@@
-228,22
+251,26
@@
public class MicroPeak extends MicroFrame implements ActionListener, ItemListene
fileMenu.add(exitAction);
exitAction.addActionListener(this);
fileMenu.add(exitAction);
exitAction.addActionListener(this);
+ JButton downloadButton = new JButton ("Download");
+ downloadButton.addActionListener(this);
+ menuBar.add(downloadButton);
+
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
- stats.tell_closing();
+ stats
Table
.tell_closing();
Close();
}
});
enable = new AltosUIEnable();
graph = new MicroGraph(enable);
Close();
}
});
enable = new AltosUIEnable();
graph = new MicroGraph(enable);
- stats = new MicroStatsTable();
+ stats
Table
= new MicroStatsTable();
raw = new MicroRaw();
pane.add(graph.panel, "Graph");
pane.add(enable, "Configure Graph");
raw = new MicroRaw();
pane.add(graph.panel, "Graph");
pane.add(enable, "Configure Graph");
- pane.add(stats, "Statistics");
+ pane.add(stats
Table
, "Statistics");
JScrollPane scroll = new JScrollPane(raw);
pane.add(scroll, "Raw Data");
pane.doLayout();
JScrollPane scroll = new JScrollPane(raw);
pane.add(scroll, "Raw Data");
pane.doLayout();