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

Revision 145, 93.7 KB checked in by sdanthin, 7 years ago (diff)

Move from Git to Svn (LARGE COMMIT)

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