Changeset 109 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder
- Timestamp:
- 09/05/2017 04:08:45 PM (9 years ago)
- Location:
- trunk/src/scriptbuilder/gui
- Files:
-
- 2 edited
-
ScriptBuilderFrame.form (modified) (25 diffs)
-
ScriptBuilderFrame.java (modified) (70 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/gui/ScriptBuilderFrame.form
r108 r109 29 29 <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="cadEventMousePressed"/> 30 30 <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"/> 31 32 </Events> 32 33 </MenuItem> … … 73 74 <Group type="102" attributes="0"> 74 75 <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"/> 76 77 <EmptySpace max="32767" attributes="0"/> 77 78 </Group> … … 82 83 <Group type="102" alignment="0" attributes="0"> 83 84 <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"/> 85 86 <EmptySpace pref="1357" max="32767" attributes="0"/> 86 87 </Group> … … 89 90 </Layout> 90 91 <SubComponents> 91 <Component class="javax.swing.JLabel" name=" jLabel5">92 <Component class="javax.swing.JLabel" name="labelCADEntry"> 92 93 <Properties> 93 94 <Property name="text" type="java.lang.String" value="CAD Entry"/> … … 112 113 <Component id="radioMessageScrollPane" alignment="0" pref="380" max="32767" attributes="0"/> 113 114 <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"/> 115 116 <EmptySpace type="unrelated" max="-2" attributes="0"/> 116 117 <Component id="radioTypeComboBox" pref="312" max="32767" attributes="0"/> 117 118 </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"/> 119 120 <Group type="102" alignment="0" attributes="0"> 120 121 <Component id="cancelButton" min="-2" max="-2" attributes="0"/> … … 132 133 <EmptySpace max="-2" attributes="0"/> 133 134 <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"/> 135 136 <Component id="radioTypeComboBox" alignment="3" min="-2" max="-2" attributes="0"/> 136 137 </Group> 137 138 <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"/> 139 140 <EmptySpace max="-2" attributes="0"/> 140 141 <Component id="radioMessageScrollPane" pref="198" max="32767" attributes="0"/> … … 150 151 </Layout> 151 152 <SubComponents> 152 <Component class="javax.swing.JLabel" name=" radioTypeLabel">153 <Component class="javax.swing.JLabel" name="labelRadioType"> 153 154 <Properties> 154 155 <Property name="text" type="java.lang.String" value="Radio Type:"/> 155 156 </Properties> 156 157 </Component> 157 <Component class="javax.swing.JLabel" name=" jLabel7">158 <Component class="javax.swing.JLabel" name="labelRadioMessage"> 158 159 <Properties> 159 160 <Property name="text" type="java.lang.String" value="Radio Message:"/> … … 243 244 <EmptySpace max="-2" attributes="0"/> 244 245 <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"/> 247 248 <Group type="102" alignment="0" attributes="0"> 248 249 <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"/> 252 253 </Group> 253 254 <EmptySpace type="separate" max="-2" attributes="0"/> … … 258 259 <Component id="incidentColorField" pref="119" max="32767" attributes="0"/> 259 260 <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"/> 261 262 </Group> 262 263 </Group> … … 269 270 <Group type="102" alignment="0" attributes="0"> 270 271 <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"/> 273 274 </Group> 274 275 <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> … … 276 277 <Group type="102" attributes="0"> 277 278 <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"/> 279 280 <EmptySpace min="22" pref="22" max="-2" attributes="0"/> 280 281 </Group> … … 292 293 <EmptySpace max="-2" attributes="0"/> 293 294 <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"/> 295 296 <Component id="addIncidentNumber" alignment="3" min="-2" max="-2" attributes="0"/> 296 297 </Group> 297 298 <EmptySpace max="-2" attributes="0"/> 298 299 <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"/> 300 301 <Component id="addIncidentName" alignment="3" min="-2" max="-2" attributes="0"/> 301 302 </Group> 302 303 <EmptySpace max="-2" attributes="0"/> 303 304 <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"/> 306 307 <Component id="incidentColorField" alignment="3" min="-2" max="-2" attributes="0"/> 307 308 </Group> 308 309 <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"/> 312 313 <EmptySpace max="-2" attributes="0"/> 313 314 <Group type="103" groupAlignment="3" attributes="0"> 314 315 <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"/> 316 317 </Group> 317 318 <EmptySpace max="-2" attributes="0"/> 318 319 <Group type="103" groupAlignment="3" attributes="0"> 319 <Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>320 320 <Component id="labelIncidentLength" alignment="3" min="-2" max="-2" attributes="0"/> 321 <Component id="txtIncidentLength" alignment="3" min="-2" max="-2" attributes="0"/> 321 322 </Group> 322 323 <EmptySpace max="-2" attributes="0"/> … … 331 332 </Layout> 332 333 <SubComponents> 333 <Component class="javax.swing.JLabel" name=" jLabel6">334 <Component class="javax.swing.JLabel" name="labelIncidentNumber"> 334 335 <Properties> 335 336 <Property name="text" type="java.lang.String" value="Incident Number: "/> 336 337 </Properties> 337 338 </Component> 338 <Component class="javax.swing.JLabel" name=" jLabel8">339 <Component class="javax.swing.JLabel" name="labelIncidentName"> 339 340 <Properties> 340 341 <Property name="text" type="java.lang.String" value="Incident Name:"/> 341 342 </Properties> 342 343 </Component> 343 <Component class="javax.swing.JLabel" name=" jLabel9">344 <Component class="javax.swing.JLabel" name="labelIncidentColor"> 344 345 <Properties> 345 346 <Property name="text" type="java.lang.String" value="Incident Color: "/> 346 347 </Properties> 347 348 </Component> 348 <Component class="javax.swing.JLabel" name=" jLabel10">349 <Component class="javax.swing.JLabel" name="labelIncidentDescription"> 349 350 <Properties> 350 351 <Property name="text" type="java.lang.String" value="Incident Description:"/> 351 352 </Properties> 352 353 </Component> 353 <Container class="javax.swing.JScrollPane" name=" jScrollPane1">354 <Container class="javax.swing.JScrollPane" name="incidentPropertiesScrollPane"> 354 355 <Properties> 355 356 <Property name="horizontalScrollBarPolicy" type="int" value="31"/> … … 397 398 <Component class="javax.swing.JTextField" name="addIncidentName"> 398 399 </Component> 399 <Component class="javax.swing.JLabel" name=" jLabel11">400 <Component class="javax.swing.JLabel" name="labelIncidentLength"> 400 401 <Properties> 401 402 <Property name="text" type="java.lang.String" value="Incident Length in Minutes: "/> 402 403 </Properties> 403 404 </Component> 404 <Component class="javax.swing.JLabel" name=" jLabel12">405 <Component class="javax.swing.JLabel" name="labelIncidentStart"> 405 406 <Properties> 406 407 <Property name="text" type="java.lang.String" value="Incident Start Time in Minutes:"/> … … 414 415 </Properties> 415 416 </Component> 416 <Component class="javax.swing.JButton" name=" jButton3">417 <Component class="javax.swing.JButton" name="btnChooseColor"> 417 418 <Properties> 418 419 <Property name="text" type="java.lang.String" value="Choose..."/> 419 420 </Properties> 420 421 <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"/> 422 423 </Events> 423 424 </Component> … … 430 431 </Properties> 431 432 </Component> 432 <Component class="javax.swing.JLabel" name=" labelIncidentLength">433 <Component class="javax.swing.JLabel" name="txtIncidentLength"> 433 434 <Properties> 434 435 <Property name="horizontalAlignment" type="int" value="4"/> … … 454 455 <EmptySpace pref="21" max="32767" attributes="0"/> 455 456 <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"/> 457 458 <Group type="103" alignment="1" groupAlignment="1" max="-2" attributes="0"> 458 459 <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"/> 460 461 <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"/> 462 463 </Group> 463 464 <Group type="102" alignment="0" attributes="0"> 464 465 <Group type="103" groupAlignment="0" attributes="0"> 465 466 <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"/> 470 471 </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"/> 472 473 </Group> 473 474 <EmptySpace min="-2" pref="4" max="-2" attributes="0"/> 474 475 <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"/> 480 481 <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"/> 482 483 <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"/> 484 485 </Group> 485 486 </Group> … … 495 496 <Group type="102" alignment="1" attributes="0"> 496 497 <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"/> 498 499 <EmptySpace max="-2" attributes="0"/> 499 500 <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"/> 502 503 </Group> 503 504 <EmptySpace max="-2" attributes="0"/> 504 505 <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"/> 507 508 </Group> 508 509 <EmptySpace max="-2" attributes="0"/> 509 510 <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"/> 512 513 </Group> 513 514 <EmptySpace max="-2" attributes="0"/> 514 515 <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"/> 517 518 </Group> 518 519 <EmptySpace max="-2" attributes="0"/> 519 520 <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"/> 527 528 </Group> 528 529 <EmptySpace type="separate" max="-2" attributes="0"/> 529 530 <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"/> 532 533 </Group> 533 534 <EmptySpace max="-2" attributes="0"/> … … 537 538 </Layout> 538 539 <SubComponents> 539 <Component class="javax.swing.JLabel" name=" jLabel13">540 <Component class="javax.swing.JLabel" name="labelRadioChatter"> 540 541 <Properties> 541 542 <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> … … 545 546 </Properties> 546 547 </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"> 552 553 <Properties> 553 554 <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> … … 557 558 </Properties> 558 559 </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"> 562 563 <Properties> 563 564 <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> … … 567 568 </Properties> 568 569 </Component> 569 <Component class="javax.swing.JTextArea" name=" jTextArea1">570 <Component class="javax.swing.JTextArea" name="txtNoiseDescription"> 570 571 <Properties> 571 572 <Property name="editable" type="boolean" value="false"/> … … 589 590 </Properties> 590 591 </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"> 594 595 <Properties> 595 596 <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> … … 599 600 </Properties> 600 601 </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"> 604 605 <Properties> 605 606 <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> … … 609 610 </Properties> 610 611 </Component> 611 <Component class="javax.swing.JButton" name=" jButton1">612 <Component class="javax.swing.JButton" name="btnCancelNoise"> 612 613 <Properties> 613 614 <Property name="text" type="java.lang.String" value="Cancel"/> 614 615 </Properties> 615 616 <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"/> 617 618 </Events> 618 619 </Component> 619 <Component class="javax.swing.JButton" name=" jButton2">620 <Component class="javax.swing.JButton" name="btnGenerateNoise"> 620 621 <Properties> 621 622 <Property name="text" type="java.lang.String" value="Generate"/> 622 623 </Properties> 623 624 <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"/> 625 626 </Events> 626 627 </Component> 627 <Component class="javax.swing.JLabel" name=" jLabel20">628 <Component class="javax.swing.JLabel" name="labelLeastFreq"> 628 629 <Properties> 629 630 <Property name="text" type="java.lang.String" value="Least Frequent"/> 630 631 </Properties> 631 632 </Component> 632 <Component class="javax.swing.JLabel" name=" jLabel21">633 <Component class="javax.swing.JLabel" name="labelMostFreq"> 633 634 <Properties> 634 635 <Property name="text" type="java.lang.String" value="Most Frequent"/> -
trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java
r108 r109 177 177 public void update(Observable o, Object arg) 178 178 { 179 //Three major update types: whole script, and 2 event updates 179 180 if (arg instanceof SimulationScript) 180 181 { 181 182 script = (SimulationScript) arg; 182 183 184 //If we don't have exactly 10 events something is wrong 183 185 if (script.incidents.size() != 10) 184 186 { … … 186 188 } 187 189 190 //Call update on major panels 188 191 timelineTickPanel.update(script); 189 192 timeStampPanel.update(script); 190 193 194 //Call update on all timeline panels 191 195 incidentTimelinePanel1.timelinePanelUpdate(script.incidents.get(0)); 192 196 incidentTimelinePanel2.timelinePanelUpdate(script.incidents.get(1)); … … 200 204 incidentTimelinePanel10.timelinePanelUpdate(script.incidents.get(9)); 201 205 206 //Cal update on number panels 202 207 incidentNumberPanel1.update(script.incidents.get(0)); 203 208 incidentNumberPanel2.update(script.incidents.get(1)); … … 219 224 pack(); 220 225 } 226 //Mouse has changed focus to a different timeslice 221 227 else if (arg instanceof SliceChangedEvent) 222 228 { … … 229 235 } 230 236 } 237 //Mouse has changed focus to a different incident timeline panel 231 238 else if (arg instanceof IncidentFocusedEvent) 232 239 { … … 236 243 } 237 244 245 //Regardless of update type, refresh window by doing these things: 246 //Enable "+15:00" button if script is not empty 238 247 btnAddTime.setEnabled(script != null && script.numberOfIncidents > 0); 239 248 249 //enable zoom slider if script is not empty 240 250 zoomSlider.setEnabled(script != null && script.numberOfIncidents > 0); 241 251 252 //scale the zoom slider such that the most zoomed-out point allows the 253 //entire script to be visible at once 242 254 zoomSlider.setMinimum(((timelineTickPanel.getVisibleRect().width - 20) 243 255 * ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION) … … 267 279 jMenuItem6 = new javax.swing.JMenuItem(); 268 280 cadEventFrame = new javax.swing.JFrame(); 269 jLabel5= new javax.swing.JLabel();281 labelCADEntry = new javax.swing.JLabel(); 270 282 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(); 273 285 radioTypeComboBox = new javax.swing.JComboBox(); 274 286 radioMessageScrollPane = new javax.swing.JScrollPane(); … … 280 292 deleteEventList = new javax.swing.JMenuItem(); 281 293 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(); 287 299 addIncidentDescription = new javax.swing.JTextArea(); 288 300 incidentOkButton = new javax.swing.JButton(); … … 290 302 addIncidentNumber = new javax.swing.JSpinner(); 291 303 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(); 294 306 addIncidentStart = new javax.swing.JSpinner(); 295 jButton3= new javax.swing.JButton();307 btnChooseColor = new javax.swing.JButton(); 296 308 incidentColorField = new javax.swing.JTextField(); 297 labelIncidentLength = new javax.swing.JLabel();309 txtIncidentLength = new javax.swing.JLabel(); 298 310 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(); 314 326 incidentColorChooser = new javax.swing.JColorChooser(); 315 327 timelinesScrollPane = new javax.swing.JScrollPane(); … … 383 395 } 384 396 }); 397 cadEvent.addActionListener(new java.awt.event.ActionListener() 398 { 399 public void actionPerformed(java.awt.event.ActionEvent evt) 400 { 401 cadEventActionPerformed(evt); 402 } 403 }); 385 404 eventPopupMenu.add(cadEvent); 386 405 … … 409 428 cadEventFrame.setMinimumSize(new java.awt.Dimension(400, 300)); 410 429 411 jLabel5.setText("CAD Entry");430 labelCADEntry.setText("CAD Entry"); 412 431 413 432 javax.swing.GroupLayout cadEventFrameLayout = new javax.swing.GroupLayout(cadEventFrame.getContentPane()); … … 417 436 .addGroup(cadEventFrameLayout.createSequentialGroup() 418 437 .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) 420 439 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 421 440 ); … … 424 443 .addGroup(cadEventFrameLayout.createSequentialGroup() 425 444 .addContainerGap() 426 .addComponent( jLabel5)445 .addComponent(labelCADEntry) 427 446 .addContainerGap(1357, Short.MAX_VALUE)) 428 447 ); … … 431 450 radioEventFrame.setMinimumSize(new java.awt.Dimension(400, 300)); 432 451 433 radioTypeLabel.setText("Radio Type:");434 435 jLabel7.setText("Radio Message:");452 labelRadioType.setText("Radio Type:"); 453 454 labelRadioMessage.setText("Radio Message:"); 436 455 437 456 radioTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TMT", "Maintanence" })); … … 472 491 .addComponent(radioMessageScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) 473 492 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, radioEventFrameLayout.createSequentialGroup() 474 .addComponent( radioTypeLabel)493 .addComponent(labelRadioType) 475 494 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 476 495 .addComponent(radioTypeComboBox, 0, 312, Short.MAX_VALUE)) 477 .addComponent( jLabel7, javax.swing.GroupLayout.Alignment.LEADING)496 .addComponent(labelRadioMessage, javax.swing.GroupLayout.Alignment.LEADING) 478 497 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, radioEventFrameLayout.createSequentialGroup() 479 498 .addComponent(cancelButton) … … 487 506 .addContainerGap() 488 507 .addGroup(radioEventFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 489 .addComponent( radioTypeLabel)508 .addComponent(labelRadioType) 490 509 .addComponent(radioTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 491 510 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 492 .addComponent( jLabel7)511 .addComponent(labelRadioMessage) 493 512 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 494 513 .addComponent(radioMessageScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE) … … 516 535 incidentFrame.setMinimumSize(new java.awt.Dimension(400, 400)); 517 536 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); 528 547 529 548 addIncidentDescription.setColumns(20); … … 531 550 addIncidentDescription.setRows(5); 532 551 addIncidentDescription.setWrapStyleWord(true); 533 jScrollPane1.setViewportView(addIncidentDescription);552 incidentPropertiesScrollPane.setViewportView(addIncidentDescription); 534 553 535 554 incidentOkButton.setText("OK"); … … 553 572 addIncidentNumber.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(101), Integer.valueOf(101), null, Integer.valueOf(1))); 554 573 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:"); 558 577 559 578 addIncidentStart.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1))); 560 579 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); 567 586 } 568 587 }); … … 571 590 incidentColorField.setBackground(new java.awt.Color(0, 0, 0)); 572 591 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(""); 576 595 577 596 javax.swing.GroupLayout incidentFrameLayout = new javax.swing.GroupLayout(incidentFrame.getContentPane()); … … 582 601 .addContainerGap() 583 602 .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) 586 605 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup() 587 606 .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)) 591 610 .addGap(18, 18, 18) 592 611 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) … … 596 615 .addComponent(incidentColorField, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) 597 616 .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)))) 599 618 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup() 600 619 .addComponent(incidentCancelButton) … … 603 622 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup() 604 623 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 605 .addComponent( jLabel12)606 .addComponent( jLabel11))624 .addComponent(labelIncidentStart) 625 .addComponent(labelIncidentLength)) 607 626 .addGap(18, 18, 18) 608 627 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 609 628 .addGroup(incidentFrameLayout.createSequentialGroup() 610 629 .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) 612 631 .addGap(22, 22, 22)) 613 632 .addComponent(addIncidentStart, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)))) … … 619 638 .addContainerGap() 620 639 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 621 .addComponent( jLabel6)640 .addComponent(labelIncidentNumber) 622 641 .addComponent(addIncidentNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 623 642 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 624 643 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 625 .addComponent( jLabel8)644 .addComponent(labelIncidentName) 626 645 .addComponent(addIncidentName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 627 646 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 628 647 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 629 .addComponent( jLabel9)630 .addComponent( jButton3)648 .addComponent(labelIncidentColor) 649 .addComponent(btnChooseColor) 631 650 .addComponent(incidentColorField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 632 651 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 633 .addComponent( jLabel10)652 .addComponent(labelIncidentDescription) 634 653 .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) 636 655 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 637 656 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 638 657 .addComponent(addIncidentStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 639 .addComponent( jLabel12))658 .addComponent(labelIncidentStart)) 640 659 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 641 660 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 642 .addComponent( jLabel11)643 .addComponent( labelIncidentLength))661 .addComponent(labelIncidentLength) 662 .addComponent(txtIncidentLength)) 644 663 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 645 664 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) … … 653 672 addNoiseFrame.setResizable(false); 654 673 655 jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N656 jLabel13.setText("Radio Chatter: ");657 658 jLabel14.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N659 jLabel14.setText("Lane Closures:");660 661 jLabel15.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N662 jLabel15.setText("TMCAL Logs:");663 664 jTextArea1.setEditable(false);665 jTextArea1.setColumns(20);666 jTextArea1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N667 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)); // NOI18N678 jLabel16.setText("Background Noise: ");679 680 jLabel17.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N681 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"); 704 723 705 724 javax.swing.GroupLayout addNoiseFrameLayout = new javax.swing.GroupLayout(addNoiseFrame.getContentPane()); … … 710 729 .addContainerGap(21, Short.MAX_VALUE) 711 730 .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 712 .addComponent( jTextArea1, javax.swing.GroupLayout.Alignment.LEADING)731 .addComponent(txtNoiseDescription, javax.swing.GroupLayout.Alignment.LEADING) 713 732 .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) 714 733 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, addNoiseFrameLayout.createSequentialGroup() 715 .addComponent( jButton1)734 .addComponent(btnCancelNoise) 716 735 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 717 .addComponent( jButton2))736 .addComponent(btnGenerateNoise)) 718 737 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, addNoiseFrameLayout.createSequentialGroup() 719 738 .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 720 739 .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)) 726 745 .addGap(4, 4, 4) 727 746 .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) 733 752 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addNoiseFrameLayout.createSequentialGroup() 734 .addComponent( jLabel20)753 .addComponent(labelLeastFreq) 735 754 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 736 .addComponent( jLabel21))))))755 .addComponent(labelMostFreq)))))) 737 756 .addGap(20, 20, 20)) 738 757 ); … … 741 760 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addNoiseFrameLayout.createSequentialGroup() 742 761 .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) 744 763 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 745 764 .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 746 .addComponent( jLabel21)747 .addComponent( jLabel20))765 .addComponent(labelMostFreq) 766 .addComponent(labelLeastFreq)) 748 767 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 749 768 .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)) 752 771 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 753 772 .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)) 756 775 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 757 776 .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)) 760 779 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 761 780 .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)) 764 783 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 765 784 .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)) 768 787 .addGap(18, 18, 18) 769 788 .addGroup(addNoiseFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 770 .addComponent( jButton1)771 .addComponent( jButton2))789 .addComponent(btnCancelNoise) 790 .addComponent(btnGenerateNoise)) 772 791 .addContainerGap()) 773 792 ); … … 1436 1455 */ 1437 1456 private void zoomSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_zoomSliderStateChanged 1457 //Changing the zoom level always refreshes the window 1438 1458 ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK = zoomSlider.getValue(); 1439 1459 this.update(script, script); … … 1519 1539 (Integer) addIncidentNumber.getValue(), addIncidentName.getText(), addIncidentDescription.getText(), 1520 1540 script)); 1521 // script.incidents.get(indx).length = (Integer) addIncidentLength.getValue() * 60;1522 1541 script.incidents.get(indx).setOffset((Integer) addIncidentStart.getValue() * 60); 1523 1542 script.numberOfIncidents++; … … 1526 1545 else//editing existing incident 1527 1546 { 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 this1547 // 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 1558 1547 //adjust incident color 1559 1548 script.incidents.get(oldIncidentIndex).color = selectedColor; … … 1570 1559 script.incidents.get(oldIncidentIndex).number = (int) addIncidentNumber.getValue(); 1571 1560 } 1572 else 1561 else//if the updated value conflicts with an existing inc number, 1562 //the inc number update fails 1573 1563 { 1574 1564 JOptionPane.showMessageDialog(this, "Incident number already in use.", … … 1577 1567 } 1578 1568 1569 //close this frame 1579 1570 incidentFrame.setVisible(false); 1580 1571 this.update(script, script); … … 1582 1573 }//GEN-LAST:event_incidentOkButtonActionPerformed 1583 1574 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 */ 1584 1583 private boolean scriptContainsLogNum(SimulationScript script, int num) 1585 1584 { … … 1615 1614 addIncidentNumber.setValue(101); 1616 1615 addIncidentStart.setValue(0); 1617 labelIncidentLength.setText("0");1616 txtIncidentLength.setText("0"); 1618 1617 incidentColorField.setBackground(Color.BLACK); 1619 1618 selectedColor = Color.BLACK; … … 1635 1634 JFileChooser fc = new JFileChooser(); 1636 1635 1636 //Search for .xml files 1637 1637 fc.setFileFilter(new ExtensionFileFilter("Simulation Script XML (.xml)", 1638 1638 new String[] … … 1642 1642 if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) 1643 1643 { 1644 //make a new script and load it with values from the selected file 1644 1645 script = new SimulationScript(); 1645 System.out.println(fc.getSelectedFile().getName());1646 1646 script.loadScriptFromFile(fc.getSelectedFile()); 1647 1647 script.saveFile = fc.getSelectedFile(); 1648 1648 } 1649 1649 this.update(script, script); 1650 //zoom out all the way so that the whole imported script is visible 1650 1651 zoomSlider.setValue(zoomSlider.getMinimum()); 1651 1652 repaint(); … … 1681 1682 */ 1682 1683 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 1683 1686 if (script.saveFile == null) 1684 1687 { 1685 1688 fileSaveAsActionPerformed(evt); 1686 1689 } 1690 //Otherwise, just save to the previously selected save spot 1687 1691 else 1688 1692 { … … 1691 1695 }//GEN-LAST:event_fileSaveActionPerformed 1692 1696 1697 /** 1698 * Allow this window to refresh itself, after a different window loses 1699 * focus. 1700 */ 1693 1701 public void returnFocus() 1694 1702 { … … 1697 1705 } 1698 1706 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 */ 1699 1713 public void incidentDetailsScreen(ScriptIncident i) 1700 1714 { … … 1705 1719 addIncidentNumber.setValue(i.number); 1706 1720 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); 1709 1723 //addIncidentLength.setValue(i.length / 60); 1710 1724 incidentColorField.setBackground(i.color); … … 1730 1744 * @param evt the button press event 1731 1745 */ 1732 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed1746 private void btnCancelNoiseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelNoiseActionPerformed 1733 1747 addNoiseFrame.setVisible(false); 1734 }//GEN-LAST:event_ jButton1ActionPerformed1735 1736 /** 1737 * Generates random noise upon click of the " OK" button, then hides the1738 * 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. 1739 1753 * 1740 1754 * @param evt the button press event 1741 1755 */ 1742 private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed1756 private void btnGenerateNoiseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGenerateNoiseActionPerformed 1743 1757 Random rng = new Random(); 1744 1758 ScriptEventType[] eventTypes = ScriptEventType.values(); 1745 1759 1746 1760 /* 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(); 1748 1762 total /= 5; 1749 1763 … … 1778 1792 this.update(script, script); 1779 1793 repaint(); 1780 }//GEN-LAST:event_ jButton2ActionPerformed1794 }//GEN-LAST:event_btnGenerateNoiseActionPerformed 1781 1795 1782 1796 /** … … 1790 1804 String input = ""; 1791 1805 ScriptIncident inc = null; 1806 1807 //Pick the incident to save 1792 1808 Object result = JOptionPane.showInputDialog( 1793 1809 this, … … 1798 1814 incidentList, 1799 1815 script.incidents.get(0)); 1800 1801 System.out.println("RESULT = " + result.toString());1802 1803 1816 input = result.toString(); 1804 1805 System.out.println("INPUT = " + input);1806 1807 1817 int i = 0; 1808 1818 for (ScriptIncident incident : script.incidents) … … 1812 1822 continue; 1813 1823 } 1814 System.out.println((++i) + ": " + incident.toString());1815 1824 if (incident.toString().equals(input)) 1816 1825 { … … 1821 1830 if (inc == null) 1822 1831 { 1823 System.out.println("DIDN'T FIND ANYTHING");1824 1832 return; 1825 1833 } 1826 1834 1835 //Pick the file to save it to 1827 1836 JFileChooser fc = new JFileChooser(); 1828 1837 fc.setFileFilter(new ExtensionFileFilter("Script Incident (.xml)", new String[] … … 1836 1845 }//GEN-LAST:event_saveIncidentActionPerformed 1837 1846 1847 /** 1848 * Bring up the incident palette for loading of new incidents. 1849 * 1850 * @param evt the menu click event 1851 */ 1838 1852 private void loadIncidentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadIncidentActionPerformed 1839 1853 new IncidentPaletteFrame(script, this).setVisible(true); … … 1841 1855 }//GEN-LAST:event_loadIncidentActionPerformed 1842 1856 1857 //Unsupported as of 2017/09/05 1843 1858 private void generateProjectRequirementsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateProjectRequirementsActionPerformed 1844 1859 JFileChooser fc = new JFileChooser(); … … 1851 1866 }//GEN-LAST:event_generateProjectRequirementsActionPerformed 1852 1867 1868 //Unsupported as of 2017/09/05 1853 1869 private void generateNotebooksActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateNotebooksActionPerformed 1854 1870 JFileChooser fc = new JFileChooser(); … … 1861 1877 }//GEN-LAST:event_generateNotebooksActionPerformed 1862 1878 1879 //Unsupported as of 2017/09/05 1863 1880 private void generateScorecardsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateScorecardsActionPerformed 1864 1881 JFileChooser fc = new JFileChooser(); … … 1871 1888 }//GEN-LAST:event_generateScorecardsActionPerformed 1872 1889 1890 //Unsupported as of 2017/09/05 1873 1891 private void generateOrganizationChartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateOrganizationChartActionPerformed 1874 1892 JFileChooser fc = new JFileChooser(); … … 1906 1924 private Color selectedColor = Color.BLACK; 1907 1925 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 1909 1928 Color newColor = incidentColorChooser.showDialog(this, "Incident Color", incidentColorField.getBackground()); 1910 1929 if (newColor != null) 1911 1930 { 1912 System.out.println("New color is " + newColor.toString());1931 //If the user selected a color, apply it to the properties frame 1913 1932 selectedColor = newColor; 1914 1933 incidentColorField.setBackground(newColor); 1915 1934 } 1935 //Return focus to the properties frame 1916 1936 incidentFrame.setVisible(true); 1917 }//GEN-LAST:event_ jButton3ActionPerformed1937 }//GEN-LAST:event_btnChooseColorActionPerformed 1918 1938 1919 1939 /* Help > About simply displays the current SVN revision number so … … 1926 1946 }//GEN-LAST:event_helpAboutActionPerformed 1927 1947 1948 /** 1949 * Replaces the current script with a new, blank script. 1950 * 1951 * @param evt the menu selection event 1952 */ 1928 1953 private void fileNewActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_fileNewActionPerformed 1929 1954 {//GEN-HEADEREND:event_fileNewActionPerformed … … 1934 1959 }//GEN-LAST:event_fileNewActionPerformed 1935 1960 1961 /** 1962 * Allows the user to delete an incident from the current script. 1963 * 1964 * @param evt the menu selection event 1965 */ 1936 1966 private void deleteIncidentActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_deleteIncidentActionPerformed 1937 1967 {//GEN-HEADEREND:event_deleteIncidentActionPerformed … … 1939 1969 String input = ""; 1940 1970 ScriptIncident inc = null; 1971 //Choose the incident to be deleted 1941 1972 Object result = JOptionPane.showInputDialog( 1942 1973 this, … … 1951 1982 { 1952 1983 input = result.toString(); 1953 int incidentIndex = 0;1954 1984 for (ScriptIncident incident : script.incidents) 1955 1985 { 1956 incidentIndex++;1957 1986 if (incident == null) 1958 1987 { … … 1965 1994 } 1966 1995 1996 //Allow user to verify deletion before proceeding 1967 1997 if (inc != null) 1968 1998 { … … 1971 2001 if (confirm == JOptionPane.YES_OPTION) 1972 2002 { 2003 //Remove the incident and replace it with a null placeholder 1973 2004 script.incidents.remove(inc); 1974 2005 script.incidents.add(null); … … 1977 2008 } 1978 2009 } 2010 //Refresh 1979 2011 this.update(script, script); 1980 2012 repaint(); 1981 2013 }//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 */ 1983 2019 private void btnAddTimeActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnAddTimeActionPerformed 1984 2020 {//GEN-HEADEREND:event_btnAddTimeActionPerformed … … 1986 2022 this.update(script, script); 1987 2023 }//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 1988 2029 1989 2030 /** … … 2022 2063 2023 2064 /** 2024 * Runs the script builder. 2065 * Runs the script builder. This is the main method for the whole program. 2025 2066 * 2026 2067 * @param args the command line arguments … … 2032 2073 UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); 2033 2074 } 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 2045 2078 } 2046 2079 … … 2049 2082 UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); 2050 2083 } 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 2062 2087 } 2063 2088 … … 2072 2097 } 2073 2098 // Variables declaration - do not modify//GEN-BEGIN:variables 2099 private javax.swing.JSlider TMCALSlider; 2074 2100 private javax.swing.JTextArea addIncidentDescription; 2075 2101 private javax.swing.JTextField addIncidentName; … … 2077 2103 private javax.swing.JSpinner addIncidentStart; 2078 2104 private javax.swing.JFrame addNoiseFrame; 2105 private javax.swing.JSlider backgroundNoiseSlider; 2079 2106 private javax.swing.JButton btnAddTime; 2107 private javax.swing.JButton btnCancelNoise; 2108 private javax.swing.JButton btnChooseColor; 2109 private javax.swing.JButton btnGenerateNoise; 2080 2110 private javax.swing.JMenuItem cadEvent; 2081 2111 private javax.swing.JFrame cadEventFrame; … … 2118 2148 private javax.swing.JButton incidentOkButton; 2119 2149 private javax.swing.JPopupMenu incidentPopupMenu; 2150 private javax.swing.JScrollPane incidentPropertiesScrollPane; 2120 2151 private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel1; 2121 2152 private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel10; … … 2128 2159 private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel8; 2129 2160 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;2148 2161 private javax.swing.JMenuItem jMenuItem2; 2149 2162 private javax.swing.JMenuItem jMenuItem3; … … 2151 2164 private javax.swing.JMenuItem jMenuItem5; 2152 2165 private javax.swing.JMenuItem jMenuItem6; 2153 private javax.swing.JScrollPane jScrollPane1;2154 2166 private javax.swing.JPopupMenu.Separator jSeparator1; 2155 2167 private javax.swing.JPopupMenu.Separator jSeparator2; 2156 2168 private javax.swing.JPopupMenu.Separator jSeparator3; 2157 2169 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; 2164 2174 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; 2165 2187 private javax.swing.JMenuItem loadIncident; 2188 private javax.swing.JSlider minorEventsSlider; 2166 2189 private javax.swing.JMenuItem newIncident; 2167 2190 private javax.swing.JButton okButton; 2168 2191 private javax.swing.JMenuItem popupDeleteIncident; 2192 private javax.swing.JSlider radioChatterSlider; 2169 2193 private javax.swing.JMenuItem radioEvent; 2170 2194 private javax.swing.JFrame radioEventFrame; … … 2172 2196 private javax.swing.JScrollPane radioMessageScrollPane; 2173 2197 private javax.swing.JComboBox radioTypeComboBox; 2174 private javax.swing.JLabel radioTypeLabel;2175 2198 private javax.swing.JMenuItem saveIncident; 2176 2199 private javax.swing.JMenuBar scriptBuilderMenuBar; … … 2179 2202 private scriptbuilder.gui.panels.TimelineTickPanel timelineTickPanel; 2180 2203 private javax.swing.JScrollPane timelinesScrollPane; 2204 private javax.swing.JLabel txtIncidentLength; 2205 private javax.swing.JTextArea txtNoiseDescription; 2181 2206 private javax.swing.JLabel zoomInIcon; 2182 2207 private javax.swing.JLabel zoomOutIcon;
Note: See TracChangeset
for help on using the changeset viewer.
