import java.io.*;
import java.util.concurrent.*;
import java.util.*;
-import org.altusmetrum.AltosLib.*;
-import org.altusmetrum.altosuilib.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class MicroPeak extends MicroFrame implements ActionListener, ItemListener {
File filename;
MicroGraph graph;
- MicroStatsTable stats;
+ AltosUIEnable enable;
+ MicroStatsTable statsTable;
MicroRaw raw;
MicroData data;
+ MicroStats stats;
Container container;
JTabbedPane pane;
static int number_of_windows;
return mp.SetData(data);
}
this.data = data;
- graph.setData(data);
- stats.setData(data);
+ stats = new MicroStats(data);
+ graph.setDataSet(data);
+ statsTable.setStats(stats);
raw.setData(data);
setTitle(data.name);
return this;
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 {
private void DownloadData() {
AltosDevice device = MicroDeviceDialog.show(this);
-
+
if (device != null)
new MicroDownload(this, device);
}
if (save.runDialog())
SetName(data.name);
}
-
+
private void Export() {
if (data == null) {
no_data();
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;
+ register_for_macosx_events();
+
AltosUIPreferences.set_component(this);
container = getContentPane();
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) {
+ statsTable.tell_closing();
Close();
}
});
- graph = new MicroGraph();
- stats = new MicroStatsTable();
+ enable = new AltosUIEnable();
+ graph = new MicroGraph(enable);
+ statsTable = new MicroStatsTable();
raw = new MicroRaw();
pane.add(graph.panel, "Graph");
- pane.add(stats, "Statistics");
+ pane.add(enable, "Configure Graph");
+ pane.add(statsTable, "Statistics");
JScrollPane scroll = new JScrollPane(raw);
pane.add(scroll, "Raw Data");
pane.doLayout();
ps.height += i.top + i.bottom;
// setPreferredSize(ps);
setSize(ps);
- setLocationByPlatform(true);
setVisible(true);
}
}
for (int i = 0; i < args.length; i++) {
- System.out.printf ("Arg %d: %s\n", i, args[i]);
if (args[i].equals("--help"))
help(0);
else if (args[i].equals("--export"))