+ /* 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 void filter_changed(double speed_filter, double accel_filter) {
+ data.flight_series.set_filter(speed_filter, accel_filter);
+ graph.filter_changed();
+ data.flight_stats = new AltosFlightStats(data.flight_series);
+ statsTable.filter_changed(data.flight_stats);
+ }
+
+ public double speed_filter() {
+ if (data != null && data.flight_series != null)
+ return data.flight_series.speed_filter_width;
+ return 4.0;
+ }
+
+ public double accel_filter() {
+ if (data != null && data.flight_series != null)
+ return data.flight_series.accel_filter_width;
+ return 1.0;
+ }
+
+ private void add_menu(JMenu menu, String label, String action) {
+ JMenuItem item = new JMenuItem(label);
+ menu.add(item);
+ item.addActionListener(this);
+ item.setActionCommand(action);
+ }
+
+
+ private void make_menu(String label, String[][] items) {
+ JMenu menu = new JMenu(label);
+ for (int i = 0; i < items.length; i++) {
+ if (MAC_OS_X) {
+ if (items[i][1].equals("exit"))
+ continue;
+ if (items[i][1].equals("preferences"))
+ continue;
+ }
+ add_menu(menu, items[i][0], items[i][1]);
+ }
+ menu_bar.add(menu);
+ }
+