/// <summary> /// Responds to action performed events. </summary> /// <param name="e"> the ActionEvent that happened. </param> public virtual void actionPerformed(ActionEvent e) { string routine = "StateMod_RunReport_JFrame.actionPerformed"; string action = e.getActionCommand(); if (action.Equals(__BUTTON_RUN_REPORT)) { JRadioButton cb = getSelectedJRadioButton(); if (cb == null) { return; } StringBuilder sb = new StringBuilder("-report "); sb.Append(cb.getText()); // now check if station id is needed; if so, append it if (cb == __xdgJRadioButton) { sb.Append(" -"); sb.Append(StringUtil.getToken(__xdgSimpleJComboBox.getSelected(), " ", 0, 0)); } else if (cb == __xrgJRadioButton) { sb.Append(" -"); sb.Append(StringUtil.getToken(__xrgSimpleJComboBox.getSelected(), " ", 0, 0)); } else if (cb == __xwgJRadioButton) { sb.Append(" -"); sb.Append(StringUtil.getToken(__xwgSimpleJComboBox.getSelected(), " ", 0, 0)); } string s = sb.ToString(); try { // Run the report using the process manager dialog. // Pass in the main GUI class so that the modal process // manager dialog is on top of that window. Message.printStatus(1, routine, "Running statemod " + "with command line options: '" + sb + "'"); StateMod_Util.runStateMod(__dataset, s, true, __dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_MAIN)); } catch (Exception) { Message.printWarning(1, routine, "There was an error running: \n" + s, this); } } else if (action.Equals(__BUTTON_CANCEL)) { if (__dataset_wm != null) { __dataset_wm.closeWindow(StateMod_DataSet_WindowManager.WINDOW_RUN_REPORT); } else { JGUIUtil.close(this); } } else if (action.Equals(__BUTTON_HELP)) { // REVISIT HELP (JTS - 2003-08-21) } }