Changeset 109 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder


Ignore:
Timestamp:
09/05/2017 04:08:45 PM (9 years ago)
Author:
bmcguffin
Message:

Annotated this file. Refactored various swing objects to have usage-specific names instead of generic names.

Location:
trunk/src/scriptbuilder/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/ScriptBuilderFrame.form

    r108 r109  
    2929            <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="cadEventMousePressed"/> 
    3030            <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="cadEventMouseReleased"/> 
     31            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cadEventActionPerformed"/> 
    3132          </Events> 
    3233        </MenuItem> 
     
    7374              <Group type="102" attributes="0"> 
    7475                  <EmptySpace max="-2" attributes="0"/> 
    75                   <Component id="jLabel5" min="-2" pref="68" max="-2" attributes="0"/> 
     76                  <Component id="labelCADEntry" min="-2" pref="68" max="-2" attributes="0"/> 
    7677                  <EmptySpace max="32767" attributes="0"/> 
    7778              </Group> 
     
    8283              <Group type="102" alignment="0" attributes="0"> 
    8384                  <EmptySpace max="-2" attributes="0"/> 
    84                   <Component id="jLabel5" min="-2" max="-2" attributes="0"/> 
     85                  <Component id="labelCADEntry" min="-2" max="-2" attributes="0"/> 
    8586                  <EmptySpace pref="1357" max="32767" attributes="0"/> 
    8687              </Group> 
     
    8990      </Layout> 
    9091      <SubComponents> 
    91         <Component class="javax.swing.JLabel" name="jLabel5"> 
     92        <Component class="javax.swing.JLabel" name="labelCADEntry"> 
    9293          <Properties> 
    9394            <Property name="text" type="java.lang.String" value="CAD Entry"/> 
     
    112113                      <Component id="radioMessageScrollPane" alignment="0" pref="380" max="32767" attributes="0"/> 
    113114                      <Group type="102" alignment="0" attributes="0"> 
    114                           <Component id="radioTypeLabel" min="-2" max="-2" attributes="0"/> 
     115                          <Component id="labelRadioType" min="-2" max="-2" attributes="0"/> 
    115116                          <EmptySpace type="unrelated" max="-2" attributes="0"/> 
    116117                          <Component id="radioTypeComboBox" pref="312" max="32767" attributes="0"/> 
    117118                      </Group> 
    118                       <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> 
     119                      <Component id="labelRadioMessage" alignment="0" min="-2" max="-2" attributes="0"/> 
    119120                      <Group type="102" alignment="0" attributes="0"> 
    120121                          <Component id="cancelButton" min="-2" max="-2" attributes="0"/> 
     
    132133                  <EmptySpace max="-2" attributes="0"/> 
    133134                  <Group type="103" groupAlignment="3" attributes="0"> 
    134                       <Component id="radioTypeLabel" alignment="3" min="-2" max="-2" attributes="0"/> 
     135                      <Component id="labelRadioType" alignment="3" min="-2" max="-2" attributes="0"/> 
    135136                      <Component id="radioTypeComboBox" alignment="3" min="-2" max="-2" attributes="0"/> 
    136137                  </Group> 
    137138                  <EmptySpace type="unrelated" max="-2" attributes="0"/> 
    138                   <Component id="jLabel7" min="-2" max="-2" attributes="0"/> 
     139                  <Component id="labelRadioMessage" min="-2" max="-2" attributes="0"/> 
    139140                  <EmptySpace max="-2" attributes="0"/> 
    140141                  <Component id="radioMessageScrollPane" pref="198" max="32767" attributes="0"/> 
     
    150151      </Layout> 
    151152      <SubComponents> 
    152         <Component class="javax.swing.JLabel" name="radioTypeLabel"> 
     153        <Component class="javax.swing.JLabel" name="labelRadioType"> 
    153154          <Properties> 
    154155            <Property name="text" type="java.lang.String" value="Radio Type:"/> 
    155156          </Properties> 
    156157        </Component> 
    157         <Component class="javax.swing.JLabel" name="jLabel7"> 
     158        <Component class="javax.swing.JLabel" name="labelRadioMessage"> 
    158159          <Properties> 
    159160            <Property name="text" type="java.lang.String" value="Radio Message:"/> 
     
    243244                  <EmptySpace max="-2" attributes="0"/> 
    244245                  <Group type="103" groupAlignment="1" attributes="0"> 
    245                       <Component id="jScrollPane1" alignment="0" pref="322" max="32767" attributes="0"/> 
    246                       <Component id="jLabel10" alignment="0" min="-2" max="-2" attributes="0"/> 
     246                      <Component id="incidentPropertiesScrollPane" alignment="0" pref="322" max="32767" attributes="0"/> 
     247                      <Component id="labelIncidentDescription" alignment="0" min="-2" max="-2" attributes="0"/> 
    247248                      <Group type="102" alignment="0" attributes="0"> 
    248249                          <Group type="103" groupAlignment="0" attributes="0"> 
    249                               <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> 
    250                               <Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/> 
    251                               <Component id="jLabel9" alignment="0" min="-2" max="-2" attributes="0"/> 
     250                              <Component id="labelIncidentNumber" alignment="0" min="-2" max="-2" attributes="0"/> 
     251                              <Component id="labelIncidentName" alignment="0" min="-2" max="-2" attributes="0"/> 
     252                              <Component id="labelIncidentColor" alignment="0" min="-2" max="-2" attributes="0"/> 
    252253                          </Group> 
    253254                          <EmptySpace type="separate" max="-2" attributes="0"/> 
     
    258259                                  <Component id="incidentColorField" pref="119" max="32767" attributes="0"/> 
    259260                                  <EmptySpace max="-2" attributes="0"/> 
    260                                   <Component id="jButton3" min="-2" pref="93" max="-2" attributes="0"/> 
     261                                  <Component id="btnChooseColor" min="-2" pref="93" max="-2" attributes="0"/> 
    261262                              </Group> 
    262263                          </Group> 
     
    269270                      <Group type="102" alignment="0" attributes="0"> 
    270271                          <Group type="103" groupAlignment="0" attributes="0"> 
    271                               <Component id="jLabel12" min="-2" max="-2" attributes="0"/> 
    272                               <Component id="jLabel11" alignment="0" min="-2" max="-2" attributes="0"/> 
     272                              <Component id="labelIncidentStart" min="-2" max="-2" attributes="0"/> 
     273                              <Component id="labelIncidentLength" alignment="0" min="-2" max="-2" attributes="0"/> 
    273274                          </Group> 
    274275                          <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> 
     
    276277                              <Group type="102" attributes="0"> 
    277278                                  <EmptySpace min="6" pref="6" max="-2" attributes="0"/> 
    278                                   <Component id="labelIncidentLength" max="32767" attributes="0"/> 
     279                                  <Component id="txtIncidentLength" max="32767" attributes="0"/> 
    279280                                  <EmptySpace min="22" pref="22" max="-2" attributes="0"/> 
    280281                              </Group> 
     
    292293                  <EmptySpace max="-2" attributes="0"/> 
    293294                  <Group type="103" groupAlignment="3" attributes="0"> 
    294                       <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> 
     295                      <Component id="labelIncidentNumber" alignment="3" min="-2" max="-2" attributes="0"/> 
    295296                      <Component id="addIncidentNumber" alignment="3" min="-2" max="-2" attributes="0"/> 
    296297                  </Group> 
    297298                  <EmptySpace max="-2" attributes="0"/> 
    298299                  <Group type="103" groupAlignment="3" attributes="0"> 
    299                       <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> 
     300                      <Component id="labelIncidentName" alignment="3" min="-2" max="-2" attributes="0"/> 
    300301                      <Component id="addIncidentName" alignment="3" min="-2" max="-2" attributes="0"/> 
    301302                  </Group> 
    302303                  <EmptySpace max="-2" attributes="0"/> 
    303304                  <Group type="103" groupAlignment="3" attributes="0"> 
    304                       <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> 
    305                       <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/> 
     305                      <Component id="labelIncidentColor" alignment="3" min="-2" max="-2" attributes="0"/> 
     306                      <Component id="btnChooseColor" alignment="3" min="-2" max="-2" attributes="0"/> 
    306307                      <Component id="incidentColorField" alignment="3" min="-2" max="-2" attributes="0"/> 
    307308                  </Group> 
    308309                  <EmptySpace max="-2" attributes="0"/> 
    309                   <Component id="jLabel10" min="-2" max="-2" attributes="0"/> 
    310                   <EmptySpace max="-2" attributes="0"/> 
    311                   <Component id="jScrollPane1" pref="118" max="32767" attributes="0"/> 
     310                  <Component id="labelIncidentDescription" min="-2" max="-2" attributes="0"/> 
     311                  <EmptySpace max="-2" attributes="0"/> 
     312                  <Component id="incidentPropertiesScrollPane" pref="118" max="32767" attributes="0"/> 
    312313                  <EmptySpace max="-2" attributes="0"/> 
    313314                  <Group type="103" groupAlignment="3" attributes="0"> 
    314315                      <Component id="addIncidentStart" alignment="3" min="-2" max="-2" attributes="0"/> 
    315                       <Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/> 
     316                      <Component id="labelIncidentStart" alignment="3" min="-2" max="-2" attributes="0"/> 
    316317                  </Group> 
    317318                  <EmptySpace max="-2" attributes="0"/> 
    318319                  <Group type="103" groupAlignment="3" attributes="0"> 
    319                       <Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/> 
    320320                      <Component id="labelIncidentLength" alignment="3" min="-2" max="-2" attributes="0"/> 
     321                      <Component id="txtIncidentLength" alignment="3" min="-2" max="-2" attributes="0"/> 
    321322                  </Group> 
    322323                  <EmptySpace max="-2" attributes="0"/> 
     
    331332      </Layout> 
    332333      <SubComponents> 
    333         <Component class="javax.swing.JLabel" name="jLabel6"> 
     334        <Component class="javax.swing.JLabel" name="labelIncidentNumber"> 
    334335          <Properties> 
    335336            <Property name="text" type="java.lang.String" value="Incident Number: "/> 
    336337          </Properties> 
    337338        </Component> 
    338         <Component class="javax.swing.JLabel" name="jLabel8"> 
     339        <Component class="javax.swing.JLabel" name="labelIncidentName"> 
    339340          <Properties> 
    340341            <Property name="text" type="java.lang.String" value="Incident Name:"/> 
    341342          </Properties> 
    342343        </Component> 
    343         <Component class="javax.swing.JLabel" name="jLabel9"> 
     344        <Component class="javax.swing.JLabel" name="labelIncidentColor"> 
    344345          <Properties> 
    345346            <Property name="text" type="java.lang.String" value="Incident Color: "/> 
    346347          </Properties> 
    347348        </Component> 
    348         <Component class="javax.swing.JLabel" name="jLabel10"> 
     349        <Component class="javax.swing.JLabel" name="labelIncidentDescription"> 
    349350          <Properties> 
    350351            <Property name="text" type="java.lang.String" value="Incident Description:"/> 
    351352          </Properties> 
    352353        </Component> 
    353         <Container class="javax.swing.JScrollPane" name="jScrollPane1"> 
     354        <Container class="javax.swing.JScrollPane" name="incidentPropertiesScrollPane"> 
    354355          <Properties> 
    355356            <Property name="horizontalScrollBarPolicy" type="int" value="31"/> 
     
    397398        <Component class="javax.swing.JTextField" name="addIncidentName"> 
    398399        </Component> 
    399         <Component class="javax.swing.JLabel" name="jLabel11"> 
     400        <Component class="javax.swing.JLabel" name="labelIncidentLength"> 
    400401          <Properties> 
    401402            <Property name="text" type="java.lang.String" value="Incident Length in Minutes: "/> 
    402403          </Properties> 
    403404        </Component> 
    404         <Component class="javax.swing.JLabel" name="jLabel12"> 
     405        <Component class="javax.swing.JLabel" name="labelIncidentStart"> 
    405406          <Properties> 
    406407            <Property name="text" type="java.lang.String" value="Incident Start Time in Minutes:"/> 
     
    414415          </Properties> 
    415416        </Component> 
    416         <Component class="javax.swing.JButton" name="jButton3"> 
     417        <Component class="javax.swing.JButton" name="btnChooseColor"> 
    417418          <Properties> 
    418419            <Property name="text" type="java.lang.String" value="Choose..."/> 
    419420          </Properties> 
    420421          <Events> 
    421             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> 
     422            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnChooseColorActionPerformed"/> 
    422423          </Events> 
    423424        </Component> 
     
    430431          </Properties> 
    431432        </Component> 
    432         <Component class="javax.swing.JLabel" name="labelIncidentLength"> 
     433        <Component class="javax.swing.JLabel" name="txtIncidentLength"> 
    433434          <Properties> 
    434435            <Property name="horizontalAlignment" type="int" value="4"/> 
     
    454455                  <EmptySpace pref="21" max="32767" attributes="0"/> 
    455456                  <Group type="103" groupAlignment="1" attributes="0"> 
    456                       <Component id="jTextArea1" alignment="0" max="32767" attributes="1"/> 
     457                      <Component id="txtNoiseDescription" alignment="0" max="32767" attributes="1"/> 
    457458                      <Group type="103" alignment="1" groupAlignment="1" max="-2" attributes="0"> 
    458459                          <Group type="102" alignment="0" attributes="1"> 
    459                               <Component id="jButton1" min="-2" max="-2" attributes="0"/> 
     460                              <Component id="btnCancelNoise" min="-2" max="-2" attributes="0"/> 
    460461                              <EmptySpace max="32767" attributes="0"/> 
    461                               <Component id="jButton2" min="-2" max="-2" attributes="0"/> 
     462                              <Component id="btnGenerateNoise" min="-2" max="-2" attributes="0"/> 
    462463                          </Group> 
    463464                          <Group type="102" alignment="0" attributes="0"> 
    464465                              <Group type="103" groupAlignment="0" attributes="0"> 
    465466                                  <Group type="103" alignment="0" groupAlignment="1" attributes="0"> 
    466                                       <Component id="jLabel16" alignment="1" min="-2" max="-2" attributes="0"/> 
    467                                       <Component id="jLabel14" alignment="1" min="-2" pref="105" max="-2" attributes="0"/> 
    468                                       <Component id="jLabel15" alignment="1" min="-2" pref="105" max="-2" attributes="0"/> 
    469                                       <Component id="jLabel13" alignment="1" min="-2" pref="105" max="-2" attributes="0"/> 
     467                                      <Component id="labelBackgroundNoise" alignment="1" min="-2" max="-2" attributes="0"/> 
     468                                      <Component id="labelLaneClosures" alignment="1" min="-2" pref="105" max="-2" attributes="0"/> 
     469                                      <Component id="labelTMCALLogs" alignment="1" min="-2" pref="105" max="-2" attributes="0"/> 
     470                                      <Component id="labelRadioChatter" alignment="1" min="-2" pref="105" max="-2" attributes="0"/> 
    470471                                  </Group> 
    471                                   <Component id="jLabel17" alignment="0" min="-2" pref="81" max="-2" attributes="0"/> 
     472                                  <Component id="labelMinorEvents" alignment="0" min="-2" pref="81" max="-2" attributes="0"/> 
    472473                              </Group> 
    473474                              <EmptySpace min="-2" pref="4" max="-2" attributes="0"/> 
    474475                              <Group type="103" groupAlignment="0" max="-2" attributes="0"> 
    475                                   <Component id="jSlider1" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
    476                                   <Component id="jSlider2" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
    477                                   <Component id="jSlider3" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
    478                                   <Component id="jSlider5" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
    479                                   <Component id="jSlider4" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
     476                                  <Component id="radioChatterSlider" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
     477                                  <Component id="laneClosuresSlider" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
     478                                  <Component id="TMCALSlider" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
     479                                  <Component id="minorEventsSlider" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
     480                                  <Component id="backgroundNoiseSlider" alignment="0" min="-2" pref="245" max="-2" attributes="0"/> 
    480481                                  <Group type="102" alignment="1" attributes="1"> 
    481                                       <Component id="jLabel20" min="-2" max="-2" attributes="0"/> 
     482                                      <Component id="labelLeastFreq" min="-2" max="-2" attributes="0"/> 
    482483                                      <EmptySpace max="32767" attributes="0"/> 
    483                                       <Component id="jLabel21" min="-2" max="-2" attributes="0"/> 
     484                                      <Component id="labelMostFreq" min="-2" max="-2" attributes="0"/> 
    484485                                  </Group> 
    485486                              </Group> 
     
    495496              <Group type="102" alignment="1" attributes="0"> 
    496497                  <EmptySpace max="-2" attributes="0"/> 
    497                   <Component id="jTextArea1" pref="39" max="32767" attributes="0"/> 
     498                  <Component id="txtNoiseDescription" pref="39" max="32767" attributes="0"/> 
    498499                  <EmptySpace max="-2" attributes="0"/> 
    499500                  <Group type="103" groupAlignment="1" attributes="0"> 
    500                       <Component id="jLabel21" min="-2" max="-2" attributes="0"/> 
    501                       <Component id="jLabel20" min="-2" max="-2" attributes="0"/> 
     501                      <Component id="labelMostFreq" min="-2" max="-2" attributes="0"/> 
     502                      <Component id="labelLeastFreq" min="-2" max="-2" attributes="0"/> 
    502503                  </Group> 
    503504                  <EmptySpace max="-2" attributes="0"/> 
    504505                  <Group type="103" groupAlignment="1" attributes="0"> 
    505                       <Component id="jLabel13" min="-2" pref="30" max="-2" attributes="1"/> 
    506                       <Component id="jSlider1" alignment="1" min="-2" pref="30" max="-2" attributes="1"/> 
     506                      <Component id="labelRadioChatter" min="-2" pref="30" max="-2" attributes="1"/> 
     507                      <Component id="radioChatterSlider" alignment="1" min="-2" pref="30" max="-2" attributes="1"/> 
    507508                  </Group> 
    508509                  <EmptySpace max="-2" attributes="0"/> 
    509510                  <Group type="103" groupAlignment="1" attributes="0"> 
    510                       <Component id="jLabel14" min="-2" pref="28" max="-2" attributes="1"/> 
    511                       <Component id="jSlider2" alignment="1" min="-2" pref="28" max="-2" attributes="1"/> 
     511                      <Component id="labelLaneClosures" min="-2" pref="28" max="-2" attributes="1"/> 
     512                      <Component id="laneClosuresSlider" alignment="1" min="-2" pref="28" max="-2" attributes="1"/> 
    512513                  </Group> 
    513514                  <EmptySpace max="-2" attributes="0"/> 
    514515                  <Group type="103" groupAlignment="1" max="-2" attributes="0"> 
    515                       <Component id="jLabel15" min="-2" max="-2" attributes="1"/> 
    516                       <Component id="jSlider3" alignment="1" min="-2" max="-2" attributes="1"/> 
     516                      <Component id="labelTMCALLogs" min="-2" max="-2" attributes="1"/> 
     517                      <Component id="TMCALSlider" alignment="1" min="-2" max="-2" attributes="1"/> 
    517518                  </Group> 
    518519                  <EmptySpace max="-2" attributes="0"/> 
    519520                  <Group type="103" groupAlignment="1" attributes="0"> 
    520                       <Component id="jSlider4" min="-2" pref="29" max="-2" attributes="1"/> 
    521                       <Component id="jLabel16" min="-2" pref="29" max="-2" attributes="1"/> 
    522                   </Group> 
    523                   <EmptySpace max="-2" attributes="0"/> 
    524                   <Group type="103" groupAlignment="0" attributes="0"> 
    525                       <Component id="jSlider5" min="-2" max="-2" attributes="1"/> 
    526                       <Component id="jLabel17" min="-2" max="-2" attributes="1"/> 
     521                      <Component id="backgroundNoiseSlider" min="-2" pref="29" max="-2" attributes="1"/> 
     522                      <Component id="labelBackgroundNoise" min="-2" pref="29" max="-2" attributes="1"/> 
     523                  </Group> 
     524                  <EmptySpace max="-2" attributes="0"/> 
     525                  <Group type="103" groupAlignment="0" attributes="0"> 
     526                      <Component id="minorEventsSlider" min="-2" max="-2" attributes="1"/> 
     527                      <Component id="labelMinorEvents" min="-2" max="-2" attributes="1"/> 
    527528                  </Group> 
    528529                  <EmptySpace type="separate" max="-2" attributes="0"/> 
    529530                  <Group type="103" groupAlignment="0" attributes="0"> 
    530                       <Component id="jButton1" min="-2" max="-2" attributes="0"/> 
    531                       <Component id="jButton2" min="-2" max="-2" attributes="0"/> 
     531                      <Component id="btnCancelNoise" min="-2" max="-2" attributes="0"/> 
     532                      <Component id="btnGenerateNoise" min="-2" max="-2" attributes="0"/> 
    532533                  </Group> 
    533534                  <EmptySpace max="-2" attributes="0"/> 
     
    537538      </Layout> 
    538539      <SubComponents> 
    539         <Component class="javax.swing.JLabel" name="jLabel13"> 
     540        <Component class="javax.swing.JLabel" name="labelRadioChatter"> 
    540541          <Properties> 
    541542            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 
     
    545546          </Properties> 
    546547        </Component> 
    547         <Component class="javax.swing.JSlider" name="jSlider1"> 
    548         </Component> 
    549         <Component class="javax.swing.JSlider" name="jSlider2"> 
    550         </Component> 
    551         <Component class="javax.swing.JLabel" name="jLabel14"> 
     548        <Component class="javax.swing.JSlider" name="radioChatterSlider"> 
     549        </Component> 
     550        <Component class="javax.swing.JSlider" name="laneClosuresSlider"> 
     551        </Component> 
     552        <Component class="javax.swing.JLabel" name="labelLaneClosures"> 
    552553          <Properties> 
    553554            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 
     
    557558          </Properties> 
    558559        </Component> 
    559         <Component class="javax.swing.JSlider" name="jSlider3"> 
    560         </Component> 
    561         <Component class="javax.swing.JLabel" name="jLabel15"> 
     560        <Component class="javax.swing.JSlider" name="TMCALSlider"> 
     561        </Component> 
     562        <Component class="javax.swing.JLabel" name="labelTMCALLogs"> 
    562563          <Properties> 
    563564            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 
     
    567568          </Properties> 
    568569        </Component> 
    569         <Component class="javax.swing.JTextArea" name="jTextArea1"> 
     570        <Component class="javax.swing.JTextArea" name="txtNoiseDescription"> 
    570571          <Properties> 
    571572            <Property name="editable" type="boolean" value="false"/> 
     
    589590          </Properties> 
    590591        </Component> 
    591         <Component class="javax.swing.JSlider" name="jSlider4"> 
    592         </Component> 
    593         <Component class="javax.swing.JLabel" name="jLabel16"> 
     592        <Component class="javax.swing.JSlider" name="backgroundNoiseSlider"> 
     593        </Component> 
     594        <Component class="javax.swing.JLabel" name="labelBackgroundNoise"> 
    594595          <Properties> 
    595596            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 
     
    599600          </Properties> 
    600601        </Component> 
    601         <Component class="javax.swing.JSlider" name="jSlider5"> 
    602         </Component> 
    603         <Component class="javax.swing.JLabel" name="jLabel17"> 
     602        <Component class="javax.swing.JSlider" name="minorEventsSlider"> 
     603        </Component> 
     604        <Component class="javax.swing.JLabel" name="labelMinorEvents"> 
    604605          <Properties> 
    605606            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 
     
    609610          </Properties> 
    610611        </Component> 
    611         <Component class="javax.swing.JButton" name="jButton1"> 
     612        <Component class="javax.swing.JButton" name="btnCancelNoise"> 
    612613          <Properties> 
    613614            <Property name="text" type="java.lang.String" value="Cancel"/> 
    614615          </Properties> 
    615616          <Events> 
    616             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> 
     617            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelNoiseActionPerformed"/> 
    617618          </Events> 
    618619        </Component> 
    619         <Component class="javax.swing.JButton" name="jButton2"> 
     620        <Component class="javax.swing.JButton" name="btnGenerateNoise"> 
    620621          <Properties> 
    621622            <Property name="text" type="java.lang.String" value="Generate"/> 
    622623          </Properties> 
    623624          <Events> 
    624             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> 
     625            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnGenerateNoiseActionPerformed"/> 
    625626          </Events> 
    626627        </Component> 
    627         <Component class="javax.swing.JLabel" name="jLabel20"> 
     628        <Component class="javax.swing.JLabel" name="labelLeastFreq"> 
    628629          <Properties> 
    629630            <Property name="text" type="java.lang.String" value="Least Frequent"/> 
    630631          </Properties> 
    631632        </Component> 
    632         <Component class="javax.swing.JLabel" name="jLabel21"> 
     633        <Component class="javax.swing.JLabel" name="labelMostFreq"> 
    633634          <Properties> 
    634635            <Property name="text" type="java.lang.String" value="Most Frequent"/> 
  • trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java

    r108 r109  
    177177    public void update(Observable o, Object arg) 
    178178    { 
     179        //Three major update types: whole script, and 2 event updates 
    179180        if (arg instanceof SimulationScript) 
    180181        { 
    181182            script = (SimulationScript) arg; 
    182183 
     184            //If we don't have exactly 10 events something is wrong 
    183185            if (script.incidents.size() != 10) 
    184186            { 
     
    186188            } 
    187189 
     190            //Call update on major panels 
    188191            timelineTickPanel.update(script); 
    189192            timeStampPanel.update(script); 
    190193 
     194            //Call update on all timeline panels 
    191195            incidentTimelinePanel1.timelinePanelUpdate(script.incidents.get(0)); 
    192196            incidentTimelinePanel2.timelinePanelUpdate(script.incidents.get(1)); 
     
    200204            incidentTimelinePanel10.timelinePanelUpdate(script.incidents.get(9)); 
    201205 
     206            //Cal update on number panels 
    202207            incidentNumberPanel1.update(script.incidents.get(0)); 
    203208            incidentNumberPanel2.update(script.incidents.get(1)); 
     
    219224            pack(); 
    220225        } 
     226        //Mouse has changed focus to a different timeslice 
    221227        else if (arg instanceof SliceChangedEvent) 
    222228        { 
     
    229235            } 
    230236        } 
     237        //Mouse has changed focus to a different incident timeline panel  
    231238        else if (arg instanceof IncidentFocusedEvent) 
    232239        { 
     
    236243        } 
    237244 
     245        //Regardless of update type, refresh window by doing these things: 
     246        //Enable "+15:00" button if script is not empty 
    238247        btnAddTime.setEnabled(script != null && script.numberOfIncidents > 0); 
    239248 
     249        //enable zoom slider if script is not empty 
    240250        zoomSlider.setEnabled(script != null && script.numberOfIncidents > 0); 
    241251 
     252        //scale the zoom slider such that the most zoomed-out point allows the 
     253        //entire script to be visible at once 
    242254        zoomSlider.setMinimum(((timelineTickPanel.getVisibleRect().width - 20) 
    243255                * ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION) 
     
    267279        jMenuItem6 = new javax.swing.JMenuItem(); 
    268280        cadEventFrame = new javax.swing.JFrame(); 
    269         jLabel5 = new javax.swing.JLabel(); 
     281        labelCADEntry = new javax.swing.JLabel(); 
    270282        radioEventFrame = new javax.swing.JFrame(); 
    271         radioTypeLabel = new javax.swing.JLabel(); 
    272         jLabel7 = new javax.swing.JLabel(); 
     283        labelRadioType = new javax.swing.JLabel(); 
     284        labelRadioMessage = new javax.swing.JLabel(); 
    273285        radioTypeComboBox = new javax.swing.JComboBox(); 
    274286        radioMessageScrollPane = new javax.swing.JScrollPane(); 
     
    280292        deleteEventList = new javax.swing.JMenuItem(); 
    281293        incidentFrame = new javax.swing.JFrame(); 
    282         jLabel6 = new javax.swing.JLabel(); 
    283         jLabel8 = new javax.swing.JLabel(); 
    284         jLabel9 = new javax.swing.JLabel(); 
    285         jLabel10 = new javax.swing.JLabel(); 
    286         jScrollPane1 = new javax.swing.JScrollPane(); 
     294        labelIncidentNumber = new javax.swing.JLabel(); 
     295        labelIncidentName = new javax.swing.JLabel(); 
     296        labelIncidentColor = new javax.swing.JLabel(); 
     297        labelIncidentDescription = new javax.swing.JLabel(); 
     298        incidentPropertiesScrollPane = new javax.swing.JScrollPane(); 
    287299        addIncidentDescription = new javax.swing.JTextArea(); 
    288300        incidentOkButton = new javax.swing.JButton(); 
     
    290302        addIncidentNumber = new javax.swing.JSpinner(); 
    291303        addIncidentName = new javax.swing.JTextField(); 
    292         jLabel11 = new javax.swing.JLabel(); 
    293         jLabel12 = new javax.swing.JLabel(); 
     304        labelIncidentLength = new javax.swing.JLabel(); 
     305        labelIncidentStart = new javax.swing.JLabel(); 
    294306        addIncidentStart = new javax.swing.JSpinner(); 
    295         jButton3 = new javax.swing.JButton(); 
     307        btnChooseColor = new javax.swing.JButton(); 
    296308        incidentColorField = new javax.swing.JTextField(); 
    297         labelIncidentLength = new javax.swing.JLabel(); 
     309        txtIncidentLength = new javax.swing.JLabel(); 
    298310        addNoiseFrame = new javax.swing.JFrame(); 
    299         jLabel13 = new javax.swing.JLabel(); 
    300         jSlider1 = new javax.swing.JSlider(); 
    301         jSlider2 = new javax.swing.JSlider(); 
    302         jLabel14 = new javax.swing.JLabel(); 
    303         jSlider3 = new javax.swing.JSlider(); 
    304         jLabel15 = new javax.swing.JLabel(); 
    305         jTextArea1 = new javax.swing.JTextArea(); 
    306         jSlider4 = new javax.swing.JSlider(); 
    307         jLabel16 = new javax.swing.JLabel(); 
    308         jSlider5 = new javax.swing.JSlider(); 
    309         jLabel17 = new javax.swing.JLabel(); 
    310         jButton1 = new javax.swing.JButton(); 
    311         jButton2 = new javax.swing.JButton(); 
    312         jLabel20 = new javax.swing.JLabel(); 
    313         jLabel21 = new javax.swing.JLabel(); 
     311        labelRadioChatter = new javax.swing.JLabel(); 
     312        radioChatterSlider = new javax.swing.JSlider(); 
     313        laneClosuresSlider = new javax.swing.JSlider(); 
     314        labelLaneClosures = new javax.swing.JLabel(); 
     315        TMCALSlider = new javax.swing.JSlider(); 
     316        labelTMCALLogs = new javax.swing.JLabel(); 
     317        txtNoiseDescription = new javax.swing.JTextArea(); 
     318        backgroundNoiseSlider = new javax.swing.JSlider(); 
     319        labelBackgroundNoise = new javax.swing.JLabel(); 
     320        minorEventsSlider = new javax.swing.JSlider(); 
     321        labelMinorEvents = new javax.swing.JLabel(); 
     322        btnCancelNoise = new javax.swing.JButton(); 
     323        btnGenerateNoise = new javax.swing.JButton(); 
     324        labelLeastFreq = new javax.swing.JLabel(); 
     325        labelMostFreq = new javax.swing.JLabel(); 
    314326        incidentColorChooser = new javax.swing.JColorChooser(); 
    315327        timelinesScrollPane = new javax.swing.JScrollPane(); 
     
    383395            } 
    384396        }); 
     397        cadEvent.addActionListener(new java.awt.event.ActionListener() 
     398        { 
     399            public void actionPerformed(java.awt.event.ActionEvent evt) 
     400            { 
     401                cadEventActionPerformed(evt); 
     402            } 
     403        }); 
    385404        eventPopupMenu.add(cadEvent); 
    386405 
     
    409428        cadEventFrame.setMinimumSize(new java.awt.Dimension(400, 300)); 
    410429 
    411         jLabel5.setText("CAD Entry"); 
     430        labelCADEntry.setText("CAD Entry"); 
    412431 
    413432        javax.swing.GroupLayout cadEventFrameLayout = new javax.swing.GroupLayout(cadEventFrame.getContentPane()); 
     
    417436            .addGroup(cadEventFrameLayout.createSequentialGroup() 
    418437                .addContainerGap() 
    419                 .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE) 
     438                .addComponent(labelCADEntry, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE) 
    420439                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 
    421440        ); 
     
    424443            .addGroup(cadEventFrameLayout.createSequentialGroup() 
    425444                .addContainerGap() 
    426                 .addComponent(jLabel5) 
     445                .addComponent(labelCADEntry) 
    427446                .addContainerGap(1357, Short.MAX_VALUE)) 
    428447        ); 
     
    431450        radioEventFrame.setMinimumSize(new java.awt.Dimension(400, 300)); 
    432451 
    433         radioTypeLabel.setText("Radio Type:"); 
    434  
    435         jLabel7.setText("Radio Message:"); 
     452        labelRadioType.setText("Radio Type:"); 
     453 
     454        labelRadioMessage.setText("Radio Message:"); 
    436455 
    437456        radioTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TMT", "Maintanence" })); 
     
    472491                    .addComponent(radioMessageScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) 
    473492                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, radioEventFrameLayout.createSequentialGroup() 
    474                         .addComponent(radioTypeLabel) 
     493                        .addComponent(labelRadioType) 
    475494                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 
    476495                        .addComponent(radioTypeComboBox, 0, 312, Short.MAX_VALUE)) 
    477                     .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING) 
     496                    .addComponent(labelRadioMessage, javax.swing.GroupLayout.Alignment.LEADING) 
    478497                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, radioEventFrameLayout.createSequentialGroup() 
    479498                        .addComponent(cancelButton) 
     
    487506                .addContainerGap() 
    488507                .addGroup(radioEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    489                     .addComponent(radioTypeLabel) 
     508                    .addComponent(labelRadioType) 
    490509                    .addComponent(radioTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    491510                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 
    492                 .addComponent(jLabel7) 
     511                .addComponent(labelRadioMessage) 
    493512                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    494513                .addComponent(radioMessageScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE) 
     
    516535        incidentFrame.setMinimumSize(new java.awt.Dimension(400, 400)); 
    517536 
    518         jLabel6.setText("Incident Number: "); 
    519  
    520         jLabel8.setText("Incident Name:"); 
    521  
    522         jLabel9.setText("Incident Color: "); 
    523  
    524         jLabel10.setText("Incident Description:"); 
    525  
    526         jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); 
    527         jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); 
     537        labelIncidentNumber.setText("Incident Number: "); 
     538 
     539        labelIncidentName.setText("Incident Name:"); 
     540 
     541        labelIncidentColor.setText("Incident Color: "); 
     542 
     543        labelIncidentDescription.setText("Incident Description:"); 
     544 
     545        incidentPropertiesScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); 
     546        incidentPropertiesScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); 
    528547 
    529548        addIncidentDescription.setColumns(20); 
     
    531550        addIncidentDescription.setRows(5); 
    532551        addIncidentDescription.setWrapStyleWord(true); 
    533         jScrollPane1.setViewportView(addIncidentDescription); 
     552        incidentPropertiesScrollPane.setViewportView(addIncidentDescription); 
    534553 
    535554        incidentOkButton.setText("OK"); 
     
    553572        addIncidentNumber.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(101), Integer.valueOf(101), null, Integer.valueOf(1))); 
    554573 
    555         jLabel11.setText("Incident Length in Minutes: "); 
    556  
    557         jLabel12.setText("Incident Start Time in Minutes:"); 
     574        labelIncidentLength.setText("Incident Length in Minutes: "); 
     575 
     576        labelIncidentStart.setText("Incident Start Time in Minutes:"); 
    558577 
    559578        addIncidentStart.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1))); 
    560579 
    561         jButton3.setText("Choose..."); 
    562         jButton3.addActionListener(new java.awt.event.ActionListener() 
    563         { 
    564             public void actionPerformed(java.awt.event.ActionEvent evt) 
    565             { 
    566                 jButton3ActionPerformed(evt); 
     580        btnChooseColor.setText("Choose..."); 
     581        btnChooseColor.addActionListener(new java.awt.event.ActionListener() 
     582        { 
     583            public void actionPerformed(java.awt.event.ActionEvent evt) 
     584            { 
     585                btnChooseColorActionPerformed(evt); 
    567586            } 
    568587        }); 
     
    571590        incidentColorField.setBackground(new java.awt.Color(0, 0, 0)); 
    572591 
    573         labelIncidentLength.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); 
    574         labelIncidentLength.setText("0"); 
    575         labelIncidentLength.setToolTipText(""); 
     592        txtIncidentLength.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); 
     593        txtIncidentLength.setText("0"); 
     594        txtIncidentLength.setToolTipText(""); 
    576595 
    577596        javax.swing.GroupLayout incidentFrameLayout = new javax.swing.GroupLayout(incidentFrame.getContentPane()); 
     
    582601                .addContainerGap() 
    583602                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 
    584                     .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE) 
    585                     .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.LEADING) 
     603                    .addComponent(incidentPropertiesScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE) 
     604                    .addComponent(labelIncidentDescription, javax.swing.GroupLayout.Alignment.LEADING) 
    586605                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup() 
    587606                        .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    588                             .addComponent(jLabel6) 
    589                             .addComponent(jLabel8) 
    590                             .addComponent(jLabel9)) 
     607                            .addComponent(labelIncidentNumber) 
     608                            .addComponent(labelIncidentName) 
     609                            .addComponent(labelIncidentColor)) 
    591610                        .addGap(18, 18, 18) 
    592611                        .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
     
    596615                                .addComponent(incidentColorField, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) 
    597616                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    598                                 .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)))) 
     617                                .addComponent(btnChooseColor, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)))) 
    599618                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup() 
    600619                        .addComponent(incidentCancelButton) 
     
    603622                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup() 
    604623                        .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    605                             .addComponent(jLabel12) 
    606                             .addComponent(jLabel11)) 
     624                            .addComponent(labelIncidentStart) 
     625                            .addComponent(labelIncidentLength)) 
    607626                        .addGap(18, 18, 18) 
    608627                        .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    609628                            .addGroup(incidentFrameLayout.createSequentialGroup() 
    610629                                .addGap(6, 6, 6) 
    611                                 .addComponent(labelIncidentLength, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     630                                .addComponent(txtIncidentLength, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    612631                                .addGap(22, 22, 22)) 
    613632                            .addComponent(addIncidentStart, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)))) 
     
    619638                .addContainerGap() 
    620639                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    621                     .addComponent(jLabel6) 
     640                    .addComponent(labelIncidentNumber) 
    622641                    .addComponent(addIncidentNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    623642                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    624643                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    625                     .addComponent(jLabel8) 
     644                    .addComponent(labelIncidentName) 
    626645                    .addComponent(addIncidentName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    627646                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    628647                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    629                     .addComponent(jLabel9) 
    630                     .addComponent(jButton3) 
     648                    .addComponent(labelIncidentColor) 
     649                    .addComponent(btnChooseColor) 
    631650                    .addComponent(incidentColorField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    632651                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    633                 .addComponent(jLabel10) 
     652                .addComponent(labelIncidentDescription) 
    634653                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    635                 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE) 
     654                .addComponent(incidentPropertiesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE) 
    636655                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    637656                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    638657                    .addComponent(addIncidentStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 
    639                     .addComponent(jLabel12)) 
     658                    .addComponent(labelIncidentStart)) 
    640659                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    641660                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    642                     .addComponent(jLabel11) 
    643                     .addComponent(labelIncidentLength)) 
     661                    .addComponent(labelIncidentLength) 
     662                    .addComponent(txtIncidentLength)) 
    644663                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    645664                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
     
    653672        addNoiseFrame.setResizable(false); 
    654673 
    655         jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
    656         jLabel13.setText("Radio Chatter: "); 
    657  
    658         jLabel14.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
    659         jLabel14.setText("Lane Closures:"); 
    660  
    661         jLabel15.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
    662         jLabel15.setText("TMCAL Logs:"); 
    663  
    664         jTextArea1.setEditable(false); 
    665         jTextArea1.setColumns(20); 
    666         jTextArea1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
    667         jTextArea1.setLineWrap(true); 
    668         jTextArea1.setRows(5); 
    669         jTextArea1.setText("Noise events will be randomly generated for the simulation with frequencies based on the control selections made below"); 
    670         jTextArea1.setWrapStyleWord(true); 
    671         jTextArea1.setAutoscrolls(false); 
    672         jTextArea1.setBorder(null); 
    673         jTextArea1.setDisabledTextColor(new java.awt.Color(0, 0, 0)); 
    674         jTextArea1.setFocusable(false); 
    675         jTextArea1.setOpaque(false); 
    676  
    677         jLabel16.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
    678         jLabel16.setText("Background Noise: "); 
    679  
    680         jLabel17.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
    681         jLabel17.setText("Minor Events:"); 
    682  
    683         jButton1.setText("Cancel"); 
    684         jButton1.addActionListener(new java.awt.event.ActionListener() 
    685         { 
    686             public void actionPerformed(java.awt.event.ActionEvent evt) 
    687             { 
    688                 jButton1ActionPerformed(evt); 
    689             } 
    690         }); 
    691  
    692         jButton2.setText("Generate"); 
    693         jButton2.addActionListener(new java.awt.event.ActionListener() 
    694         { 
    695             public void actionPerformed(java.awt.event.ActionEvent evt) 
    696             { 
    697                 jButton2ActionPerformed(evt); 
    698             } 
    699         }); 
    700  
    701         jLabel20.setText("Least Frequent"); 
    702  
    703         jLabel21.setText("Most Frequent"); 
     674        labelRadioChatter.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
     675        labelRadioChatter.setText("Radio Chatter: "); 
     676 
     677        labelLaneClosures.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
     678        labelLaneClosures.setText("Lane Closures:"); 
     679 
     680        labelTMCALLogs.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
     681        labelTMCALLogs.setText("TMCAL Logs:"); 
     682 
     683        txtNoiseDescription.setEditable(false); 
     684        txtNoiseDescription.setColumns(20); 
     685        txtNoiseDescription.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
     686        txtNoiseDescription.setLineWrap(true); 
     687        txtNoiseDescription.setRows(5); 
     688        txtNoiseDescription.setText("Noise events will be randomly generated for the simulation with frequencies based on the control selections made below"); 
     689        txtNoiseDescription.setWrapStyleWord(true); 
     690        txtNoiseDescription.setAutoscrolls(false); 
     691        txtNoiseDescription.setBorder(null); 
     692        txtNoiseDescription.setDisabledTextColor(new java.awt.Color(0, 0, 0)); 
     693        txtNoiseDescription.setFocusable(false); 
     694        txtNoiseDescription.setOpaque(false); 
     695 
     696        labelBackgroundNoise.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
     697        labelBackgroundNoise.setText("Background Noise: "); 
     698 
     699        labelMinorEvents.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 
     700        labelMinorEvents.setText("Minor Events:"); 
     701 
     702        btnCancelNoise.setText("Cancel"); 
     703        btnCancelNoise.addActionListener(new java.awt.event.ActionListener() 
     704        { 
     705            public void actionPerformed(java.awt.event.ActionEvent evt) 
     706            { 
     707                btnCancelNoiseActionPerformed(evt); 
     708            } 
     709        }); 
     710 
     711        btnGenerateNoise.setText("Generate"); 
     712        btnGenerateNoise.addActionListener(new java.awt.event.ActionListener() 
     713        { 
     714            public void actionPerformed(java.awt.event.ActionEvent evt) 
     715            { 
     716                btnGenerateNoiseActionPerformed(evt); 
     717            } 
     718        }); 
     719 
     720        labelLeastFreq.setText("Least Frequent"); 
     721 
     722        labelMostFreq.setText("Most Frequent"); 
    704723 
    705724        javax.swing.GroupLayout addNoiseFrameLayout = new javax.swing.GroupLayout(addNoiseFrame.getContentPane()); 
     
    710729                .addContainerGap(21, Short.MAX_VALUE) 
    711730                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 
    712                     .addComponent(jTextArea1, javax.swing.GroupLayout.Alignment.LEADING) 
     731                    .addComponent(txtNoiseDescription, javax.swing.GroupLayout.Alignment.LEADING) 
    713732                    .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) 
    714733                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, addNoiseFrameLayout.createSequentialGroup() 
    715                             .addComponent(jButton1) 
     734                            .addComponent(btnCancelNoise) 
    716735                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    717                             .addComponent(jButton2)) 
     736                            .addComponent(btnGenerateNoise)) 
    718737                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, addNoiseFrameLayout.createSequentialGroup() 
    719738                            .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    720739                                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 
    721                                     .addComponent(jLabel16) 
    722                                     .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) 
    723                                     .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) 
    724                                     .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    725                                 .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)) 
     740                                    .addComponent(labelBackgroundNoise) 
     741                                    .addComponent(labelLaneClosures, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) 
     742                                    .addComponent(labelTMCALLogs, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) 
     743                                    .addComponent(labelRadioChatter, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)) 
     744                                .addComponent(labelMinorEvents, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    726745                            .addGap(4, 4, 4) 
    727746                            .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 
    728                                 .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
    729                                 .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
    730                                 .addComponent(jSlider3, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
    731                                 .addComponent(jSlider5, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
    732                                 .addComponent(jSlider4, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
     747                                .addComponent(radioChatterSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
     748                                .addComponent(laneClosuresSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
     749                                .addComponent(TMCALSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
     750                                .addComponent(minorEventsSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
     751                                .addComponent(backgroundNoiseSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) 
    733752                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addNoiseFrameLayout.createSequentialGroup() 
    734                                     .addComponent(jLabel20) 
     753                                    .addComponent(labelLeastFreq) 
    735754                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    736                                     .addComponent(jLabel21)))))) 
     755                                    .addComponent(labelMostFreq)))))) 
    737756                .addGap(20, 20, 20)) 
    738757        ); 
     
    741760            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addNoiseFrameLayout.createSequentialGroup() 
    742761                .addContainerGap() 
    743                 .addComponent(jTextArea1, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE) 
     762                .addComponent(txtNoiseDescription, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE) 
    744763                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    745764                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 
    746                     .addComponent(jLabel21) 
    747                     .addComponent(jLabel20)) 
     765                    .addComponent(labelMostFreq) 
     766                    .addComponent(labelLeastFreq)) 
    748767                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    749768                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 
    750                     .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 
    751                     .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) 
     769                    .addComponent(labelRadioChatter, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 
     770                    .addComponent(radioChatterSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    752771                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    753772                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 
    754                     .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) 
    755                     .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) 
     773                    .addComponent(labelLaneClosures, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) 
     774                    .addComponent(laneClosuresSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    756775                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    757776                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) 
    758                     .addComponent(jLabel15) 
    759                     .addComponent(jSlider3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 
     777                    .addComponent(labelTMCALLogs) 
     778                    .addComponent(TMCALSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    760779                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    761780                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 
    762                     .addComponent(jSlider4, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) 
    763                     .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)) 
     781                    .addComponent(backgroundNoiseSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) 
     782                    .addComponent(labelBackgroundNoise, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    764783                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    765784                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    766                     .addComponent(jSlider5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 
    767                     .addComponent(jLabel17)) 
     785                    .addComponent(minorEventsSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 
     786                    .addComponent(labelMinorEvents)) 
    768787                .addGap(18, 18, 18) 
    769788                .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    770                     .addComponent(jButton1) 
    771                     .addComponent(jButton2)) 
     789                    .addComponent(btnCancelNoise) 
     790                    .addComponent(btnGenerateNoise)) 
    772791                .addContainerGap()) 
    773792        ); 
     
    14361455     */ 
    14371456    private void zoomSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_zoomSliderStateChanged 
     1457        //Changing the zoom level always refreshes the window 
    14381458        ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK = zoomSlider.getValue(); 
    14391459        this.update(script, script); 
     
    15191539                            (Integer) addIncidentNumber.getValue(), addIncidentName.getText(), addIncidentDescription.getText(), 
    15201540                            script)); 
    1521 //            script.incidents.get(indx).length = (Integer) addIncidentLength.getValue() * 60; 
    15221541            script.incidents.get(indx).setOffset((Integer) addIncidentStart.getValue() * 60); 
    15231542            script.numberOfIncidents++; 
     
    15261545        else//editing existing incident 
    15271546        { 
    1528 //            //what the hell? 
    1529 //            ScriptIncident backup = script.incidents.get(oldIncidentIndex); 
    1530 //            script.incidents.remove(oldIncidentIndex); 
    1531 //            script.incidents.add(oldIncidentIndex, null); 
    1532 // 
    1533 //            for (ScriptIncident i : script.incidents) 
    1534 //            { 
    1535 //                if (i != null && i.number == (Integer) addIncidentNumber.getValue()) 
    1536 //                { 
    1537 //                    script.incidents.remove(oldIncidentIndex); 
    1538 //                    script.incidents.add(oldIncidentIndex, backup); 
    1539 //                    JOptionPane.showMessageDialog(this, "Incident number already in use.", 
    1540 //                            "Unable to Create Incident", JOptionPane.ERROR_MESSAGE); 
    1541 //                    incidentFrame.setVisible(true); 
    1542 //                    return; 
    1543 //                } 
    1544 //            } 
    1545 // 
    1546 //            //ugh why do it like this 
    1547 //            script.incidents.remove(oldIncidentIndex); 
    1548 //            SimulationScript.incidentColors[oldIncidentIndex] = selectedColor; 
    1549 //            script.incidents.add(oldIncidentIndex, 
    1550 //                    new ScriptIncident(SimulationScript.incidentColors[oldIncidentIndex], 
    1551 //                            (Integer) addIncidentNumber.getValue(), addIncidentName.getText(), addIncidentDescription.getText(), 
    1552 //                            script)); 
    1553 //            script.incidents.get(oldIncidentIndex).length = (Integer) addIncidentLength.getValue() * 60; 
    1554 //            script.incidents.get(oldIncidentIndex).slices = backup.slices; 
    1555 //            script.incidents.get(oldIncidentIndex).offset = backup.offset; 
    1556 //            script.incidents.get(oldIncidentIndex).setOffset((Integer) addIncidentStart.getValue() * 60); 
    1557  
    15581547            //adjust incident color 
    15591548            script.incidents.get(oldIncidentIndex).color = selectedColor; 
     
    15701559                script.incidents.get(oldIncidentIndex).number = (int) addIncidentNumber.getValue(); 
    15711560            } 
    1572             else 
     1561            else//if the updated value conflicts with an existing inc number, 
     1562            //the inc number update fails 
    15731563            { 
    15741564                JOptionPane.showMessageDialog(this, "Incident number already in use.", 
     
    15771567        } 
    15781568 
     1569        //close this frame 
    15791570        incidentFrame.setVisible(false); 
    15801571        this.update(script, script); 
     
    15821573    }//GEN-LAST:event_incidentOkButtonActionPerformed 
    15831574 
     1575    /** 
     1576     * Determine if the given incident number is already present in the script. 
     1577     * 
     1578     * @param script the current simulation script 
     1579     * @param num the incident log number to check 
     1580     * @return true if one of the existing incidents in the script uses that log 
     1581     * number 
     1582     */ 
    15841583    private boolean scriptContainsLogNum(SimulationScript script, int num) 
    15851584    { 
     
    16151614        addIncidentNumber.setValue(101); 
    16161615        addIncidentStart.setValue(0); 
    1617         labelIncidentLength.setText("0"); 
     1616        txtIncidentLength.setText("0"); 
    16181617        incidentColorField.setBackground(Color.BLACK); 
    16191618        selectedColor = Color.BLACK; 
     
    16351634        JFileChooser fc = new JFileChooser(); 
    16361635 
     1636        //Search for .xml files 
    16371637        fc.setFileFilter(new ExtensionFileFilter("Simulation Script XML (.xml)", 
    16381638                new String[] 
     
    16421642        if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) 
    16431643        { 
     1644            //make a new script and load it with values from the selected file 
    16441645            script = new SimulationScript(); 
    1645             System.out.println(fc.getSelectedFile().getName()); 
    16461646            script.loadScriptFromFile(fc.getSelectedFile()); 
    16471647            script.saveFile = fc.getSelectedFile(); 
    16481648        } 
    16491649        this.update(script, script); 
     1650        //zoom out all the way so that the whole imported script is visible 
    16501651        zoomSlider.setValue(zoomSlider.getMinimum()); 
    16511652        repaint(); 
     
    16811682     */ 
    16821683    private void fileSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileSaveActionPerformed 
     1684        //If the script has never been saved before, we need to name or create a  
     1685        //file in which to save it 
    16831686        if (script.saveFile == null) 
    16841687        { 
    16851688            fileSaveAsActionPerformed(evt); 
    16861689        } 
     1690        //Otherwise, just save to the previously selected save spot 
    16871691        else 
    16881692        { 
     
    16911695    }//GEN-LAST:event_fileSaveActionPerformed 
    16921696 
     1697    /** 
     1698     * Allow this window to refresh itself, after a different window loses 
     1699     * focus. 
     1700     */ 
    16931701    public void returnFocus() 
    16941702    { 
     
    16971705    } 
    16981706 
     1707    /** 
     1708     * Set up the incident details/properties window so that it reflects the 
     1709     * values of the selected incident. Then, make the window visible. 
     1710     * 
     1711     * @param i the incident to be represented by this details window 
     1712     */ 
    16991713    public void incidentDetailsScreen(ScriptIncident i) 
    17001714    { 
     
    17051719        addIncidentNumber.setValue(i.number); 
    17061720        addIncidentStart.setValue(i.offset / 60); 
    1707         labelIncidentLength.setText(""+(i.length/60) ); 
    1708         labelIncidentLength.setHorizontalTextPosition(SwingConstants.RIGHT); 
     1721        txtIncidentLength.setText("" + (i.length / 60)); 
     1722        txtIncidentLength.setHorizontalTextPosition(SwingConstants.RIGHT); 
    17091723        //addIncidentLength.setValue(i.length / 60); 
    17101724        incidentColorField.setBackground(i.color); 
     
    17301744     * @param evt the button press event 
    17311745     */ 
    1732     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 
     1746    private void btnCancelNoiseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelNoiseActionPerformed 
    17331747        addNoiseFrame.setVisible(false); 
    1734     }//GEN-LAST:event_jButton1ActionPerformed 
    1735  
    1736     /** 
    1737      * Generates random noise upon click of the "OK" button, then hides the 
    1738      * noise generation screen. 
     1748    }//GEN-LAST:event_btnCancelNoiseActionPerformed 
     1749 
     1750    /** 
     1751     * Generates random noise upon click of the "Generate" button, then hides 
     1752     * the noise generation screen. 
    17391753     * 
    17401754     * @param evt the button press event 
    17411755     */ 
    1742     private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 
     1756    private void btnGenerateNoiseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGenerateNoiseActionPerformed 
    17431757        Random rng = new Random(); 
    17441758        ScriptEventType[] eventTypes = ScriptEventType.values(); 
    17451759 
    17461760        /* For prototyping purpose, ignore the sliders and average their values */ 
    1747         int total = jSlider1.getValue() + jSlider2.getValue() + jSlider3.getValue() + jSlider5.getValue() + jSlider4.getValue(); 
     1761        int total = radioChatterSlider.getValue() + laneClosuresSlider.getValue() + TMCALSlider.getValue() + minorEventsSlider.getValue() + backgroundNoiseSlider.getValue(); 
    17481762        total /= 5; 
    17491763 
     
    17781792        this.update(script, script); 
    17791793        repaint(); 
    1780 }//GEN-LAST:event_jButton2ActionPerformed 
     1794}//GEN-LAST:event_btnGenerateNoiseActionPerformed 
    17811795 
    17821796    /** 
     
    17901804        String input = ""; 
    17911805        ScriptIncident inc = null; 
     1806 
     1807        //Pick the incident to save 
    17921808        Object result = JOptionPane.showInputDialog( 
    17931809                this, 
     
    17981814                incidentList, 
    17991815                script.incidents.get(0)); 
    1800  
    1801         System.out.println("RESULT = " + result.toString()); 
    1802  
    18031816        input = result.toString(); 
    1804  
    1805         System.out.println("INPUT = " + input); 
    1806  
    18071817        int i = 0; 
    18081818        for (ScriptIncident incident : script.incidents) 
     
    18121822                continue; 
    18131823            } 
    1814             System.out.println((++i) + ": " + incident.toString()); 
    18151824            if (incident.toString().equals(input)) 
    18161825            { 
     
    18211830        if (inc == null) 
    18221831        { 
    1823             System.out.println("DIDN'T FIND ANYTHING"); 
    18241832            return; 
    18251833        } 
    18261834 
     1835        //Pick the file to save it to 
    18271836        JFileChooser fc = new JFileChooser(); 
    18281837        fc.setFileFilter(new ExtensionFileFilter("Script Incident (.xml)", new String[] 
     
    18361845    }//GEN-LAST:event_saveIncidentActionPerformed 
    18371846 
     1847    /** 
     1848     * Bring up the incident palette for loading of new incidents. 
     1849     * 
     1850     * @param evt the menu click event 
     1851     */ 
    18381852    private void loadIncidentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadIncidentActionPerformed 
    18391853        new IncidentPaletteFrame(script, this).setVisible(true); 
     
    18411855    }//GEN-LAST:event_loadIncidentActionPerformed 
    18421856 
     1857    //Unsupported as of 2017/09/05 
    18431858    private void generateProjectRequirementsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateProjectRequirementsActionPerformed 
    18441859        JFileChooser fc = new JFileChooser(); 
     
    18511866    }//GEN-LAST:event_generateProjectRequirementsActionPerformed 
    18521867 
     1868    //Unsupported as of 2017/09/05 
    18531869    private void generateNotebooksActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateNotebooksActionPerformed 
    18541870        JFileChooser fc = new JFileChooser(); 
     
    18611877    }//GEN-LAST:event_generateNotebooksActionPerformed 
    18621878 
     1879    //Unsupported as of 2017/09/05 
    18631880    private void generateScorecardsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateScorecardsActionPerformed 
    18641881        JFileChooser fc = new JFileChooser(); 
     
    18711888    }//GEN-LAST:event_generateScorecardsActionPerformed 
    18721889 
     1890    //Unsupported as of 2017/09/05 
    18731891    private void generateOrganizationChartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateOrganizationChartActionPerformed 
    18741892        JFileChooser fc = new JFileChooser(); 
     
    19061924    private Color selectedColor = Color.BLACK; 
    19071925 
    1908     private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed 
     1926    private void btnChooseColorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChooseColorActionPerformed 
     1927        //For whatever reason, this causes the incident properties frame to be hidden 
    19091928        Color newColor = incidentColorChooser.showDialog(this, "Incident Color", incidentColorField.getBackground()); 
    19101929        if (newColor != null) 
    19111930        { 
    1912             System.out.println("New color is " + newColor.toString()); 
     1931            //If the user selected a color, apply it to the properties frame 
    19131932            selectedColor = newColor; 
    19141933            incidentColorField.setBackground(newColor); 
    19151934        } 
     1935        //Return focus to the properties frame 
    19161936        incidentFrame.setVisible(true); 
    1917     }//GEN-LAST:event_jButton3ActionPerformed 
     1937    }//GEN-LAST:event_btnChooseColorActionPerformed 
    19181938 
    19191939    /* Help > About simply displays the current SVN revision number so 
     
    19261946    }//GEN-LAST:event_helpAboutActionPerformed 
    19271947 
     1948    /** 
     1949     * Replaces the current script with a new, blank script. 
     1950     * 
     1951     * @param evt the menu selection event 
     1952     */ 
    19281953    private void fileNewActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_fileNewActionPerformed 
    19291954    {//GEN-HEADEREND:event_fileNewActionPerformed 
     
    19341959    }//GEN-LAST:event_fileNewActionPerformed 
    19351960 
     1961    /** 
     1962     * Allows the user to delete an incident from the current script. 
     1963     * 
     1964     * @param evt the menu selection event 
     1965     */ 
    19361966    private void deleteIncidentActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_deleteIncidentActionPerformed 
    19371967    {//GEN-HEADEREND:event_deleteIncidentActionPerformed 
     
    19391969        String input = ""; 
    19401970        ScriptIncident inc = null; 
     1971        //Choose the incident to be deleted 
    19411972        Object result = JOptionPane.showInputDialog( 
    19421973                this, 
     
    19511982        { 
    19521983            input = result.toString(); 
    1953             int incidentIndex = 0; 
    19541984            for (ScriptIncident incident : script.incidents) 
    19551985            { 
    1956                 incidentIndex++; 
    19571986                if (incident == null) 
    19581987                { 
     
    19651994            } 
    19661995 
     1996            //Allow user to verify deletion before proceeding 
    19671997            if (inc != null) 
    19681998            { 
     
    19712001                if (confirm == JOptionPane.YES_OPTION) 
    19722002                { 
     2003                    //Remove the incident and replace it with a null placeholder 
    19732004                    script.incidents.remove(inc); 
    19742005                    script.incidents.add(null); 
     
    19772008            } 
    19782009        } 
     2010        //Refresh 
    19792011        this.update(script, script); 
    19802012        repaint(); 
    19812013    }//GEN-LAST:event_deleteIncidentActionPerformed 
    1982  
     2014    /** 
     2015     * Add 15 minutes to the end of the visible timeline. 
     2016     * 
     2017     * @param evt the button press event. 
     2018     */ 
    19832019    private void btnAddTimeActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnAddTimeActionPerformed 
    19842020    {//GEN-HEADEREND:event_btnAddTimeActionPerformed 
     
    19862022        this.update(script, script); 
    19872023    }//GEN-LAST:event_btnAddTimeActionPerformed 
     2024 
     2025    private void cadEventActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_cadEventActionPerformed 
     2026    {//GEN-HEADEREND:event_cadEventActionPerformed 
     2027        // TODO add your handling code here: 
     2028    }//GEN-LAST:event_cadEventActionPerformed 
    19882029 
    19892030    /** 
     
    20222063 
    20232064    /** 
    2024      * Runs the script builder. 
     2065     * Runs the script builder. This is the main method for the whole program. 
    20252066     * 
    20262067     * @param args the command line arguments 
     
    20322073            UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); 
    20332074        } 
    2034         catch (ClassNotFoundException ex) 
    2035         { 
    2036         } 
    2037         catch (InstantiationException ex) 
    2038         { 
    2039         } 
    2040         catch (IllegalAccessException ex) 
    2041         { 
    2042         } 
    2043         catch (UnsupportedLookAndFeelException ex) 
    2044         { 
     2075        catch (Exception ex) 
     2076        { 
     2077            //Apparently we don't do any special exception processing 
    20452078        } 
    20462079 
     
    20492082            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); 
    20502083        } 
    2051         catch (ClassNotFoundException ex) 
    2052         { 
    2053         } 
    2054         catch (InstantiationException ex) 
    2055         { 
    2056         } 
    2057         catch (IllegalAccessException ex) 
    2058         { 
    2059         } 
    2060         catch (UnsupportedLookAndFeelException ex) 
    2061         { 
     2084        catch (Exception ex) 
     2085        { 
     2086            //Apparently we don't do any special exception processing 
    20622087        } 
    20632088 
     
    20722097    } 
    20732098    // Variables declaration - do not modify//GEN-BEGIN:variables 
     2099    private javax.swing.JSlider TMCALSlider; 
    20742100    private javax.swing.JTextArea addIncidentDescription; 
    20752101    private javax.swing.JTextField addIncidentName; 
     
    20772103    private javax.swing.JSpinner addIncidentStart; 
    20782104    private javax.swing.JFrame addNoiseFrame; 
     2105    private javax.swing.JSlider backgroundNoiseSlider; 
    20792106    private javax.swing.JButton btnAddTime; 
     2107    private javax.swing.JButton btnCancelNoise; 
     2108    private javax.swing.JButton btnChooseColor; 
     2109    private javax.swing.JButton btnGenerateNoise; 
    20802110    private javax.swing.JMenuItem cadEvent; 
    20812111    private javax.swing.JFrame cadEventFrame; 
     
    21182148    private javax.swing.JButton incidentOkButton; 
    21192149    private javax.swing.JPopupMenu incidentPopupMenu; 
     2150    private javax.swing.JScrollPane incidentPropertiesScrollPane; 
    21202151    private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel1; 
    21212152    private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel10; 
     
    21282159    private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel8; 
    21292160    private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel9; 
    2130     private javax.swing.JButton jButton1; 
    2131     private javax.swing.JButton jButton2; 
    2132     private javax.swing.JButton jButton3; 
    2133     private javax.swing.JLabel jLabel10; 
    2134     private javax.swing.JLabel jLabel11; 
    2135     private javax.swing.JLabel jLabel12; 
    2136     private javax.swing.JLabel jLabel13; 
    2137     private javax.swing.JLabel jLabel14; 
    2138     private javax.swing.JLabel jLabel15; 
    2139     private javax.swing.JLabel jLabel16; 
    2140     private javax.swing.JLabel jLabel17; 
    2141     private javax.swing.JLabel jLabel20; 
    2142     private javax.swing.JLabel jLabel21; 
    2143     private javax.swing.JLabel jLabel5; 
    2144     private javax.swing.JLabel jLabel6; 
    2145     private javax.swing.JLabel jLabel7; 
    2146     private javax.swing.JLabel jLabel8; 
    2147     private javax.swing.JLabel jLabel9; 
    21482161    private javax.swing.JMenuItem jMenuItem2; 
    21492162    private javax.swing.JMenuItem jMenuItem3; 
     
    21512164    private javax.swing.JMenuItem jMenuItem5; 
    21522165    private javax.swing.JMenuItem jMenuItem6; 
    2153     private javax.swing.JScrollPane jScrollPane1; 
    21542166    private javax.swing.JPopupMenu.Separator jSeparator1; 
    21552167    private javax.swing.JPopupMenu.Separator jSeparator2; 
    21562168    private javax.swing.JPopupMenu.Separator jSeparator3; 
    21572169    private javax.swing.JPopupMenu.Separator jSeparator4; 
    2158     private javax.swing.JSlider jSlider1; 
    2159     private javax.swing.JSlider jSlider2; 
    2160     private javax.swing.JSlider jSlider3; 
    2161     private javax.swing.JSlider jSlider4; 
    2162     private javax.swing.JSlider jSlider5; 
    2163     private javax.swing.JTextArea jTextArea1; 
     2170    private javax.swing.JLabel labelBackgroundNoise; 
     2171    private javax.swing.JLabel labelCADEntry; 
     2172    private javax.swing.JLabel labelIncidentColor; 
     2173    private javax.swing.JLabel labelIncidentDescription; 
    21642174    private javax.swing.JLabel labelIncidentLength; 
     2175    private javax.swing.JLabel labelIncidentName; 
     2176    private javax.swing.JLabel labelIncidentNumber; 
     2177    private javax.swing.JLabel labelIncidentStart; 
     2178    private javax.swing.JLabel labelLaneClosures; 
     2179    private javax.swing.JLabel labelLeastFreq; 
     2180    private javax.swing.JLabel labelMinorEvents; 
     2181    private javax.swing.JLabel labelMostFreq; 
     2182    private javax.swing.JLabel labelRadioChatter; 
     2183    private javax.swing.JLabel labelRadioMessage; 
     2184    private javax.swing.JLabel labelRadioType; 
     2185    private javax.swing.JLabel labelTMCALLogs; 
     2186    private javax.swing.JSlider laneClosuresSlider; 
    21652187    private javax.swing.JMenuItem loadIncident; 
     2188    private javax.swing.JSlider minorEventsSlider; 
    21662189    private javax.swing.JMenuItem newIncident; 
    21672190    private javax.swing.JButton okButton; 
    21682191    private javax.swing.JMenuItem popupDeleteIncident; 
     2192    private javax.swing.JSlider radioChatterSlider; 
    21692193    private javax.swing.JMenuItem radioEvent; 
    21702194    private javax.swing.JFrame radioEventFrame; 
     
    21722196    private javax.swing.JScrollPane radioMessageScrollPane; 
    21732197    private javax.swing.JComboBox radioTypeComboBox; 
    2174     private javax.swing.JLabel radioTypeLabel; 
    21752198    private javax.swing.JMenuItem saveIncident; 
    21762199    private javax.swing.JMenuBar scriptBuilderMenuBar; 
     
    21792202    private scriptbuilder.gui.panels.TimelineTickPanel timelineTickPanel; 
    21802203    private javax.swing.JScrollPane timelinesScrollPane; 
     2204    private javax.swing.JLabel txtIncidentLength; 
     2205    private javax.swing.JTextArea txtNoiseDescription; 
    21812206    private javax.swing.JLabel zoomInIcon; 
    21822207    private javax.swing.JLabel zoomOutIcon; 
Note: See TracChangeset for help on using the changeset viewer.