source: tmcsimulator-scriptbuilder/trunk/src/scriptbuilder/gui/IncidentEditorFrame.java @ 54

Revision 54, 86.8 KB checked in by bmcguffin, 9 years ago (diff)

Duplicated main ScriptBuilder? window. The new window will become the Incident Editor window (see Storyboard 2a-B). The main ScriptBuilder? window will become the Incident Combiner window (see storyboard 1a-B).

Line 
1/**
2 * Frame for the Individual Incident Editor.
3 *
4 * @author Bryan McGuffin
5 * @version 2017/08/08
6 */
7package scriptbuilder.gui;
8
9import java.awt.Adjustable;
10import java.awt.Color;
11import java.awt.Cursor;
12import java.awt.event.AdjustmentEvent;
13import java.awt.event.AdjustmentListener;
14import java.awt.event.KeyEvent;
15import java.awt.event.KeyListener;
16import java.io.File;
17import java.io.IOException;
18import java.util.ArrayList;
19import java.util.Observable;
20import java.util.Observer;
21import java.util.Properties;
22import java.util.Random;
23import java.util.logging.Level;
24import java.util.logging.Logger;
25import javax.swing.DefaultListModel;
26import javax.swing.JButton;
27import javax.swing.JFileChooser;
28import javax.swing.JOptionPane;
29import javax.swing.UIManager;
30import javax.swing.UnsupportedLookAndFeelException;
31import scriptbuilder.structures.ScriptEvent;
32import scriptbuilder.structures.ScriptEvent.ScriptEventType;
33import scriptbuilder.structures.ScriptIncident;
34import scriptbuilder.structures.ScriptIncident.IncidentFocusedEvent;
35import scriptbuilder.structures.ScriptIncident.SliceChangedEvent;
36import scriptbuilder.structures.SimulationScript;
37import scriptbuilder.structures.TimeSlice;
38import scriptbuilder.structures.events.I_ScriptEvent;
39
40/**
41 * GUI for the script builder. Contains all panels and editor elements. Performs
42 * updates to reflect script model, which it observes.
43 *
44 * @author Greg Eddington
45 * @author Bryan McGuffin
46 */
47public class IncidentEditorFrame extends javax.swing.JFrame implements Observer
48{
49   
50    /**
51     * The script incident currently being edited.
52     */
53    private ScriptIncident theIncident;
54   
55    /**
56     * The current type of selected event.
57     */
58    public ScriptEventType currentEventType;
59    /**
60     * A list of all the event type buttons.
61     */
62    private ArrayList<JButton> eventButtons = null;
63    /**
64     * True if we are currently editing an incident.
65     */
66    private boolean editingIncident;
67    /**
68     * Index of the previous incident.
69     */
70    int oldIncidentIndex;
71
72    /**
73     * Get the script currently in use.
74     *
75     * @return the script model object
76     */
77    public ScriptIncident getIncident()
78    {
79        return theIncident;
80    }
81
82    /**
83     * Listener for the scroll pane.
84     */
85    class MyAdjustmentListener implements AdjustmentListener
86    {
87
88        /**
89         * If the incident timeline is scrolled horizontally, the timestamp
90         * panel is updated to reflect it.
91         *
92         * @param evt the adjustment event
93         */
94        @Override
95        public void adjustmentValueChanged(AdjustmentEvent evt)
96        {
97            if (evt.getAdjustable().getOrientation() == Adjustable.HORIZONTAL)
98            {
99                timeStampScrollPane.getHorizontalScrollBar()
100                        .setValue(timelinesScrollPane.getHorizontalScrollBar().getValue());
101            }
102            else
103            {
104                // Event from vertical scrollbar
105            }
106
107            repaint();
108        }
109    }
110
111    /**
112     * Listener for key presses. Used for hotkeys for different event types.
113     */
114    private class TimelineKeyListener implements KeyListener
115    {
116
117        /**
118         * If a hotkey is pressed, select that type of event.
119         *
120         * @param e the key event
121         */
122        @Override
123        public void keyPressed(KeyEvent e)
124        {
125            JButton lastButton = null;
126            for (JButton eb : eventButtons)
127            {
128                eb.setFocusPainted(false);
129                if (eb.isSelected())
130                {
131                    lastButton = eb;
132                }
133                eb.setSelected(false);
134            }
135
136            JButton newButton = null;
137            switch (e.getKeyChar())
138            {
139                case 'u':
140                    currentEventType = ScriptEventType.AUDIO_EVENT;
141                    newButton = audioButton;
142                    break;
143                case 'c':
144                    currentEventType = ScriptEventType.CAD_EVENT;
145                    newButton = cadButton;
146                    break;
147                case 'v':
148                    currentEventType = ScriptEventType.CCTV_EVENT;
149                    newButton = cctvButton;
150                    break;
151                case 'h':
152                    currentEventType = ScriptEventType.CHP_RADIO_EVENT;
153                    newButton = chpRadioButton;
154                    break;
155                case 'p':
156                    currentEventType = ScriptEventType.PARAMICS_EVENT;
157                    newButton = paramicsButton;
158                    break;
159                case 'o':
160                    currentEventType = ScriptEventType.TOW_EVENT;
161                    newButton = towButton;
162                    break;
163                case 'n':
164                    currentEventType = ScriptEventType.UNIT_EVENT;
165                    newButton = unitButton;
166                    break;
167                case 'w':
168                    currentEventType = ScriptEventType.WITNESS_EVENT;
169                    newButton = witnessButton;
170                    break;
171                case 'm':
172                    currentEventType = ScriptEventType.MAINTENANCE_RADIO_EVENT;
173                    newButton = maintenanceRadioButton;
174                    break;
175                case 't':
176                    currentEventType = ScriptEventType.TMT_RADIO_EVENT;
177                    newButton = tmtRadioButton;
178                    break;
179                case 'e':
180                    currentEventType = ScriptEventType.TELEPHONE_EVENT;
181                    newButton = telephoneButton;
182                    break;
183                case 'a':
184                    currentEventType = ScriptEventType.ATMS_EVAL_EVENT;
185                    newButton = atmsEvalButton;
186                    break;
187                case 'l':
188                    currentEventType = ScriptEventType.ACTIVITY_LOG_EVAL_EVENT;
189                    newButton = activityLogEvalButton;
190                    break;
191                case 'd':
192                    currentEventType = ScriptEventType.CAD_EVAL_EVENT;
193                    newButton = cadEvalButton;
194                    break;
195                case 's':
196                    currentEventType = ScriptEventType.CMS_EVAL_EVENT;
197                    newButton = cmsEvalButton;
198                    break;
199                case 'f':
200                    currentEventType = ScriptEventType.FACILITATOR_EVAL_EVENT;
201                    newButton = facilitatorEvalButton;
202                    break;
203                case 'r':
204                    currentEventType = ScriptEventType.RADIO_EVAL_EVENT;
205                    newButton = radioEvalButton;
206                    break;
207                default:
208                    newButton = lastButton;
209            }
210
211            if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
212            {
213                currentEventType = null;
214                newButton = selectButton;
215            }
216
217            if (newButton != null)
218            {
219                newButton.setSelected(true);
220            }
221
222            repaint();
223        }
224
225        /**
226         * Take no action upon key release.
227         *
228         * @param e the key event
229         */
230        @Override
231        public void keyReleased(KeyEvent e)
232        {
233        }
234
235        /**
236         * Take no action upon key release.
237         *
238         * @param e the key event
239         */
240        @Override
241        public void keyTyped(KeyEvent e)
242        {
243        }
244    }
245
246    /**
247     * Constructor. Prep new script model, initialize the GUI, and add listeners
248     * for all buttons.
249     */
250    public IncidentEditorFrame(ScriptIncident theIncident)
251    {
252        this.theIncident = theIncident;
253        initComponents();
254        this.update(null, theIncident);
255        selectButton.addKeyListener(new TimelineKeyListener());
256        cadButton.addKeyListener(new TimelineKeyListener());
257        cctvButton.addKeyListener(new TimelineKeyListener());
258        chpRadioButton.addKeyListener(new TimelineKeyListener());
259        paramicsButton.addKeyListener(new TimelineKeyListener());
260        towButton.addKeyListener(new TimelineKeyListener());
261        unitButton.addKeyListener(new TimelineKeyListener());
262        witnessButton.addKeyListener(new TimelineKeyListener());
263        maintenanceRadioButton.addKeyListener(new TimelineKeyListener());
264        tmtRadioButton.addKeyListener(new TimelineKeyListener());
265        telephoneButton.addKeyListener(new TimelineKeyListener());
266        atmsEvalButton.addKeyListener(new TimelineKeyListener());
267        activityLogEvalButton.addKeyListener(new TimelineKeyListener());
268        cadEvalButton.addKeyListener(new TimelineKeyListener());
269        cmsEvalButton.addKeyListener(new TimelineKeyListener());
270        facilitatorEvalButton.addKeyListener(new TimelineKeyListener());
271        radioEvalButton.addKeyListener(new TimelineKeyListener());
272
273        // Hack to refresh the zoom
274        zoomSlider.setValue(zoomSlider.getValue() - 1);
275        zoomSlider.setValue(zoomSlider.getValue() + 1);
276
277        // Set listener for scroll pane
278        AdjustmentListener listener = new MyAdjustmentListener();
279        timelinesScrollPane.getHorizontalScrollBar().addAdjustmentListener(listener);
280        timelinesScrollPane.getVerticalScrollBar().addAdjustmentListener(listener);
281
282        // Button list
283        eventButtons = new ArrayList<JButton>();
284        eventButtons.add(maintenanceRadioButton);
285        eventButtons.add(tmtRadioButton);
286        eventButtons.add(telephoneButton);
287        eventButtons.add(paramicsButton);
288        eventButtons.add(towButton);
289        eventButtons.add(witnessButton);
290        eventButtons.add(unitButton);
291        eventButtons.add(audioButton);
292        eventButtons.add(cadButton);
293        eventButtons.add(cctvButton);
294        eventButtons.add(chpRadioButton);
295        eventButtons.add(selectButton);
296        eventButtons.add(cmsEvalButton);
297        eventButtons.add(atmsEvalButton);
298        eventButtons.add(cadEvalButton);
299        eventButtons.add(activityLogEvalButton);
300        eventButtons.add(facilitatorEvalButton);
301        eventButtons.add(radioEvalButton);
302    }
303
304    /**
305     * Update the GUI to reflect the model. If the script changed, update all
306     * the incident panels. If a timeslice changed, add any new events to the
307     * model. If an incident gained focus, update the incident info screen to
308     * display its details.
309     *
310     * @param o The observed object
311     * @param arg Either the script model or an incident event, depending on who
312     * called this update
313     */
314    @Override
315    public void update(Observable o, Object arg)
316    {
317        if (arg instanceof ScriptIncident)
318        {
319            theIncident = (ScriptIncident) arg;
320           
321            timelineTickPanel.update(theIncident);
322            timeStampPanel.update(theIncident);
323
324            incidentTimelinePanel1.timelinePanelUpdate(theIncident);
325
326            incidentNumberPanel1.update(theIncident);
327
328            /**
329             * DefaultComboBoxModel model = new DefaultComboBoxModel(); for
330             * (ScriptIncident i : script.incidents) { if (i != null)
331             * model.addElement(i); } gotoIncident.setModel(model);*
332             */
333            this.setPreferredSize(this.getSize());
334            pack();
335        }
336        else if (arg instanceof SliceChangedEvent)
337        {
338            TimeSlice slice = ((SliceChangedEvent) arg).slice;
339
340            DefaultListModel model = new DefaultListModel();
341            for (I_ScriptEvent e : slice.events)
342            {
343                model.addElement(e);
344            }
345            scriptEventsList.setModel(model);
346        }
347        else if (arg instanceof IncidentFocusedEvent)
348        {
349            ScriptIncident i = ((IncidentFocusedEvent) arg).incident;
350
351            incidentNumber.setText(Integer.toString(i.number));
352            incidentName.setText(i.name);
353            incidentDescription.setText(i.description);
354
355            //gotoIncident.setSelectedItem(i);
356        }
357    }
358
359    /**
360     * This method is called from within the constructor to initialize the form.
361     * WARNING: Do NOT modify this code. The content of this method is always
362     * regenerated by the Form Editor.
363     */
364    @SuppressWarnings("unchecked")
365    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
366    private void initComponents()
367    {
368
369        eventPopupMenu = new javax.swing.JPopupMenu();
370        cadEvent = new javax.swing.JMenuItem();
371        jMenuItem2 = new javax.swing.JMenuItem();
372        radioEvent = new javax.swing.JMenuItem();
373        jMenuItem4 = new javax.swing.JMenuItem();
374        jMenuItem5 = new javax.swing.JMenuItem();
375        jMenuItem6 = new javax.swing.JMenuItem();
376        cadEventFrame = new javax.swing.JFrame();
377        jLabel5 = new javax.swing.JLabel();
378        radioEventFrame = new javax.swing.JFrame();
379        radioTypeLabel = new javax.swing.JLabel();
380        jLabel7 = new javax.swing.JLabel();
381        radioTypeComboBox = new javax.swing.JComboBox();
382        radioMessageScrollPane = new javax.swing.JScrollPane();
383        radioMessage = new javax.swing.JTextArea();
384        okButton = new javax.swing.JButton();
385        cancelButton = new javax.swing.JButton();
386        eventListPopupMenu = new javax.swing.JPopupMenu();
387        editEventList = new javax.swing.JMenuItem();
388        deleteEventList = new javax.swing.JMenuItem();
389        addNoiseFrame = new javax.swing.JFrame();
390        jLabel13 = new javax.swing.JLabel();
391        jSlider1 = new javax.swing.JSlider();
392        jSlider2 = new javax.swing.JSlider();
393        jLabel14 = new javax.swing.JLabel();
394        jSlider3 = new javax.swing.JSlider();
395        jLabel15 = new javax.swing.JLabel();
396        jTextArea1 = new javax.swing.JTextArea();
397        jSlider4 = new javax.swing.JSlider();
398        jLabel16 = new javax.swing.JLabel();
399        jSlider5 = new javax.swing.JSlider();
400        jLabel17 = new javax.swing.JLabel();
401        jButton1 = new javax.swing.JButton();
402        jButton2 = new javax.swing.JButton();
403        jLabel20 = new javax.swing.JLabel();
404        jLabel21 = new javax.swing.JLabel();
405        timelinesScrollPane = new javax.swing.JScrollPane();
406        timelineTickPanel = new scriptbuilder.gui.panels.TimelineTickPanel();
407        incidentTimelinePanel1 = new scriptbuilder.gui.panels.ScriptBuilderTimelinePanel();
408        incidentNumberPanel1 = new scriptbuilder.gui.panels.ScriptBuilderNumberPanel();
409        scriptEventsPanel = new javax.swing.JPanel();
410        scriptEventsPane = new javax.swing.JScrollPane();
411        scriptEventsList = new javax.swing.JList();
412        zoomSlider = new javax.swing.JSlider();
413        scriptEventsPanel1 = new javax.swing.JPanel();
414        jLabel2 = new javax.swing.JLabel();
415        jLabel3 = new javax.swing.JLabel();
416        jLabel4 = new javax.swing.JLabel();
417        incidentName = new javax.swing.JTextField();
418        incidentDescriptionPane = new javax.swing.JScrollPane();
419        incidentDescription = new javax.swing.JTextArea();
420        incidentNumber = new javax.swing.JTextField();
421        selectButton = new javax.swing.JButton();
422        incidentEventsPanel = new javax.swing.JPanel();
423        maintenanceRadioButton = new javax.swing.JButton();
424        tmtRadioButton = new javax.swing.JButton();
425        telephoneButton = new javax.swing.JButton();
426        unitButton = new javax.swing.JButton();
427        witnessButton = new javax.swing.JButton();
428        paramicsButton = new javax.swing.JButton();
429        towButton = new javax.swing.JButton();
430        audioButton = new javax.swing.JButton();
431        cctvButton = new javax.swing.JButton();
432        cadButton = new javax.swing.JButton();
433        chpRadioButton = new javax.swing.JButton();
434        evaluationEventsPanel = new javax.swing.JPanel();
435        atmsEvalButton = new javax.swing.JButton();
436        cmsEvalButton = new javax.swing.JButton();
437        cadEvalButton = new javax.swing.JButton();
438        facilitatorEvalButton = new javax.swing.JButton();
439        activityLogEvalButton = new javax.swing.JButton();
440        radioEvalButton = new javax.swing.JButton();
441        zoomInIcon = new javax.swing.JLabel();
442        zoomOutIcon = new javax.swing.JLabel();
443        timeStampScrollPane = new javax.swing.JScrollPane();
444        timeStampPanel = new scriptbuilder.gui.panels.TimeStampPanel();
445
446        cadEvent.setText("CAD Event");
447        cadEvent.addMouseListener(new java.awt.event.MouseAdapter()
448        {
449            public void mousePressed(java.awt.event.MouseEvent evt)
450            {
451                cadEventMousePressed(evt);
452            }
453            public void mouseReleased(java.awt.event.MouseEvent evt)
454            {
455                cadEventMouseReleased(evt);
456            }
457        });
458        eventPopupMenu.add(cadEvent);
459
460        jMenuItem2.setText("Paramics Event");
461        eventPopupMenu.add(jMenuItem2);
462
463        radioEvent.setText("Radio Event");
464        radioEvent.addMouseListener(new java.awt.event.MouseAdapter()
465        {
466            public void mousePressed(java.awt.event.MouseEvent evt)
467            {
468                radioEventMousePressed(evt);
469            }
470        });
471        eventPopupMenu.add(radioEvent);
472
473        jMenuItem4.setText("Telephone Event");
474        eventPopupMenu.add(jMenuItem4);
475
476        jMenuItem5.setText("Video Event");
477        eventPopupMenu.add(jMenuItem5);
478
479        jMenuItem6.setText("Evaluation Event");
480        eventPopupMenu.add(jMenuItem6);
481
482        cadEventFrame.setMinimumSize(new java.awt.Dimension(400, 300));
483
484        jLabel5.setText("CAD Entry");
485
486        javax.swing.GroupLayout cadEventFrameLayout = new javax.swing.GroupLayout(cadEventFrame.getContentPane());
487        cadEventFrame.getContentPane().setLayout(cadEventFrameLayout);
488        cadEventFrameLayout.setHorizontalGroup(
489            cadEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
490            .addGroup(cadEventFrameLayout.createSequentialGroup()
491                .addContainerGap()
492                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
493                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
494        );
495        cadEventFrameLayout.setVerticalGroup(
496            cadEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
497            .addGroup(cadEventFrameLayout.createSequentialGroup()
498                .addContainerGap()
499                .addComponent(jLabel5)
500                .addContainerGap(1357, Short.MAX_VALUE))
501        );
502
503        radioEventFrame.setTitle("Add Radio Event");
504        radioEventFrame.setMinimumSize(new java.awt.Dimension(400, 300));
505
506        radioTypeLabel.setText("Radio Type:");
507
508        jLabel7.setText("Radio Message:");
509
510        radioTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TMT", "Maintanence" }));
511
512        radioMessageScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
513
514        radioMessage.setColumns(20);
515        radioMessage.setLineWrap(true);
516        radioMessage.setRows(5);
517        radioMessage.setWrapStyleWord(true);
518        radioMessageScrollPane.setViewportView(radioMessage);
519
520        okButton.setText("OK");
521        okButton.addActionListener(new java.awt.event.ActionListener()
522        {
523            public void actionPerformed(java.awt.event.ActionEvent evt)
524            {
525                okButtonActionPerformed(evt);
526            }
527        });
528
529        cancelButton.setText("Cancel");
530        cancelButton.addActionListener(new java.awt.event.ActionListener()
531        {
532            public void actionPerformed(java.awt.event.ActionEvent evt)
533            {
534                cancelButtonActionPerformed(evt);
535            }
536        });
537
538        javax.swing.GroupLayout radioEventFrameLayout = new javax.swing.GroupLayout(radioEventFrame.getContentPane());
539        radioEventFrame.getContentPane().setLayout(radioEventFrameLayout);
540        radioEventFrameLayout.setHorizontalGroup(
541            radioEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
542            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, radioEventFrameLayout.createSequentialGroup()
543                .addContainerGap()
544                .addGroup(radioEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
545                    .addComponent(radioMessageScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
546                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, radioEventFrameLayout.createSequentialGroup()
547                        .addComponent(radioTypeLabel)
548                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
549                        .addComponent(radioTypeComboBox, 0, 312, Short.MAX_VALUE))
550                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING)
551                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, radioEventFrameLayout.createSequentialGroup()
552                        .addComponent(cancelButton)
553                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 246, Short.MAX_VALUE)
554                        .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)))
555                .addContainerGap())
556        );
557        radioEventFrameLayout.setVerticalGroup(
558            radioEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
559            .addGroup(radioEventFrameLayout.createSequentialGroup()
560                .addContainerGap()
561                .addGroup(radioEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
562                    .addComponent(radioTypeLabel)
563                    .addComponent(radioTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
564                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
565                .addComponent(jLabel7)
566                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
567                .addComponent(radioMessageScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)
568                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
569                .addGroup(radioEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
570                    .addComponent(okButton)
571                    .addComponent(cancelButton))
572                .addContainerGap())
573        );
574
575        editEventList.setText("Edit...");
576        editEventList.addActionListener(new java.awt.event.ActionListener()
577        {
578            public void actionPerformed(java.awt.event.ActionEvent evt)
579            {
580                editEventListActionPerformed(evt);
581            }
582        });
583        eventListPopupMenu.add(editEventList);
584
585        deleteEventList.setText("Delete...");
586        eventListPopupMenu.add(deleteEventList);
587
588        addNoiseFrame.setTitle("Generate Noise");
589        addNoiseFrame.setMinimumSize(new java.awt.Dimension(395, 315));
590        addNoiseFrame.setResizable(false);
591
592        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
593        jLabel13.setText("Radio Chatter: ");
594
595        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
596        jLabel14.setText("Lane Closures:");
597
598        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
599        jLabel15.setText("TMCAL Logs:");
600
601        jTextArea1.setEditable(false);
602        jTextArea1.setColumns(20);
603        jTextArea1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
604        jTextArea1.setLineWrap(true);
605        jTextArea1.setRows(5);
606        jTextArea1.setText("Noise events will be randomly generated for the simulation with frequencies based on the control selections made below");
607        jTextArea1.setWrapStyleWord(true);
608        jTextArea1.setAutoscrolls(false);
609        jTextArea1.setBorder(null);
610        jTextArea1.setDisabledTextColor(new java.awt.Color(0, 0, 0));
611        jTextArea1.setFocusable(false);
612        jTextArea1.setOpaque(false);
613
614        jLabel16.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
615        jLabel16.setText("Background Noise: ");
616
617        jLabel17.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
618        jLabel17.setText("Minor Events:");
619
620        jButton1.setText("Cancel");
621        jButton1.addActionListener(new java.awt.event.ActionListener()
622        {
623            public void actionPerformed(java.awt.event.ActionEvent evt)
624            {
625                jButton1ActionPerformed(evt);
626            }
627        });
628
629        jButton2.setText("Generate");
630        jButton2.addActionListener(new java.awt.event.ActionListener()
631        {
632            public void actionPerformed(java.awt.event.ActionEvent evt)
633            {
634                jButton2ActionPerformed(evt);
635            }
636        });
637
638        jLabel20.setText("Least Frequent");
639
640        jLabel21.setText("Most Frequent");
641
642        javax.swing.GroupLayout addNoiseFrameLayout = new javax.swing.GroupLayout(addNoiseFrame.getContentPane());
643        addNoiseFrame.getContentPane().setLayout(addNoiseFrameLayout);
644        addNoiseFrameLayout.setHorizontalGroup(
645            addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
646            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addNoiseFrameLayout.createSequentialGroup()
647                .addContainerGap(21, Short.MAX_VALUE)
648                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
649                    .addComponent(jTextArea1, javax.swing.GroupLayout.Alignment.LEADING)
650                    .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
651                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, addNoiseFrameLayout.createSequentialGroup()
652                            .addComponent(jButton1)
653                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
654                            .addComponent(jButton2))
655                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, addNoiseFrameLayout.createSequentialGroup()
656                            .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
657                                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
658                                    .addComponent(jLabel16)
659                                    .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
660                                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
661                                    .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
662                                .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
663                            .addGap(4, 4, 4)
664                            .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
665                                .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
666                                .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
667                                .addComponent(jSlider3, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
668                                .addComponent(jSlider5, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
669                                .addComponent(jSlider4, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
670                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addNoiseFrameLayout.createSequentialGroup()
671                                    .addComponent(jLabel20)
672                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
673                                    .addComponent(jLabel21))))))
674                .addGap(20, 20, 20))
675        );
676        addNoiseFrameLayout.setVerticalGroup(
677            addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
678            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addNoiseFrameLayout.createSequentialGroup()
679                .addContainerGap()
680                .addComponent(jTextArea1, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)
681                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
682                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
683                    .addComponent(jLabel21)
684                    .addComponent(jLabel20))
685                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
686                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
687                    .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
688                    .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
689                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
690                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
691                    .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
692                    .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
693                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
694                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
695                    .addComponent(jLabel15)
696                    .addComponent(jSlider3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
697                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
698                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
699                    .addComponent(jSlider4, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
700                    .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
701                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
702                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
703                    .addComponent(jSlider5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
704                    .addComponent(jLabel17))
705                .addGap(18, 18, 18)
706                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
707                    .addComponent(jButton1)
708                    .addComponent(jButton2))
709                .addContainerGap())
710        );
711
712        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
713        setTitle("Script Builder");
714        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
715        setMinimumSize(new java.awt.Dimension(800, 800));
716
717        timelinesScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
718        timelinesScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
719        timelinesScrollPane.setFocusCycleRoot(true);
720        timelinesScrollPane.setFocusTraversalPolicyProvider(true);
721        timelinesScrollPane.setPreferredSize(new java.awt.Dimension(72000, 1341));
722
723        timelineTickPanel.setMaximumSize(new java.awt.Dimension(7200, 32767));
724        timelineTickPanel.setMinimumSize(new java.awt.Dimension(7200, 0));
725        timelineTickPanel.setPreferredSize(new java.awt.Dimension(7200, 1317));
726
727        incidentTimelinePanel1.setMaximumSize(new java.awt.Dimension(32767, 100));
728        incidentTimelinePanel1.setOpaque(false);
729        incidentTimelinePanel1.setPreferredSize(new java.awt.Dimension(691, 100));
730
731        javax.swing.GroupLayout incidentTimelinePanel1Layout = new javax.swing.GroupLayout(incidentTimelinePanel1);
732        incidentTimelinePanel1.setLayout(incidentTimelinePanel1Layout);
733        incidentTimelinePanel1Layout.setHorizontalGroup(
734            incidentTimelinePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
735            .addGap(0, 6776, Short.MAX_VALUE)
736        );
737        incidentTimelinePanel1Layout.setVerticalGroup(
738            incidentTimelinePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
739            .addGap(0, 334, Short.MAX_VALUE)
740        );
741
742        incidentNumberPanel1.setOpaque(false);
743
744        javax.swing.GroupLayout incidentNumberPanel1Layout = new javax.swing.GroupLayout(incidentNumberPanel1);
745        incidentNumberPanel1.setLayout(incidentNumberPanel1Layout);
746        incidentNumberPanel1Layout.setHorizontalGroup(
747            incidentNumberPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
748            .addGap(0, 106, Short.MAX_VALUE)
749        );
750        incidentNumberPanel1Layout.setVerticalGroup(
751            incidentNumberPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
752            .addGap(0, 0, Short.MAX_VALUE)
753        );
754
755        javax.swing.GroupLayout timelineTickPanelLayout = new javax.swing.GroupLayout(timelineTickPanel);
756        timelineTickPanel.setLayout(timelineTickPanelLayout);
757        timelineTickPanelLayout.setHorizontalGroup(
758            timelineTickPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
759            .addGroup(timelineTickPanelLayout.createSequentialGroup()
760                .addContainerGap()
761                .addComponent(incidentNumberPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
762                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
763                .addComponent(incidentTimelinePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 6776, javax.swing.GroupLayout.PREFERRED_SIZE)
764                .addContainerGap(300, Short.MAX_VALUE))
765        );
766        timelineTickPanelLayout.setVerticalGroup(
767            timelineTickPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
768            .addGroup(timelineTickPanelLayout.createSequentialGroup()
769                .addContainerGap()
770                .addGroup(timelineTickPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
771                    .addComponent(incidentTimelinePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE)
772                    .addComponent(incidentNumberPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
773                .addContainerGap(977, Short.MAX_VALUE))
774        );
775
776        timelinesScrollPane.setViewportView(timelineTickPanel);
777
778        scriptEventsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Script Events"));
779
780        scriptEventsPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
781
782        scriptEventsList.setModel(new DefaultListModel());
783        scriptEventsList.setComponentPopupMenu(eventListPopupMenu);
784        scriptEventsPane.setViewportView(scriptEventsList);
785
786        javax.swing.GroupLayout scriptEventsPanelLayout = new javax.swing.GroupLayout(scriptEventsPanel);
787        scriptEventsPanel.setLayout(scriptEventsPanelLayout);
788        scriptEventsPanelLayout.setHorizontalGroup(
789            scriptEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
790            .addGroup(scriptEventsPanelLayout.createSequentialGroup()
791                .addContainerGap()
792                .addComponent(scriptEventsPane)
793                .addContainerGap())
794        );
795        scriptEventsPanelLayout.setVerticalGroup(
796            scriptEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
797            .addGroup(scriptEventsPanelLayout.createSequentialGroup()
798                .addComponent(scriptEventsPane, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
799                .addContainerGap())
800        );
801
802        zoomSlider.setMaximum(21);
803        zoomSlider.setMinimum(5);
804        zoomSlider.setOrientation(javax.swing.JSlider.VERTICAL);
805        zoomSlider.setValue(13);
806        zoomSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
807        zoomSlider.setFocusable(false);
808        zoomSlider.addChangeListener(new javax.swing.event.ChangeListener()
809        {
810            public void stateChanged(javax.swing.event.ChangeEvent evt)
811            {
812                zoomSliderStateChanged(evt);
813            }
814        });
815
816        scriptEventsPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Incident Information"));
817
818        jLabel2.setText("Incident Number:");
819
820        jLabel3.setText("Incident Name:");
821
822        jLabel4.setText("Incident Description:");
823
824        incidentName.setEditable(false);
825        incidentName.setText("Media");
826
827        incidentDescriptionPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
828
829        incidentDescription.setColumns(20);
830        incidentDescription.setEditable(false);
831        incidentDescription.setLineWrap(true);
832        incidentDescription.setRows(5);
833        incidentDescription.setText("All media message events are found in this incident.");
834        incidentDescription.setWrapStyleWord(true);
835        incidentDescriptionPane.setViewportView(incidentDescription);
836
837        incidentNumber.setEditable(false);
838        incidentNumber.setText("100");
839
840        javax.swing.GroupLayout scriptEventsPanel1Layout = new javax.swing.GroupLayout(scriptEventsPanel1);
841        scriptEventsPanel1.setLayout(scriptEventsPanel1Layout);
842        scriptEventsPanel1Layout.setHorizontalGroup(
843            scriptEventsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
844            .addGroup(scriptEventsPanel1Layout.createSequentialGroup()
845                .addContainerGap()
846                .addGroup(scriptEventsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
847                    .addComponent(incidentDescriptionPane, javax.swing.GroupLayout.Alignment.TRAILING)
848                    .addComponent(jLabel4)
849                    .addGroup(scriptEventsPanel1Layout.createSequentialGroup()
850                        .addGroup(scriptEventsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
851                            .addComponent(jLabel2)
852                            .addComponent(jLabel3))
853                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
854                        .addGroup(scriptEventsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
855                            .addComponent(incidentName)
856                            .addComponent(incidentNumber))))
857                .addContainerGap())
858        );
859        scriptEventsPanel1Layout.setVerticalGroup(
860            scriptEventsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
861            .addGroup(scriptEventsPanel1Layout.createSequentialGroup()
862                .addGroup(scriptEventsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
863                    .addComponent(jLabel2)
864                    .addComponent(incidentNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
865                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
866                .addGroup(scriptEventsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
867                    .addComponent(incidentName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
868                    .addComponent(jLabel3))
869                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
870                .addComponent(jLabel4)
871                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
872                .addComponent(incidentDescriptionPane, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE)
873                .addContainerGap())
874        );
875
876        selectButton.setToolTipText("Select");
877        selectButton.setFocusPainted(false);
878        selectButton.setIconTextGap(0);
879        selectButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
880        selectButton.setPreferredSize(new java.awt.Dimension(30, 25));
881        selectButton.addActionListener(new java.awt.event.ActionListener()
882        {
883            public void actionPerformed(java.awt.event.ActionEvent evt)
884            {
885                selectButtonActionPerformed(evt);
886            }
887        });
888
889        incidentEventsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Incident Events"));
890
891        maintenanceRadioButton.setText("Maintenance Radio");
892        maintenanceRadioButton.setToolTipText("");
893        maintenanceRadioButton.setFocusPainted(false);
894        maintenanceRadioButton.setIconTextGap(0);
895        maintenanceRadioButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
896        maintenanceRadioButton.setPreferredSize(new java.awt.Dimension(30, 25));
897        maintenanceRadioButton.addActionListener(new java.awt.event.ActionListener()
898        {
899            public void actionPerformed(java.awt.event.ActionEvent evt)
900            {
901                maintenanceRadioButtonActionPerformed(evt);
902            }
903        });
904
905        tmtRadioButton.setText("TMT Radio");
906        tmtRadioButton.setToolTipText("");
907        tmtRadioButton.setFocusPainted(false);
908        tmtRadioButton.setIconTextGap(0);
909        tmtRadioButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
910        tmtRadioButton.setPreferredSize(new java.awt.Dimension(30, 25));
911        tmtRadioButton.addActionListener(new java.awt.event.ActionListener()
912        {
913            public void actionPerformed(java.awt.event.ActionEvent evt)
914            {
915                tmtRadioButtonActionPerformed(evt);
916            }
917        });
918
919        telephoneButton.setText("Telephone");
920        telephoneButton.setToolTipText("");
921        telephoneButton.setFocusPainted(false);
922        telephoneButton.setIconTextGap(0);
923        telephoneButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
924        telephoneButton.setPreferredSize(new java.awt.Dimension(30, 25));
925        telephoneButton.addActionListener(new java.awt.event.ActionListener()
926        {
927            public void actionPerformed(java.awt.event.ActionEvent evt)
928            {
929                telephoneButtonActionPerformed(evt);
930            }
931        });
932
933        unitButton.setText("Unit");
934        unitButton.setToolTipText("");
935        unitButton.setFocusPainted(false);
936        unitButton.setIconTextGap(0);
937        unitButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
938        unitButton.setPreferredSize(new java.awt.Dimension(30, 25));
939        unitButton.addActionListener(new java.awt.event.ActionListener()
940        {
941            public void actionPerformed(java.awt.event.ActionEvent evt)
942            {
943                unitButtonActionPerformed(evt);
944            }
945        });
946
947        witnessButton.setText("Witness");
948        witnessButton.setToolTipText("");
949        witnessButton.setFocusPainted(false);
950        witnessButton.setIconTextGap(0);
951        witnessButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
952        witnessButton.setPreferredSize(new java.awt.Dimension(30, 25));
953        witnessButton.addActionListener(new java.awt.event.ActionListener()
954        {
955            public void actionPerformed(java.awt.event.ActionEvent evt)
956            {
957                witnessButtonActionPerformed(evt);
958            }
959        });
960
961        paramicsButton.setText("Paramics");
962        paramicsButton.setToolTipText("");
963        paramicsButton.setFocusPainted(false);
964        paramicsButton.setIconTextGap(0);
965        paramicsButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
966        paramicsButton.setPreferredSize(new java.awt.Dimension(30, 25));
967        paramicsButton.addActionListener(new java.awt.event.ActionListener()
968        {
969            public void actionPerformed(java.awt.event.ActionEvent evt)
970            {
971                paramicsButtonActionPerformed(evt);
972            }
973        });
974
975        towButton.setText("Tow");
976        towButton.setToolTipText("");
977        towButton.setFocusPainted(false);
978        towButton.setIconTextGap(0);
979        towButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
980        towButton.setPreferredSize(new java.awt.Dimension(30, 25));
981        towButton.addActionListener(new java.awt.event.ActionListener()
982        {
983            public void actionPerformed(java.awt.event.ActionEvent evt)
984            {
985                towButtonActionPerformed(evt);
986            }
987        });
988
989        audioButton.setText("Audio");
990        audioButton.setToolTipText("");
991        audioButton.setFocusPainted(false);
992        audioButton.setIconTextGap(0);
993        audioButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
994        audioButton.setPreferredSize(new java.awt.Dimension(30, 25));
995        audioButton.addActionListener(new java.awt.event.ActionListener()
996        {
997            public void actionPerformed(java.awt.event.ActionEvent evt)
998            {
999                audioButtonActionPerformed(evt);
1000            }
1001        });
1002
1003        cctvButton.setText("CCTV");
1004        cctvButton.setToolTipText("");
1005        cctvButton.setFocusPainted(false);
1006        cctvButton.setIconTextGap(0);
1007        cctvButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1008        cctvButton.setPreferredSize(new java.awt.Dimension(30, 25));
1009        cctvButton.addActionListener(new java.awt.event.ActionListener()
1010        {
1011            public void actionPerformed(java.awt.event.ActionEvent evt)
1012            {
1013                cctvButtonActionPerformed(evt);
1014            }
1015        });
1016
1017        cadButton.setText("CAD");
1018        cadButton.setToolTipText("");
1019        cadButton.setFocusPainted(false);
1020        cadButton.setIconTextGap(0);
1021        cadButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1022        cadButton.setPreferredSize(new java.awt.Dimension(30, 25));
1023        cadButton.addActionListener(new java.awt.event.ActionListener()
1024        {
1025            public void actionPerformed(java.awt.event.ActionEvent evt)
1026            {
1027                cadButtonActionPerformed(evt);
1028            }
1029        });
1030
1031        chpRadioButton.setText("CHP Radio");
1032        chpRadioButton.setToolTipText("");
1033        chpRadioButton.setFocusPainted(false);
1034        chpRadioButton.setIconTextGap(0);
1035        chpRadioButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1036        chpRadioButton.setPreferredSize(new java.awt.Dimension(30, 25));
1037        chpRadioButton.addActionListener(new java.awt.event.ActionListener()
1038        {
1039            public void actionPerformed(java.awt.event.ActionEvent evt)
1040            {
1041                chpRadioButtonActionPerformed(evt);
1042            }
1043        });
1044
1045        javax.swing.GroupLayout incidentEventsPanelLayout = new javax.swing.GroupLayout(incidentEventsPanel);
1046        incidentEventsPanel.setLayout(incidentEventsPanelLayout);
1047        incidentEventsPanelLayout.setHorizontalGroup(
1048            incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1049            .addGroup(incidentEventsPanelLayout.createSequentialGroup()
1050                .addContainerGap()
1051                .addGroup(incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1052                    .addGroup(incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1053                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, incidentEventsPanelLayout.createSequentialGroup()
1054                            .addComponent(maintenanceRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
1055                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1056                            .addComponent(tmtRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
1057                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1058                            .addComponent(telephoneButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
1059                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1060                            .addComponent(paramicsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
1061                        .addGroup(incidentEventsPanelLayout.createSequentialGroup()
1062                            .addComponent(towButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
1063                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1064                            .addComponent(unitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
1065                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1066                            .addComponent(witnessButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
1067                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1068                            .addComponent(audioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
1069                    .addGroup(incidentEventsPanelLayout.createSequentialGroup()
1070                        .addComponent(cadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
1071                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1072                        .addComponent(cctvButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
1073                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1074                        .addComponent(chpRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
1075                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1076        );
1077        incidentEventsPanelLayout.setVerticalGroup(
1078            incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1079            .addGroup(incidentEventsPanelLayout.createSequentialGroup()
1080                .addGroup(incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1081                    .addGroup(incidentEventsPanelLayout.createSequentialGroup()
1082                        .addGroup(incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1083                            .addComponent(maintenanceRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1084                            .addComponent(tmtRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1085                            .addComponent(telephoneButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
1086                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1087                        .addGroup(incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1088                            .addComponent(towButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1089                            .addComponent(unitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1090                            .addComponent(witnessButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1091                            .addComponent(audioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)))
1092                    .addComponent(paramicsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
1093                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1094                .addGroup(incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
1095                    .addGroup(incidentEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1096                        .addComponent(cctvButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1097                        .addComponent(chpRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
1098                    .addComponent(cadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)))
1099        );
1100
1101        evaluationEventsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Evaluation Events"));
1102
1103        atmsEvalButton.setText("ATMS Evaluation");
1104        atmsEvalButton.setToolTipText("");
1105        atmsEvalButton.setFocusPainted(false);
1106        atmsEvalButton.setIconTextGap(0);
1107        atmsEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1108        atmsEvalButton.setPreferredSize(new java.awt.Dimension(30, 25));
1109        atmsEvalButton.addActionListener(new java.awt.event.ActionListener()
1110        {
1111            public void actionPerformed(java.awt.event.ActionEvent evt)
1112            {
1113                atmsEvalButtonActionPerformed(evt);
1114            }
1115        });
1116
1117        cmsEvalButton.setText("CMS Evaluation");
1118        cmsEvalButton.setToolTipText("");
1119        cmsEvalButton.setFocusPainted(false);
1120        cmsEvalButton.setIconTextGap(0);
1121        cmsEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1122        cmsEvalButton.setPreferredSize(new java.awt.Dimension(30, 25));
1123        cmsEvalButton.addActionListener(new java.awt.event.ActionListener()
1124        {
1125            public void actionPerformed(java.awt.event.ActionEvent evt)
1126            {
1127                cmsEvalButtonActionPerformed(evt);
1128            }
1129        });
1130
1131        cadEvalButton.setText("CAD Evaluation");
1132        cadEvalButton.setToolTipText("");
1133        cadEvalButton.setFocusPainted(false);
1134        cadEvalButton.setIconTextGap(0);
1135        cadEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1136        cadEvalButton.setPreferredSize(new java.awt.Dimension(30, 25));
1137        cadEvalButton.addActionListener(new java.awt.event.ActionListener()
1138        {
1139            public void actionPerformed(java.awt.event.ActionEvent evt)
1140            {
1141                cadEvalButtonActionPerformed(evt);
1142            }
1143        });
1144
1145        facilitatorEvalButton.setText("Facilitator Evaluation");
1146        facilitatorEvalButton.setToolTipText("");
1147        facilitatorEvalButton.setFocusPainted(false);
1148        facilitatorEvalButton.setIconTextGap(0);
1149        facilitatorEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1150        facilitatorEvalButton.setPreferredSize(new java.awt.Dimension(30, 25));
1151        facilitatorEvalButton.addActionListener(new java.awt.event.ActionListener()
1152        {
1153            public void actionPerformed(java.awt.event.ActionEvent evt)
1154            {
1155                facilitatorEvalButtonActionPerformed(evt);
1156            }
1157        });
1158
1159        activityLogEvalButton.setText("Activity Log Evaluation");
1160        activityLogEvalButton.setToolTipText("");
1161        activityLogEvalButton.setFocusPainted(false);
1162        activityLogEvalButton.setIconTextGap(0);
1163        activityLogEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1164        activityLogEvalButton.setPreferredSize(new java.awt.Dimension(30, 25));
1165        activityLogEvalButton.addActionListener(new java.awt.event.ActionListener()
1166        {
1167            public void actionPerformed(java.awt.event.ActionEvent evt)
1168            {
1169                activityLogEvalButtonActionPerformed(evt);
1170            }
1171        });
1172
1173        radioEvalButton.setText("Radio Evaluation");
1174        radioEvalButton.setToolTipText("");
1175        radioEvalButton.setFocusPainted(false);
1176        radioEvalButton.setIconTextGap(0);
1177        radioEvalButton.setMargin(new java.awt.Insets(2, 10, 2, 10));
1178        radioEvalButton.setPreferredSize(new java.awt.Dimension(30, 25));
1179        radioEvalButton.addActionListener(new java.awt.event.ActionListener()
1180        {
1181            public void actionPerformed(java.awt.event.ActionEvent evt)
1182            {
1183                radioEvalButtonActionPerformed(evt);
1184            }
1185        });
1186
1187        javax.swing.GroupLayout evaluationEventsPanelLayout = new javax.swing.GroupLayout(evaluationEventsPanel);
1188        evaluationEventsPanel.setLayout(evaluationEventsPanelLayout);
1189        evaluationEventsPanelLayout.setHorizontalGroup(
1190            evaluationEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1191            .addGroup(evaluationEventsPanelLayout.createSequentialGroup()
1192                .addContainerGap()
1193                .addGroup(evaluationEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1194                    .addGroup(evaluationEventsPanelLayout.createSequentialGroup()
1195                        .addComponent(atmsEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
1196                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1197                        .addComponent(activityLogEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
1198                    .addGroup(evaluationEventsPanelLayout.createSequentialGroup()
1199                        .addComponent(cmsEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
1200                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1201                        .addComponent(facilitatorEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
1202                    .addGroup(evaluationEventsPanelLayout.createSequentialGroup()
1203                        .addComponent(cadEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
1204                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1205                        .addComponent(radioEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)))
1206                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1207        );
1208        evaluationEventsPanelLayout.setVerticalGroup(
1209            evaluationEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1210            .addGroup(evaluationEventsPanelLayout.createSequentialGroup()
1211                .addGroup(evaluationEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1212                    .addComponent(cmsEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1213                    .addComponent(facilitatorEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
1214                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1215                .addGroup(evaluationEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1216                    .addComponent(atmsEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1217                    .addComponent(activityLogEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
1218                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1219                .addGroup(evaluationEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
1220                    .addComponent(cadEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
1221                    .addComponent(radioEvalButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)))
1222        );
1223
1224        zoomInIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ZoomIn.png"))); // NOI18N
1225        zoomInIcon.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
1226        zoomInIcon.addMouseListener(new java.awt.event.MouseAdapter()
1227        {
1228            public void mouseClicked(java.awt.event.MouseEvent evt)
1229            {
1230                zoomInIconMouseClicked(evt);
1231            }
1232        });
1233
1234        zoomOutIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ZoomOut.png"))); // NOI18N
1235        zoomOutIcon.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
1236        zoomOutIcon.addMouseListener(new java.awt.event.MouseAdapter()
1237        {
1238            public void mouseClicked(java.awt.event.MouseEvent evt)
1239            {
1240                zoomOutIconMouseClicked(evt);
1241            }
1242        });
1243
1244        timeStampScrollPane.setBorder(null);
1245        timeStampScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
1246        timeStampScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
1247
1248        javax.swing.GroupLayout timeStampPanelLayout = new javax.swing.GroupLayout(timeStampPanel);
1249        timeStampPanel.setLayout(timeStampPanelLayout);
1250        timeStampPanelLayout.setHorizontalGroup(
1251            timeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1252            .addGap(0, 1032, Short.MAX_VALUE)
1253        );
1254        timeStampPanelLayout.setVerticalGroup(
1255            timeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1256            .addGap(0, 100, Short.MAX_VALUE)
1257        );
1258
1259        timeStampScrollPane.setViewportView(timeStampPanel);
1260
1261        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
1262        getContentPane().setLayout(layout);
1263        layout.setHorizontalGroup(
1264            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1265            .addGroup(layout.createSequentialGroup()
1266                .addContainerGap()
1267                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1268                    .addComponent(timelinesScrollPane, 0, 0, Short.MAX_VALUE)
1269                    .addComponent(timeStampScrollPane)
1270                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1271                        .addComponent(scriptEventsPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1272                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1273                        .addComponent(scriptEventsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1274                    .addGroup(layout.createSequentialGroup()
1275                        .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
1276                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1277                        .addComponent(incidentEventsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1278                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1279                        .addComponent(evaluationEventsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1280                        .addGap(18, 18, 18)
1281                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1282                            .addComponent(zoomInIcon)
1283                            .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
1284                            .addComponent(zoomOutIcon))))
1285                .addContainerGap())
1286        );
1287        layout.setVerticalGroup(
1288            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1289            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
1290                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1291                    .addGroup(layout.createSequentialGroup()
1292                        .addContainerGap()
1293                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1294                            .addComponent(evaluationEventsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1295                            .addComponent(incidentEventsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
1296                            .addGroup(layout.createSequentialGroup()
1297                                .addGap(47, 47, 47)
1298                                .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))))
1299                    .addGroup(layout.createSequentialGroup()
1300                        .addGap(20, 20, 20)
1301                        .addComponent(zoomInIcon)
1302                        .addGap(1, 1, 1)
1303                        .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
1304                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1305                        .addComponent(zoomOutIcon)))
1306                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1307                .addComponent(timeStampScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
1308                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
1309                .addComponent(timelinesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 365, javax.swing.GroupLayout.PREFERRED_SIZE)
1310                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
1311                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
1312                    .addComponent(scriptEventsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1313                    .addComponent(scriptEventsPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1314                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1315        );
1316
1317        pack();
1318    }// </editor-fold>//GEN-END:initComponents
1319
1320    /**
1321     * Scale the timeline width based on zoom slider position.
1322     *
1323     * @param evt the state change event
1324     */
1325    private void zoomSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_zoomSliderStateChanged
1326        ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK = zoomSlider.getValue() * 2;
1327        this.update(null, theIncident);
1328        pack();
1329        repaint();
1330    }//GEN-LAST:event_zoomSliderStateChanged
1331
1332    private void cadEventMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cadEventMousePressed
1333    }//GEN-LAST:event_cadEventMousePressed
1334
1335    private void radioEventMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_radioEventMousePressed
1336    }//GEN-LAST:event_radioEventMousePressed
1337
1338    private void cadEventMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cadEventMouseReleased
1339    }//GEN-LAST:event_cadEventMouseReleased
1340
1341    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
1342    }//GEN-LAST:event_okButtonActionPerformed
1343
1344    /**
1345     * If cancel button is pressed, close radio event editor
1346     *
1347     * @param evt the button press event
1348     */
1349    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
1350        radioMessage.setText("");
1351        radioTypeComboBox.setSelectedIndex(0);
1352        radioEventFrame.setVisible(false);
1353    }//GEN-LAST:event_cancelButtonActionPerformed
1354
1355    private void editEventListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editEventListActionPerformed
1356    }//GEN-LAST:event_editEventListActionPerformed
1357
1358    /**
1359     * Deselects new event type upon click of blank "select" button.
1360     *
1361     * @param evt the button press event
1362     */
1363    private void selectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectButtonActionPerformed
1364        currentEventType = null;
1365        for (JButton eb : eventButtons)
1366        {
1367            eb.setSelected(false);
1368        }
1369        selectButton.setSelected(true);
1370    }//GEN-LAST:event_selectButtonActionPerformed
1371
1372    /**
1373     * Selects CAD_EVENT as the current type of new event, upon click of "CAD
1374     * Event" button.
1375     *
1376     * @param evt the button press event
1377     */
1378    private void cadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cadButtonActionPerformed
1379        currentEventType = ScriptEventType.CAD_EVENT;
1380        for (JButton eb : eventButtons)
1381        {
1382            eb.setSelected(false);
1383        }
1384        cadButton.setSelected(true);
1385    }//GEN-LAST:event_cadButtonActionPerformed
1386
1387    /**
1388     * Selects CCTV_EVENT as the current type of new event, upon click of "CCTV
1389     * Event" button.
1390     *
1391     * @param evt the button press event
1392     */
1393    private void cctvButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cctvButtonActionPerformed
1394        currentEventType = ScriptEventType.CCTV_EVENT;
1395        for (JButton eb : eventButtons)
1396        {
1397            eb.setSelected(false);
1398        }
1399        cctvButton.setSelected(true);
1400    }//GEN-LAST:event_cctvButtonActionPerformed
1401
1402    /**
1403     * Selects CHP_RADIO_EVENT as the current type of new event, upon click of
1404     * "CHP Radio Event" button.
1405     *
1406     * @param evt the button press event
1407     */
1408    private void chpRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chpRadioButtonActionPerformed
1409        currentEventType = ScriptEventType.CHP_RADIO_EVENT;
1410        for (JButton eb : eventButtons)
1411        {
1412            eb.setSelected(false);
1413        }
1414        chpRadioButton.setSelected(true);
1415    }//GEN-LAST:event_chpRadioButtonActionPerformed
1416
1417    /**
1418     * Hides the noise generation screen upon click of the "Cancel" button.
1419     *
1420     * @param evt the button press event
1421     */
1422    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
1423        addNoiseFrame.setVisible(false);
1424    }//GEN-LAST:event_jButton1ActionPerformed
1425
1426    /**
1427     * Generates random noise upon click of the "OK" button, then hides the
1428     * noise generation screen.
1429     *
1430     * @param evt the button press event
1431     */
1432    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
1433        Random rng = new Random();
1434        ScriptEventType[] eventTypes = ScriptEventType.values();
1435
1436        /* For prototyping purpose, ignore the sliders and average their values */
1437        int total = jSlider1.getValue() + jSlider2.getValue() + jSlider3.getValue() + jSlider5.getValue() + jSlider4.getValue();
1438        total /= 5;
1439
1440        for (int i = 0; i < theIncident.slices.size(); i++)
1441        {
1442            theIncident.slices.get(i).events.clear();
1443        }
1444
1445        for (int i = 0; i < total; i++)
1446        {
1447            int n = rng.nextInt();
1448            int s = rng.nextInt();
1449            int e = rng.nextInt();
1450            if (n < 0)
1451            {
1452                n *= -1;
1453            }
1454            if (s < 0)
1455            {
1456                s *= -1;
1457            }
1458            if (e < 0)
1459            {
1460                e *= -1;
1461            }
1462
1463            theIncident.slices.get(s % (theIncident.slices.size())).addEvent(ScriptEvent.factoryByType(eventTypes[e % eventTypes.length]));
1464        }
1465
1466        addNoiseFrame.setVisible(false);
1467
1468        update(null, theIncident);
1469}//GEN-LAST:event_jButton2ActionPerformed
1470
1471    /**
1472     * Selects WITNESS_EVENT as the current type of new event, upon click of
1473     * "Witness Event" button.
1474     *
1475     * @param evt the button press event
1476     */
1477    private void witnessButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_witnessButtonActionPerformed
1478        currentEventType = ScriptEventType.WITNESS_EVENT;
1479        for (JButton eb : eventButtons)
1480        {
1481            eb.setSelected(false);
1482        }
1483        witnessButton.setSelected(true);
1484    }//GEN-LAST:event_witnessButtonActionPerformed
1485
1486    /**
1487     * Selects UNIT_EVENT as the current type of new event, upon click of "Unit
1488     * Event" button.
1489     *
1490     * @param evt the button press event
1491     */
1492    private void unitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unitButtonActionPerformed
1493        currentEventType = ScriptEventType.UNIT_EVENT;
1494        for (JButton eb : eventButtons)
1495        {
1496            eb.setSelected(false);
1497        }
1498        unitButton.setSelected(true);
1499    }//GEN-LAST:event_unitButtonActionPerformed
1500
1501    /**
1502     * Selects TOW_EVENT as the current type of new event, upon click of "TOW
1503     * Event" button.
1504     *
1505     * @param evt the button press event
1506     */
1507    private void towButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_towButtonActionPerformed
1508        currentEventType = ScriptEventType.TOW_EVENT;
1509        for (JButton eb : eventButtons)
1510        {
1511            eb.setSelected(false);
1512        }
1513        towButton.setSelected(true);
1514    }//GEN-LAST:event_towButtonActionPerformed
1515
1516    /**
1517     * Selects PARAMICS_EVENT as the current type of new event, upon click of
1518     * "Paramics Event" button.
1519     *
1520     * @param evt the button press event
1521     */
1522    private void paramicsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_paramicsButtonActionPerformed
1523        currentEventType = ScriptEventType.PARAMICS_EVENT;
1524        for (JButton eb : eventButtons)
1525        {
1526            eb.setSelected(false);
1527        }
1528        paramicsButton.setSelected(true);
1529    }//GEN-LAST:event_paramicsButtonActionPerformed
1530
1531    /**
1532     * Selects MAINTENANCE_RADIO_EVENT as the current type of new event, upon
1533     * click of "Maintenance Radio Event" button.
1534     *
1535     * @param evt the button press event
1536     */
1537    private void maintenanceRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_maintenanceRadioButtonActionPerformed
1538        currentEventType = ScriptEventType.MAINTENANCE_RADIO_EVENT;
1539        for (JButton eb : eventButtons)
1540        {
1541            eb.setSelected(false);
1542        }
1543        maintenanceRadioButton.setSelected(true);
1544    }//GEN-LAST:event_maintenanceRadioButtonActionPerformed
1545
1546    /**
1547     * Selects ATMS_EVAL_EVENT as the current type of new event, upon click of
1548     * "ATMS Evaluation Event" button.
1549     *
1550     * @param evt the button press event
1551     */
1552    private void atmsEvalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_atmsEvalButtonActionPerformed
1553        currentEventType = ScriptEventType.ATMS_EVAL_EVENT;
1554        for (JButton eb : eventButtons)
1555        {
1556            eb.setSelected(false);
1557        }
1558        atmsEvalButton.setSelected(true);
1559    }//GEN-LAST:event_atmsEvalButtonActionPerformed
1560
1561    /**
1562     * Selects TELEPHONE_EVENT as the current type of new event, upon click of
1563     * "Telephone Event" button.
1564     *
1565     * @param evt the button press event
1566     */
1567    private void telephoneButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_telephoneButtonActionPerformed
1568        currentEventType = ScriptEventType.TELEPHONE_EVENT;
1569        for (JButton eb : eventButtons)
1570        {
1571            eb.setSelected(false);
1572        }
1573        telephoneButton.setSelected(true);
1574    }//GEN-LAST:event_telephoneButtonActionPerformed
1575
1576    /**
1577     * Selects TMT_RADIO_EVENT as the current type of new event, upon click of
1578     * "TMT Radio Event" button.
1579     *
1580     * @param evt the button press event
1581     */
1582    private void tmtRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tmtRadioButtonActionPerformed
1583        currentEventType = ScriptEventType.TMT_RADIO_EVENT;
1584        for (JButton eb : eventButtons)
1585        {
1586            eb.setSelected(false);
1587        }
1588        tmtRadioButton.setSelected(true);
1589    }//GEN-LAST:event_tmtRadioButtonActionPerformed
1590
1591    /**
1592     * Selects CMS_EVAL_EVENT as the current type of new event, upon click of
1593     * "CMS Evaluation Event" button.
1594     *
1595     * @param evt the button press event
1596     */
1597    private void cmsEvalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmsEvalButtonActionPerformed
1598        currentEventType = ScriptEventType.CMS_EVAL_EVENT;
1599        for (JButton eb : eventButtons)
1600        {
1601            eb.setSelected(false);
1602        }
1603        cmsEvalButton.setSelected(true);
1604    }//GEN-LAST:event_cmsEvalButtonActionPerformed
1605
1606    /**
1607     * Selects CAD_EVAL_EVENT as the current type of new event, upon click of
1608     * "CAD Evaluation Event" button.
1609     *
1610     * @param evt the button press event
1611     */
1612    private void cadEvalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cadEvalButtonActionPerformed
1613        currentEventType = ScriptEventType.CAD_EVAL_EVENT;
1614        for (JButton eb : eventButtons)
1615        {
1616            eb.setSelected(false);
1617        }
1618        cadEvalButton.setSelected(true);
1619    }//GEN-LAST:event_cadEvalButtonActionPerformed
1620
1621    /**
1622     * Selects ACTIVITY_LOG_EVAL_EVENT as the current type of new event, upon
1623     * click of "Activity Log Evaluation Event" button.
1624     *
1625     * @param evt the button press event
1626     */
1627    private void activityLogEvalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_activityLogEvalButtonActionPerformed
1628        currentEventType = ScriptEventType.ACTIVITY_LOG_EVAL_EVENT;
1629        for (JButton eb : eventButtons)
1630        {
1631            eb.setSelected(false);
1632        }
1633        activityLogEvalButton.setSelected(true);
1634    }//GEN-LAST:event_activityLogEvalButtonActionPerformed
1635
1636    /**
1637     * Selects RADIO_EVAL_EVENT as the current type of new event, upon click of
1638     * "Radio Evaluation Event" button.
1639     *
1640     * @param evt the button press event
1641     */
1642    private void radioEvalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioEvalButtonActionPerformed
1643        currentEventType = ScriptEventType.RADIO_EVAL_EVENT;
1644        for (JButton eb : eventButtons)
1645        {
1646            eb.setSelected(false);
1647        }
1648        radioEvalButton.setSelected(true);
1649    }//GEN-LAST:event_radioEvalButtonActionPerformed
1650
1651    /**
1652     * Selects FACILITATOR_EVAL_EVENT as the current type of new event, upon
1653     * click of "Facilitator Evaluation Event" button.
1654     *
1655     * @param evt the button press event
1656     */
1657    private void facilitatorEvalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_facilitatorEvalButtonActionPerformed
1658        currentEventType = ScriptEventType.FACILITATOR_EVAL_EVENT;
1659        for (JButton eb : eventButtons)
1660        {
1661            eb.setSelected(false);
1662        }
1663        facilitatorEvalButton.setSelected(true);
1664    }//GEN-LAST:event_facilitatorEvalButtonActionPerformed
1665
1666    /**
1667     * Selects AUDIO_EVENT as the current type of new event, upon click of
1668     * "Audio Event" button.
1669     *
1670     * @param evt the button press event
1671     */
1672    private void audioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_audioButtonActionPerformed
1673        currentEventType = ScriptEventType.AUDIO_EVENT;
1674        for (JButton eb : eventButtons)
1675        {
1676            eb.setSelected(false);
1677        }
1678        audioButton.setSelected(true);
1679    }//GEN-LAST:event_audioButtonActionPerformed
1680
1681    /**
1682     * Increases zoom level upon click of the "Zoom in" icon.
1683     *
1684     * @param evt the mouse event
1685     */
1686    private void zoomInIconMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_zoomInIconMouseClicked
1687        zoomSlider.setValue(zoomSlider.getValue() >= 21 ? 21 : zoomSlider.getValue() + 1);
1688    }//GEN-LAST:event_zoomInIconMouseClicked
1689
1690    /**
1691     * Decreases zoom level upon click of the "Zoom out" icon.
1692     *
1693     * @param evt the mouse event
1694     */
1695    private void zoomOutIconMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_zoomOutIconMouseClicked
1696        zoomSlider.setValue(zoomSlider.getValue() <= 5 ? 5 : zoomSlider.getValue() - 1);
1697    }//GEN-LAST:event_zoomOutIconMouseClicked
1698    private Color selectedColor = Color.BLACK;
1699
1700    /**
1701     * Read the version number from the application properties. The file
1702     * 'application.properties' is generated by build.xml.
1703     *
1704     * @return a version string obtained from application.properties file, or
1705     * "Version: unknown" if an IOerror prevents us from reading the file.
1706     */
1707    private String getAppVersion()
1708    {
1709        String propfilename = "/scriptbuilder/gui/application.properties";
1710        String propKey = "Application.revision";
1711        String version = "unknown";
1712        // Load the application properties (created by build.xml)
1713        try
1714        {
1715            Properties props = new Properties();
1716            props.load(this.getClass().getResourceAsStream(propfilename));
1717            version = (String) props.get(propKey);
1718        }
1719        catch (IOException ex)
1720        {
1721            Logger.getLogger("scriptbuilder.gui").log(Level.SEVERE,
1722                    "ScriptBuilderFrame.getAppVersion()."
1723                    + " IOError reading " + propfilename);
1724        }
1725        catch (NullPointerException npe)
1726        {
1727            Logger.getLogger("scriptbuilder.gui").log(Level.SEVERE,
1728                    "ScriptBuilderFrame.getAppVersion().load."
1729                    + " Missing file: " + propfilename);
1730        }
1731        return version;
1732    }
1733
1734//    /**
1735//     * Runs the script builder.
1736//     *
1737//     * @param args the command line arguments
1738//     */
1739//    public static void main(String args[])
1740//    {
1741//        try
1742//        {
1743//            UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
1744//        }
1745//        catch (ClassNotFoundException ex)
1746//        {
1747//        }
1748//        catch (InstantiationException ex)
1749//        {
1750//        }
1751//        catch (IllegalAccessException ex)
1752//        {
1753//        }
1754//        catch (UnsupportedLookAndFeelException ex)
1755//        {
1756//        }
1757//
1758//        try
1759//        {
1760//            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
1761//        }
1762//        catch (ClassNotFoundException ex)
1763//        {
1764//        }
1765//        catch (InstantiationException ex)
1766//        {
1767//        }
1768//        catch (IllegalAccessException ex)
1769//        {
1770//        }
1771//        catch (UnsupportedLookAndFeelException ex)
1772//        {
1773//        }
1774//
1775//        java.awt.EventQueue.invokeLater(
1776//                new Runnable()
1777//                {
1778//                    public void run()
1779//                    {
1780//                        new IncidentEditorFrame().setVisible(true);
1781//                    }
1782//                });
1783//    }
1784    // Variables declaration - do not modify//GEN-BEGIN:variables
1785    private javax.swing.JButton activityLogEvalButton;
1786    private javax.swing.JFrame addNoiseFrame;
1787    private javax.swing.JButton atmsEvalButton;
1788    private javax.swing.JButton audioButton;
1789    private javax.swing.JButton cadButton;
1790    private javax.swing.JButton cadEvalButton;
1791    private javax.swing.JMenuItem cadEvent;
1792    private javax.swing.JFrame cadEventFrame;
1793    private javax.swing.JButton cancelButton;
1794    private javax.swing.JButton cctvButton;
1795    private javax.swing.JButton chpRadioButton;
1796    private javax.swing.JButton cmsEvalButton;
1797    private javax.swing.JMenuItem deleteEventList;
1798    private javax.swing.JMenuItem editEventList;
1799    private javax.swing.JPanel evaluationEventsPanel;
1800    private javax.swing.JPopupMenu eventListPopupMenu;
1801    private javax.swing.JPopupMenu eventPopupMenu;
1802    private javax.swing.JButton facilitatorEvalButton;
1803    private javax.swing.JTextArea incidentDescription;
1804    private javax.swing.JScrollPane incidentDescriptionPane;
1805    private javax.swing.JPanel incidentEventsPanel;
1806    private javax.swing.JTextField incidentName;
1807    private javax.swing.JTextField incidentNumber;
1808    private scriptbuilder.gui.panels.ScriptBuilderNumberPanel incidentNumberPanel1;
1809    private scriptbuilder.gui.panels.ScriptBuilderTimelinePanel incidentTimelinePanel1;
1810    private javax.swing.JButton jButton1;
1811    private javax.swing.JButton jButton2;
1812    private javax.swing.JLabel jLabel13;
1813    private javax.swing.JLabel jLabel14;
1814    private javax.swing.JLabel jLabel15;
1815    private javax.swing.JLabel jLabel16;
1816    private javax.swing.JLabel jLabel17;
1817    private javax.swing.JLabel jLabel2;
1818    private javax.swing.JLabel jLabel20;
1819    private javax.swing.JLabel jLabel21;
1820    private javax.swing.JLabel jLabel3;
1821    private javax.swing.JLabel jLabel4;
1822    private javax.swing.JLabel jLabel5;
1823    private javax.swing.JLabel jLabel7;
1824    private javax.swing.JMenuItem jMenuItem2;
1825    private javax.swing.JMenuItem jMenuItem4;
1826    private javax.swing.JMenuItem jMenuItem5;
1827    private javax.swing.JMenuItem jMenuItem6;
1828    private javax.swing.JSlider jSlider1;
1829    private javax.swing.JSlider jSlider2;
1830    private javax.swing.JSlider jSlider3;
1831    private javax.swing.JSlider jSlider4;
1832    private javax.swing.JSlider jSlider5;
1833    private javax.swing.JTextArea jTextArea1;
1834    private javax.swing.JButton maintenanceRadioButton;
1835    private javax.swing.JButton okButton;
1836    private javax.swing.JButton paramicsButton;
1837    private javax.swing.JButton radioEvalButton;
1838    private javax.swing.JMenuItem radioEvent;
1839    private javax.swing.JFrame radioEventFrame;
1840    private javax.swing.JTextArea radioMessage;
1841    private javax.swing.JScrollPane radioMessageScrollPane;
1842    private javax.swing.JComboBox radioTypeComboBox;
1843    private javax.swing.JLabel radioTypeLabel;
1844    private javax.swing.JList scriptEventsList;
1845    private javax.swing.JScrollPane scriptEventsPane;
1846    private javax.swing.JPanel scriptEventsPanel;
1847    private javax.swing.JPanel scriptEventsPanel1;
1848    private javax.swing.JButton selectButton;
1849    private javax.swing.JButton telephoneButton;
1850    private scriptbuilder.gui.panels.TimeStampPanel timeStampPanel;
1851    private javax.swing.JScrollPane timeStampScrollPane;
1852    private scriptbuilder.gui.panels.TimelineTickPanel timelineTickPanel;
1853    private javax.swing.JScrollPane timelinesScrollPane;
1854    private javax.swing.JButton tmtRadioButton;
1855    private javax.swing.JButton towButton;
1856    private javax.swing.JButton unitButton;
1857    private javax.swing.JButton witnessButton;
1858    private javax.swing.JLabel zoomInIcon;
1859    private javax.swing.JLabel zoomOutIcon;
1860    private javax.swing.JSlider zoomSlider;
1861    // End of variables declaration//GEN-END:variables
1862}
Note: See TracBrowser for help on using the repository browser.