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

Revision 55, 86.9 KB checked in by bmcguffin, 9 years ago (diff)

Removed most of the panels and buttons from the Script Builder frame. Left those same components in Incident Editor Frame, from which the dropdown menu at the top was removed.

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