(ActionEvent ae)
| 105 | } |
| 106 | |
| 107 | public void actionPerformed(ActionEvent ae) |
| 108 | { |
| 109 | try |
| 110 | { |
| 111 | String action = ae.getActionCommand(); |
| 112 | |
| 113 | if (action.equals("examine started")) { |
| 114 | int sel = this.startedField.getSelectedIndex(); |
| 115 | if (sel < 0) { |
| 116 | JOptionPane.showMessageDialog(this, "You must select a quest to examine", "No quest selected", 0); |
| 117 | } |
| 118 | else |
| 119 | examineQuest((Quest)this.startedList.get(sel)); |
| 120 | } |
| 121 | else if (action.equals("examine completed")) { |
| 122 | int sel = this.completedField.getSelectedIndex(); |
| 123 | if (sel < 0) { |
| 124 | JOptionPane.showMessageDialog(this, "You must select a quest to examine", "No quest selected", 0); |
| 125 | } |
| 126 | else |
| 127 | examineQuest((Quest)this.completedList.get(sel)); |
| 128 | } |
| 129 | else if (action.equals("examine failed")) { |
| 130 | int sel = this.failedField.getSelectedIndex(); |
| 131 | if (sel < 0) { |
| 132 | JOptionPane.showMessageDialog(this, "You must select a quest to examine", "No quest selected", 0); |
| 133 | } |
| 134 | else |
| 135 | examineQuest((Quest)this.failedList.get(sel)); |
| 136 | } |
| 137 | else if (action.equals("examine not started")) { |
| 138 | int sel = this.notStartedField.getSelectedIndex(); |
| 139 | if (sel < 0) { |
| 140 | JOptionPane.showMessageDialog(this, "You must select a quest to examine", "No quest selected", 0); |
| 141 | } |
| 142 | else |
| 143 | examineQuest((Quest)this.notStartedList.get(sel)); |
| 144 | } |
| 145 | } |
| 146 | catch (DBException exc) { |
| 147 | Main.logException("Unable to access database field", exc); |
| 148 | } catch (Throwable exc) { |
| 149 | Main.logException("Exception while processing action event", exc); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | private void examineQuest(Quest quest) |
| 154 | throws DBException |
nothing calls this directly
no test coverage detected