| 1 | package event.editor.frame; |
|---|
| 2 | |
|---|
| 3 | import event.editor.I_ScriptEventEditorPanel; |
|---|
| 4 | import java.awt.BorderLayout; |
|---|
| 5 | import java.awt.Color; |
|---|
| 6 | import java.awt.FlowLayout; |
|---|
| 7 | import javax.swing.*; |
|---|
| 8 | import java.util.*; |
|---|
| 9 | import java.awt.event.*; |
|---|
| 10 | import java.text.SimpleDateFormat; |
|---|
| 11 | import scriptbuilder.gui.IncidentEditorFrame; |
|---|
| 12 | import scriptbuilder.gui.ScriptBuilderFrame; |
|---|
| 13 | import scriptbuilder.gui.ScriptBuilderGuiConstants; |
|---|
| 14 | import scriptbuilder.gui.panels.IncidentTimelinePanel; |
|---|
| 15 | import scriptbuilder.structures.ScriptEvent; |
|---|
| 16 | import scriptbuilder.structures.ScriptIncident; |
|---|
| 17 | import scriptbuilder.structures.TimeSlice; |
|---|
| 18 | import scriptbuilder.structures.events.*; |
|---|
| 19 | |
|---|
| 20 | public class Editor extends javax.swing.JFrame implements Observer |
|---|
| 21 | { |
|---|
| 22 | |
|---|
| 23 | IncidentEditorFrame topFrame = null; |
|---|
| 24 | |
|---|
| 25 | ScriptIncident incident = null; |
|---|
| 26 | |
|---|
| 27 | TimeSlice slice = null; |
|---|
| 28 | |
|---|
| 29 | private PropertyModel model = new PropertyModel(); |
|---|
| 30 | |
|---|
| 31 | public void addEvent(Properties property, I_ScriptEvent se) |
|---|
| 32 | { |
|---|
| 33 | model.addEventPanel(property, se); |
|---|
| 34 | } |
|---|
| 35 | /** |
|---|
| 36 | * adds all of the events from the timeslice to the incidentTimelinePanel |
|---|
| 37 | * @param ts the timeslice to be added |
|---|
| 38 | */ |
|---|
| 39 | public void setSlice(TimeSlice ts) |
|---|
| 40 | { |
|---|
| 41 | slice = ts; |
|---|
| 42 | |
|---|
| 43 | if (slice != null) |
|---|
| 44 | |
|---|
| 45 | { |
|---|
| 46 | for (I_ScriptEvent se : slice.events) |
|---|
| 47 | { |
|---|
| 48 | |
|---|
| 49 | this.addEvent(IncidentTimelinePanel.eventTypeToPropertyMap.get(se.getScriptEventType()), se); |
|---|
| 50 | |
|---|
| 51 | } |
|---|
| 52 | System.out.println("Current time = " + slice.getTime() + " seconds"); |
|---|
| 53 | SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss"); |
|---|
| 54 | df.setTimeZone(TimeZone.getTimeZone("GMT")); |
|---|
| 55 | String eventTime = df.format(new Date(slice.getTime() * 1000)); |
|---|
| 56 | System.out.println("[" + eventTime + "]"); |
|---|
| 57 | |
|---|
| 58 | List<Integer> timesS = timeGenerator(eventTime,"s"); |
|---|
| 59 | List<Integer> timesM = timeGenerator(eventTime,"m"); |
|---|
| 60 | List<Integer> timesH = timeGenerator(eventTime,"h"); |
|---|
| 61 | timeHourComboSelector.setModel(new DefaultComboBoxModel(timesH.toArray())); |
|---|
| 62 | timeMinuteComboSelector.setModel(new DefaultComboBoxModel(timesM.toArray())); |
|---|
| 63 | timeSecondComboSelector.setModel(new DefaultComboBoxModel(timesS.toArray())); |
|---|
| 64 | timeHourComboSelector.setSelectedItem(slice.getTime()/3600); |
|---|
| 65 | timeMinuteComboSelector.setSelectedItem((slice.getTime()%3600)/60); |
|---|
| 66 | timeSecondComboSelector.setSelectedItem(slice.getTime()%60); |
|---|
| 67 | } |
|---|
| 68 | |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | private List<Integer> timeGenerator(String time,String type) |
|---|
| 72 | { |
|---|
| 73 | List<Integer> times = new ArrayList<Integer>(); |
|---|
| 74 | String[] timeArray = time.split(":"); |
|---|
| 75 | int currTime = 0; |
|---|
| 76 | switch(type) |
|---|
| 77 | { |
|---|
| 78 | case "h": |
|---|
| 79 | { |
|---|
| 80 | currTime = Integer.parseInt(timeArray[0]); |
|---|
| 81 | for(int i = 0;i< ScriptBuilderGuiConstants.MAX_SIMULATION_LENGTH/3600;i++) |
|---|
| 82 | { |
|---|
| 83 | times.add(i); |
|---|
| 84 | } |
|---|
| 85 | break; |
|---|
| 86 | } |
|---|
| 87 | case "m": |
|---|
| 88 | { |
|---|
| 89 | currTime = Integer.parseInt(timeArray[1]); |
|---|
| 90 | for(int i = 0; i<60;i++) |
|---|
| 91 | { |
|---|
| 92 | times.add(i); |
|---|
| 93 | } |
|---|
| 94 | |
|---|
| 95 | break; |
|---|
| 96 | } |
|---|
| 97 | case "s": |
|---|
| 98 | { |
|---|
| 99 | //includes times 0,20,40,80 |
|---|
| 100 | currTime = Integer.parseInt(timeArray[2]); |
|---|
| 101 | for(int i = 0; i<60;i+=ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION) |
|---|
| 102 | { |
|---|
| 103 | times.add(i); |
|---|
| 104 | } |
|---|
| 105 | break; |
|---|
| 106 | } |
|---|
| 107 | default: |
|---|
| 108 | { |
|---|
| 109 | } |
|---|
| 110 | |
|---|
| 111 | } |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | //times.add(time); |
|---|
| 115 | |
|---|
| 116 | return times; |
|---|
| 117 | } |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | private ActionListener optionalChangeListener = new ActionListener() |
|---|
| 122 | { |
|---|
| 123 | public void actionPerformed(ActionEvent evt) |
|---|
| 124 | { |
|---|
| 125 | JCheckBoxMenuItem src = (JCheckBoxMenuItem) evt.getSource(); |
|---|
| 126 | Properties property = Properties.valueOf(src.getText().replaceAll(" ", "")); |
|---|
| 127 | |
|---|
| 128 | if (src.isSelected()) |
|---|
| 129 | { |
|---|
| 130 | model.addEventFromDropdown(property, incident, slice); |
|---|
| 131 | } |
|---|
| 132 | else |
|---|
| 133 | { |
|---|
| 134 | model.removeProperty(property); |
|---|
| 135 | } |
|---|
| 136 | } |
|---|
| 137 | }; |
|---|
| 138 | |
|---|
| 139 | private ActionListener multipleChangeListener = new ActionListener() |
|---|
| 140 | { |
|---|
| 141 | public void actionPerformed(ActionEvent evt) |
|---|
| 142 | { |
|---|
| 143 | JMenuItem src = (JMenuItem) evt.getSource(); |
|---|
| 144 | Properties property = Properties.valueOf(src.getText().replaceAll(" ", "")); |
|---|
| 145 | model.addEventFromDropdown(property, incident, slice); |
|---|
| 146 | } |
|---|
| 147 | }; |
|---|
| 148 | |
|---|
| 149 | /** |
|---|
| 150 | * Blank constructor for a new editor. |
|---|
| 151 | */ |
|---|
| 152 | public Editor(IncidentEditorFrame frame) |
|---|
| 153 | { |
|---|
| 154 | topFrame = frame; |
|---|
| 155 | initComponents(); |
|---|
| 156 | |
|---|
| 157 | incident = frame.getIncident(); |
|---|
| 158 | |
|---|
| 159 | model.addObserver(this); |
|---|
| 160 | |
|---|
| 161 | // For each menu |
|---|
| 162 | for (int menuCtr = 0; menuCtr < editorMenuBar.getMenuCount(); menuCtr++) |
|---|
| 163 | { |
|---|
| 164 | // for each menu item |
|---|
| 165 | for (java.awt.Component comp : editorMenuBar.getMenu(menuCtr).getMenuComponents()) |
|---|
| 166 | { |
|---|
| 167 | JMenuItem item = (JMenuItem) comp; |
|---|
| 168 | |
|---|
| 169 | String itemName = item.getText().replaceAll(" ", ""); |
|---|
| 170 | |
|---|
| 171 | Properties property = Properties.valueOf(itemName); |
|---|
| 172 | |
|---|
| 173 | if (property.getType() == PropertyTypes.Multiple) |
|---|
| 174 | { |
|---|
| 175 | item.addActionListener(multipleChangeListener); |
|---|
| 176 | } |
|---|
| 177 | else if (property.getType() == PropertyTypes.Optional) |
|---|
| 178 | { |
|---|
| 179 | item.addActionListener(optionalChangeListener); |
|---|
| 180 | } |
|---|
| 181 | else |
|---|
| 182 | { |
|---|
| 183 | throw new RuntimeException("Property type not accounted for"); |
|---|
| 184 | } |
|---|
| 185 | } |
|---|
| 186 | |
|---|
| 187 | } |
|---|
| 188 | //this eventTime might need to be initialized to the correct time |
|---|
| 189 | String eventTime = ""; |
|---|
| 190 | |
|---|
| 191 | |
|---|
| 192 | this.addWindowListener(new WindowAdapter() |
|---|
| 193 | { |
|---|
| 194 | @Override |
|---|
| 195 | public void windowClosing(WindowEvent e) |
|---|
| 196 | { |
|---|
| 197 | //Add previous offset back in |
|---|
| 198 | //If we didn't adjust the offset, this will just set it to the old value |
|---|
| 199 | //If we deleted the first event(s), this will add the offsets, |
|---|
| 200 | //to ensure that events stay at the correct times |
|---|
| 201 | Object[] options = {"Yes","Cancel"}; |
|---|
| 202 | int result = JOptionPane.showOptionDialog(null,"Are you sure you want to exit without saving?", |
|---|
| 203 | "Exit", |
|---|
| 204 | JOptionPane.YES_NO_OPTION, |
|---|
| 205 | JOptionPane.QUESTION_MESSAGE, |
|---|
| 206 | null, |
|---|
| 207 | options, |
|---|
| 208 | options[1]); |
|---|
| 209 | switch (result){ |
|---|
| 210 | //should just close |
|---|
| 211 | case 0: |
|---|
| 212 | closeWindow(); |
|---|
| 213 | //this.setVisible(true); |
|---|
| 214 | break; |
|---|
| 215 | // should do nothing |
|---|
| 216 | case 1: |
|---|
| 217 | |
|---|
| 218 | break; |
|---|
| 219 | default: |
|---|
| 220 | break; |
|---|
| 221 | } |
|---|
| 222 | //add a do you want to close without saving popup window here |
|---|
| 223 | |
|---|
| 224 | } |
|---|
| 225 | }); |
|---|
| 226 | } |
|---|
| 227 | private void closeWindow(){ |
|---|
| 228 | this.dispose(); |
|---|
| 229 | } |
|---|
| 230 | |
|---|
| 231 | /** |
|---|
| 232 | * This method is called from within the constructor to initialize the form. |
|---|
| 233 | * WARNING: Do NOT modify this code. The content of this method is always |
|---|
| 234 | * regenerated by the Form Editor. |
|---|
| 235 | */ |
|---|
| 236 | @SuppressWarnings("unchecked") |
|---|
| 237 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|---|
| 238 | private void initComponents() { |
|---|
| 239 | |
|---|
| 240 | eventTabsPane = new javax.swing.JTabbedPane(); |
|---|
| 241 | bottomFramePanel = new javax.swing.JPanel(); |
|---|
| 242 | saveCloseBtn = new javax.swing.JButton(); |
|---|
| 243 | btnRemoveCurrentEvent = new javax.swing.JButton(); |
|---|
| 244 | timeSecondComboSelector = new javax.swing.JComboBox<>(); |
|---|
| 245 | timeMinuteComboSelector = new javax.swing.JComboBox<>(); |
|---|
| 246 | timeHourComboSelector = new javax.swing.JComboBox<>(); |
|---|
| 247 | jLabel1 = new javax.swing.JLabel(); |
|---|
| 248 | jLabel2 = new javax.swing.JLabel(); |
|---|
| 249 | jLabel3 = new javax.swing.JLabel(); |
|---|
| 250 | editorMenuBar = new javax.swing.JMenuBar(); |
|---|
| 251 | menuEvaluations = new javax.swing.JMenu(); |
|---|
| 252 | ATMS = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 253 | ActivityLog = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 254 | CAD = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 255 | CMS = new javax.swing.JMenuItem(); |
|---|
| 256 | Facilitator = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 257 | Radio = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 258 | menuInstructor = new javax.swing.JMenu(); |
|---|
| 259 | MaintenanceRadio = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 260 | TMTRadio = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 261 | Telephone = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 262 | menuAutoData = new javax.swing.JMenu(); |
|---|
| 263 | Audio = new javax.swing.JMenuItem(); |
|---|
| 264 | CADLog = new javax.swing.JMenuItem(); |
|---|
| 265 | CCTV = new javax.swing.JMenuItem(); |
|---|
| 266 | CHPRadio = new javax.swing.JCheckBoxMenuItem(); |
|---|
| 267 | Paramics = new javax.swing.JMenuItem(); |
|---|
| 268 | Tow = new javax.swing.JMenuItem(); |
|---|
| 269 | Unit = new javax.swing.JMenuItem(); |
|---|
| 270 | Witness = new javax.swing.JMenuItem(); |
|---|
| 271 | |
|---|
| 272 | setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); |
|---|
| 273 | setTitle("Event Editor"); |
|---|
| 274 | |
|---|
| 275 | org.jdesktop.layout.GroupLayout bottomFramePanelLayout = new org.jdesktop.layout.GroupLayout(bottomFramePanel); |
|---|
| 276 | bottomFramePanel.setLayout(bottomFramePanelLayout); |
|---|
| 277 | bottomFramePanelLayout.setHorizontalGroup( |
|---|
| 278 | bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 279 | .add(0, 70, Short.MAX_VALUE) |
|---|
| 280 | ); |
|---|
| 281 | bottomFramePanelLayout.setVerticalGroup( |
|---|
| 282 | bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 283 | .add(0, 45, Short.MAX_VALUE) |
|---|
| 284 | ); |
|---|
| 285 | |
|---|
| 286 | saveCloseBtn.setText("Save and Close"); |
|---|
| 287 | saveCloseBtn.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 288 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 289 | saveCloseBtnActionPerformed(evt); |
|---|
| 290 | } |
|---|
| 291 | }); |
|---|
| 292 | |
|---|
| 293 | btnRemoveCurrentEvent.setText("Remove This Event"); |
|---|
| 294 | btnRemoveCurrentEvent.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 295 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 296 | btnRemoveCurrentEventActionPerformed(evt); |
|---|
| 297 | } |
|---|
| 298 | }); |
|---|
| 299 | |
|---|
| 300 | timeSecondComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Second" })); |
|---|
| 301 | timeSecondComboSelector.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 302 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 303 | timeSecondComboSelectorActionPerformed(evt); |
|---|
| 304 | } |
|---|
| 305 | }); |
|---|
| 306 | |
|---|
| 307 | timeMinuteComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Minute" })); |
|---|
| 308 | timeMinuteComboSelector.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 309 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 310 | timeMinuteComboSelectorActionPerformed(evt); |
|---|
| 311 | } |
|---|
| 312 | }); |
|---|
| 313 | |
|---|
| 314 | timeHourComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Hour" })); |
|---|
| 315 | timeHourComboSelector.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 316 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 317 | timeHourComboSelectorActionPerformed(evt); |
|---|
| 318 | } |
|---|
| 319 | }); |
|---|
| 320 | |
|---|
| 321 | jLabel1.setText("Hour"); |
|---|
| 322 | |
|---|
| 323 | jLabel2.setText("Minute"); |
|---|
| 324 | |
|---|
| 325 | jLabel3.setText("Second"); |
|---|
| 326 | |
|---|
| 327 | menuEvaluations.setText("Evaluations"); |
|---|
| 328 | |
|---|
| 329 | ATMS.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 330 | ATMS.setText("ATMS"); |
|---|
| 331 | ATMS.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ATMSEval.png"))); // NOI18N |
|---|
| 332 | ATMS.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 333 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 334 | multipleChange(evt); |
|---|
| 335 | } |
|---|
| 336 | }); |
|---|
| 337 | menuEvaluations.add(ATMS); |
|---|
| 338 | |
|---|
| 339 | ActivityLog.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK)); |
|---|
| 340 | ActivityLog.setText("Activity Log"); |
|---|
| 341 | ActivityLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ActivityLogEval.png"))); // NOI18N |
|---|
| 342 | ActivityLog.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 343 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 344 | multipleChange(evt); |
|---|
| 345 | } |
|---|
| 346 | }); |
|---|
| 347 | menuEvaluations.add(ActivityLog); |
|---|
| 348 | |
|---|
| 349 | CAD.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK)); |
|---|
| 350 | CAD.setText("CAD"); |
|---|
| 351 | CAD.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CADEval.png"))); // NOI18N |
|---|
| 352 | CAD.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 353 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 354 | multipleChange(evt); |
|---|
| 355 | } |
|---|
| 356 | }); |
|---|
| 357 | menuEvaluations.add(CAD); |
|---|
| 358 | |
|---|
| 359 | CMS.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 360 | CMS.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CMSEval.png"))); // NOI18N |
|---|
| 361 | CMS.setText("CMS"); |
|---|
| 362 | CMS.addMouseListener(new java.awt.event.MouseAdapter() { |
|---|
| 363 | public void mouseClicked(java.awt.event.MouseEvent evt) { |
|---|
| 364 | multipleChangeListener(evt); |
|---|
| 365 | } |
|---|
| 366 | }); |
|---|
| 367 | CMS.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 368 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 369 | multipleChange(evt); |
|---|
| 370 | } |
|---|
| 371 | }); |
|---|
| 372 | menuEvaluations.add(CMS); |
|---|
| 373 | |
|---|
| 374 | Facilitator.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 375 | Facilitator.setText("Facilitator"); |
|---|
| 376 | Facilitator.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/FacilitatorEval.png"))); // NOI18N |
|---|
| 377 | Facilitator.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 378 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 379 | optionalChange(evt); |
|---|
| 380 | } |
|---|
| 381 | }); |
|---|
| 382 | menuEvaluations.add(Facilitator); |
|---|
| 383 | |
|---|
| 384 | Radio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 385 | Radio.setText("Radio"); |
|---|
| 386 | Radio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RadioEval.png"))); // NOI18N |
|---|
| 387 | Radio.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 388 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 389 | optionalChange(evt); |
|---|
| 390 | } |
|---|
| 391 | }); |
|---|
| 392 | menuEvaluations.add(Radio); |
|---|
| 393 | |
|---|
| 394 | editorMenuBar.add(menuEvaluations); |
|---|
| 395 | |
|---|
| 396 | menuInstructor.setText("Instructor Actions"); |
|---|
| 397 | |
|---|
| 398 | MaintenanceRadio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 399 | MaintenanceRadio.setText("Maintenance Radio"); |
|---|
| 400 | MaintenanceRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/MaintenanceRadio.png"))); // NOI18N |
|---|
| 401 | MaintenanceRadio.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 402 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 403 | optionalChange(evt); |
|---|
| 404 | } |
|---|
| 405 | }); |
|---|
| 406 | menuInstructor.add(MaintenanceRadio); |
|---|
| 407 | |
|---|
| 408 | TMTRadio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 409 | TMTRadio.setText("TMT Radio"); |
|---|
| 410 | TMTRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/TMTRadio.png"))); // NOI18N |
|---|
| 411 | TMTRadio.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 412 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 413 | optionalChange(evt); |
|---|
| 414 | } |
|---|
| 415 | }); |
|---|
| 416 | menuInstructor.add(TMTRadio); |
|---|
| 417 | |
|---|
| 418 | Telephone.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 419 | Telephone.setText("Telephone"); |
|---|
| 420 | Telephone.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Telephone.png"))); // NOI18N |
|---|
| 421 | Telephone.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 422 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 423 | optionalChange(evt); |
|---|
| 424 | } |
|---|
| 425 | }); |
|---|
| 426 | menuInstructor.add(Telephone); |
|---|
| 427 | |
|---|
| 428 | editorMenuBar.add(menuInstructor); |
|---|
| 429 | |
|---|
| 430 | menuAutoData.setText("Automated Data"); |
|---|
| 431 | |
|---|
| 432 | Audio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 433 | Audio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Audio.png"))); // NOI18N |
|---|
| 434 | Audio.setText("Audio"); |
|---|
| 435 | Audio.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 436 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 437 | AudioActionPerformed(evt); |
|---|
| 438 | } |
|---|
| 439 | }); |
|---|
| 440 | menuAutoData.add(Audio); |
|---|
| 441 | |
|---|
| 442 | CADLog.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 443 | CADLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CAD.png"))); // NOI18N |
|---|
| 444 | CADLog.setText("CAD Log"); |
|---|
| 445 | menuAutoData.add(CADLog); |
|---|
| 446 | |
|---|
| 447 | CCTV.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 448 | CCTV.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CCTV.png"))); // NOI18N |
|---|
| 449 | CCTV.setText("CCTV"); |
|---|
| 450 | menuAutoData.add(CCTV); |
|---|
| 451 | |
|---|
| 452 | CHPRadio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK)); |
|---|
| 453 | CHPRadio.setText("CHP Radio"); |
|---|
| 454 | CHPRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CHPRadio.png"))); // NOI18N |
|---|
| 455 | CHPRadio.addActionListener(new java.awt.event.ActionListener() { |
|---|
| 456 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|---|
| 457 | optionalChange(evt); |
|---|
| 458 | } |
|---|
| 459 | }); |
|---|
| 460 | menuAutoData.add(CHPRadio); |
|---|
| 461 | |
|---|
| 462 | Paramics.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 463 | Paramics.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Paramics.png"))); // NOI18N |
|---|
| 464 | Paramics.setText("Paramics"); |
|---|
| 465 | menuAutoData.add(Paramics); |
|---|
| 466 | |
|---|
| 467 | Tow.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 468 | Tow.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Tow.png"))); // NOI18N |
|---|
| 469 | Tow.setText("Tow"); |
|---|
| 470 | menuAutoData.add(Tow); |
|---|
| 471 | |
|---|
| 472 | Unit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 473 | Unit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Unit.png"))); // NOI18N |
|---|
| 474 | Unit.setText("Unit"); |
|---|
| 475 | menuAutoData.add(Unit); |
|---|
| 476 | |
|---|
| 477 | Witness.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK)); |
|---|
| 478 | Witness.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Witness.png"))); // NOI18N |
|---|
| 479 | Witness.setText("Witness"); |
|---|
| 480 | menuAutoData.add(Witness); |
|---|
| 481 | |
|---|
| 482 | editorMenuBar.add(menuAutoData); |
|---|
| 483 | |
|---|
| 484 | setJMenuBar(editorMenuBar); |
|---|
| 485 | |
|---|
| 486 | org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); |
|---|
| 487 | getContentPane().setLayout(layout); |
|---|
| 488 | layout.setHorizontalGroup( |
|---|
| 489 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 490 | .add(org.jdesktop.layout.GroupLayout.TRAILING, eventTabsPane) |
|---|
| 491 | .add(layout.createSequentialGroup() |
|---|
| 492 | .add(84, 84, 84) |
|---|
| 493 | .add(jLabel1) |
|---|
| 494 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 495 | .add(timeHourComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 496 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 497 | .add(jLabel2) |
|---|
| 498 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 499 | .add(timeMinuteComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 500 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 501 | .add(jLabel3) |
|---|
| 502 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 503 | .add(timeSecondComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 504 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 505 | .add(bottomFramePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
|---|
| 506 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 507 | .add(btnRemoveCurrentEvent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 226, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 508 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 509 | .add(saveCloseBtn) |
|---|
| 510 | .addContainerGap()) |
|---|
| 511 | ); |
|---|
| 512 | layout.setVerticalGroup( |
|---|
| 513 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 514 | .add(layout.createSequentialGroup() |
|---|
| 515 | .addContainerGap() |
|---|
| 516 | .add(eventTabsPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 523, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 517 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|---|
| 518 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|---|
| 519 | .add(bottomFramePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 520 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
|---|
| 521 | .add(timeSecondComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 522 | .add(timeMinuteComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 523 | .add(timeHourComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
|---|
| 524 | .add(jLabel1) |
|---|
| 525 | .add(jLabel2) |
|---|
| 526 | .add(jLabel3)) |
|---|
| 527 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
|---|
| 528 | .add(saveCloseBtn) |
|---|
| 529 | .add(btnRemoveCurrentEvent)))) |
|---|
| 530 | ); |
|---|
| 531 | |
|---|
| 532 | pack(); |
|---|
| 533 | }// </editor-fold>//GEN-END:initComponents |
|---|
| 534 | |
|---|
| 535 | private void multipleChangeListener(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_multipleChangeListener |
|---|
| 536 | |
|---|
| 537 | }//GEN-LAST:event_multipleChangeListener |
|---|
| 538 | |
|---|
| 539 | private void multipleChange(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_multipleChange |
|---|
| 540 | |
|---|
| 541 | }//GEN-LAST:event_multipleChange |
|---|
| 542 | |
|---|
| 543 | private void optionalChange(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_optionalChange |
|---|
| 544 | |
|---|
| 545 | }//GEN-LAST:event_optionalChange |
|---|
| 546 | |
|---|
| 547 | private void btnRemoveCurrentEventActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnRemoveCurrentEventActionPerformed |
|---|
| 548 | {//GEN-HEADEREND:event_btnRemoveCurrentEventActionPerformed |
|---|
| 549 | |
|---|
| 550 | int index = eventTabsPane.getSelectedIndex(); |
|---|
| 551 | |
|---|
| 552 | if (index >= 0 && eventTabsPane.getTabComponentAt(index) != null) |
|---|
| 553 | { |
|---|
| 554 | JPanel removable = (JPanel) eventTabsPane |
|---|
| 555 | .getSelectedComponent(); |
|---|
| 556 | PropertyPanel update = this.model.properties.removeProperty(removable); |
|---|
| 557 | |
|---|
| 558 | ((I_ScriptEventEditorPanel) update.getPanel()).removeAssociatedEvent(); |
|---|
| 559 | |
|---|
| 560 | } |
|---|
| 561 | |
|---|
| 562 | }//GEN-LAST:event_btnRemoveCurrentEventActionPerformed |
|---|
| 563 | |
|---|
| 564 | private void AudioActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_AudioActionPerformed |
|---|
| 565 | {//GEN-HEADEREND:event_AudioActionPerformed |
|---|
| 566 | // TODO add your handling code here: |
|---|
| 567 | }//GEN-LAST:event_AudioActionPerformed |
|---|
| 568 | |
|---|
| 569 | private void saveCloseBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveCloseBtnActionPerformed |
|---|
| 570 | // TODO add your handling code here: |
|---|
| 571 | //closes the current frame |
|---|
| 572 | |
|---|
| 573 | //updateEventTime(); |
|---|
| 574 | |
|---|
| 575 | updateEventTime(); |
|---|
| 576 | |
|---|
| 577 | model.closePanels(); |
|---|
| 578 | closeWindow(); |
|---|
| 579 | //this.dispatchEvent(new WindowEvent(this,WindowEvent.WINDOW_CLOSING)); |
|---|
| 580 | }//GEN-LAST:event_saveCloseBtnActionPerformed |
|---|
| 581 | |
|---|
| 582 | private void timeSecondComboSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeSecondComboSelectorActionPerformed |
|---|
| 583 | // TODO add your handling code here: |
|---|
| 584 | }//GEN-LAST:event_timeSecondComboSelectorActionPerformed |
|---|
| 585 | |
|---|
| 586 | private void timeMinuteComboSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeMinuteComboSelectorActionPerformed |
|---|
| 587 | // TODO add your handling code here: |
|---|
| 588 | }//GEN-LAST:event_timeMinuteComboSelectorActionPerformed |
|---|
| 589 | |
|---|
| 590 | private void timeHourComboSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeHourComboSelectorActionPerformed |
|---|
| 591 | // TODO add your handling code here: |
|---|
| 592 | }//GEN-LAST:event_timeHourComboSelectorActionPerformed |
|---|
| 593 | |
|---|
| 594 | private void updateEventTime() |
|---|
| 595 | { |
|---|
| 596 | |
|---|
| 597 | // String[] tokens = txtEventStart.getText().split(":"); |
|---|
| 598 | // |
|---|
| 599 | // int hrs = Integer.parseInt(tokens[0]); |
|---|
| 600 | // int mins = Integer.parseInt(tokens[1]); |
|---|
| 601 | // int secs = Integer.parseInt(tokens[2]); |
|---|
| 602 | int hrs = Integer.parseInt(timeHourComboSelector.getSelectedItem().toString()); |
|---|
| 603 | int mins = Integer.parseInt(timeMinuteComboSelector.getSelectedItem().toString()); |
|---|
| 604 | int secs = Integer.parseInt(timeSecondComboSelector.getSelectedItem().toString()); |
|---|
| 605 | |
|---|
| 606 | |
|---|
| 607 | int newTime = (3600 * hrs) + (60 * mins) + secs; |
|---|
| 608 | |
|---|
| 609 | int index = eventTabsPane.getSelectedIndex(); |
|---|
| 610 | |
|---|
| 611 | if (index >= 0 && eventTabsPane.getTabComponentAt(index) != null) |
|---|
| 612 | { |
|---|
| 613 | JPanel removable = (JPanel) eventTabsPane |
|---|
| 614 | .getSelectedComponent(); |
|---|
| 615 | I_ScriptEvent ise = this.model.eventMap.get(removable); |
|---|
| 616 | if (newTime != slice.getTime() && !(ise instanceof AudioEvent) && incident.changeEventStart(ise, slice.getTime(), newTime)) |
|---|
| 617 | { |
|---|
| 618 | this.model.properties.removeProperty(removable); |
|---|
| 619 | |
|---|
| 620 | } |
|---|
| 621 | // SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss"); |
|---|
| 622 | // df.setTimeZone(TimeZone.getTimeZone("GMT")); |
|---|
| 623 | // String eventTime = df.format(new Date(slice.getTime() * 1000)); |
|---|
| 624 | // txtEventStart.setText(eventTime); |
|---|
| 625 | } |
|---|
| 626 | slice.checkEmpty(); |
|---|
| 627 | } |
|---|
| 628 | // |
|---|
| 629 | // /** |
|---|
| 630 | // * @param args the command line arguments |
|---|
| 631 | // */ |
|---|
| 632 | // public static void main(String args[]) |
|---|
| 633 | // { |
|---|
| 634 | // java.awt.EventQueue.invokeLater(new Runnable() |
|---|
| 635 | // { |
|---|
| 636 | // public void run() |
|---|
| 637 | // { |
|---|
| 638 | // new Editor(new IncidentEditorFrame( |
|---|
| 639 | // new ScriptIncident(100, null, null, null), |
|---|
| 640 | // new ScriptBuilderFrame())).setVisible(true); |
|---|
| 641 | // } |
|---|
| 642 | // }); |
|---|
| 643 | // } |
|---|
| 644 | |
|---|
| 645 | // Variables declaration - do not modify//GEN-BEGIN:variables |
|---|
| 646 | private javax.swing.JCheckBoxMenuItem ATMS; |
|---|
| 647 | private javax.swing.JCheckBoxMenuItem ActivityLog; |
|---|
| 648 | private javax.swing.JMenuItem Audio; |
|---|
| 649 | private javax.swing.JCheckBoxMenuItem CAD; |
|---|
| 650 | private javax.swing.JMenuItem CADLog; |
|---|
| 651 | private javax.swing.JMenuItem CCTV; |
|---|
| 652 | private javax.swing.JCheckBoxMenuItem CHPRadio; |
|---|
| 653 | private javax.swing.JMenuItem CMS; |
|---|
| 654 | private javax.swing.JCheckBoxMenuItem Facilitator; |
|---|
| 655 | private javax.swing.JCheckBoxMenuItem MaintenanceRadio; |
|---|
| 656 | private javax.swing.JMenuItem Paramics; |
|---|
| 657 | private javax.swing.JCheckBoxMenuItem Radio; |
|---|
| 658 | private javax.swing.JCheckBoxMenuItem TMTRadio; |
|---|
| 659 | private javax.swing.JCheckBoxMenuItem Telephone; |
|---|
| 660 | private javax.swing.JMenuItem Tow; |
|---|
| 661 | private javax.swing.JMenuItem Unit; |
|---|
| 662 | private javax.swing.JMenuItem Witness; |
|---|
| 663 | private javax.swing.JPanel bottomFramePanel; |
|---|
| 664 | private javax.swing.JButton btnRemoveCurrentEvent; |
|---|
| 665 | private javax.swing.JMenuBar editorMenuBar; |
|---|
| 666 | private javax.swing.JTabbedPane eventTabsPane; |
|---|
| 667 | private javax.swing.JLabel jLabel1; |
|---|
| 668 | private javax.swing.JLabel jLabel2; |
|---|
| 669 | private javax.swing.JLabel jLabel3; |
|---|
| 670 | private javax.swing.JMenu menuAutoData; |
|---|
| 671 | private javax.swing.JMenu menuEvaluations; |
|---|
| 672 | private javax.swing.JMenu menuInstructor; |
|---|
| 673 | private javax.swing.JButton saveCloseBtn; |
|---|
| 674 | private javax.swing.JComboBox<String> timeHourComboSelector; |
|---|
| 675 | private javax.swing.JComboBox<String> timeMinuteComboSelector; |
|---|
| 676 | private javax.swing.JComboBox<String> timeSecondComboSelector; |
|---|
| 677 | // End of variables declaration//GEN-END:variables |
|---|
| 678 | |
|---|
| 679 | @Override |
|---|
| 680 | public void update(Observable o, Object arg) |
|---|
| 681 | { |
|---|
| 682 | |
|---|
| 683 | final PropertyUpdate update = (PropertyUpdate) arg; |
|---|
| 684 | final ImageIcon image = update.getPanel().getProperty().getImage(); |
|---|
| 685 | final String caption = update.getPanel().title(); |
|---|
| 686 | |
|---|
| 687 | final JLabel title = new JLabel(caption, image, JLabel.CENTER); |
|---|
| 688 | |
|---|
| 689 | /* |
|---|
| 690 | final BorderLayout layout = new BorderLayout(); |
|---|
| 691 | final JPanel title = new JPanel(layout); |
|---|
| 692 | title.setOpaque(false); |
|---|
| 693 | title.add(new JLabel(image), BorderLayout.WEST); |
|---|
| 694 | title.add(new JLabel(caption), BorderLayout.EAST); |
|---|
| 695 | */ |
|---|
| 696 | if (update.getType() == UpdateType.Add) |
|---|
| 697 | { |
|---|
| 698 | eventTabsPane.insertTab(null, null, |
|---|
| 699 | update.getPanel().getPanel(), null, update.getPosition()); |
|---|
| 700 | eventTabsPane.setTabComponentAt(update.getPosition(), title); |
|---|
| 701 | eventTabsPane.setSelectedIndex(update.getPosition()); |
|---|
| 702 | topFrame.repaint(); |
|---|
| 703 | } |
|---|
| 704 | else if (update.getType() == UpdateType.Remove) |
|---|
| 705 | { |
|---|
| 706 | eventTabsPane.remove(update.getPanel().getPanel()); |
|---|
| 707 | topFrame.repaint(); |
|---|
| 708 | } |
|---|
| 709 | else if (update.getType() == UpdateType.TitleChange) |
|---|
| 710 | { |
|---|
| 711 | final int index = eventTabsPane.indexOfComponent( |
|---|
| 712 | update.getPanel().getPanel()); |
|---|
| 713 | |
|---|
| 714 | new Thread(new Runnable() |
|---|
| 715 | { |
|---|
| 716 | public void run() |
|---|
| 717 | { |
|---|
| 718 | Color c = eventTabsPane.getForegroundAt(index); |
|---|
| 719 | eventTabsPane.setForegroundAt(index, Color.blue); |
|---|
| 720 | try |
|---|
| 721 | { |
|---|
| 722 | Thread.sleep(350); |
|---|
| 723 | } |
|---|
| 724 | catch (Exception e) |
|---|
| 725 | { |
|---|
| 726 | } |
|---|
| 727 | if (index < eventTabsPane.getTabCount()) |
|---|
| 728 | { |
|---|
| 729 | eventTabsPane.setTabComponentAt(index, title); |
|---|
| 730 | } |
|---|
| 731 | try |
|---|
| 732 | { |
|---|
| 733 | Thread.sleep(350); |
|---|
| 734 | } |
|---|
| 735 | catch (Exception e) |
|---|
| 736 | { |
|---|
| 737 | } |
|---|
| 738 | if (index < eventTabsPane.getTabCount()) |
|---|
| 739 | { |
|---|
| 740 | eventTabsPane.setForegroundAt(index, c); |
|---|
| 741 | } |
|---|
| 742 | } |
|---|
| 743 | }).start(); |
|---|
| 744 | } |
|---|
| 745 | else |
|---|
| 746 | { |
|---|
| 747 | throw new RuntimeException("UpdateType not accounted for"); |
|---|
| 748 | } |
|---|
| 749 | } |
|---|
| 750 | |
|---|
| 751 | } |
|---|