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

Revision 155, 93.6 KB checked in by sdanthin, 6 years ago (diff)

units.xml moved to Incidents folder

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