Changeset 98 in tmcsimulator-scriptbuilder
- Timestamp:
- 08/29/2017 10:40:27 AM (9 years ago)
- Location:
- trunk/src/scriptbuilder/gui
- Files:
-
- 7 edited
-
IncidentEditorFrame.form (modified) (5 diffs)
-
IncidentEditorFrame.java (modified) (10 diffs)
-
ScriptBuilderFrame.form (modified) (4 diffs)
-
ScriptBuilderFrame.java (modified) (8 diffs)
-
panels/IncidentTimelinePanel.java (modified) (3 diffs)
-
panels/TimeStampPanel.java (modified) (3 diffs)
-
panels/TimelineTickPanel.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/gui/IncidentEditorFrame.form
r89 r98 447 447 <EmptySpace max="-2" attributes="0"/> 448 448 <Group type="103" groupAlignment="0" attributes="0"> 449 <Component id="timelinesScrollPane" alignment="0" min="0" pref="0" max="32767" attributes="1"/>450 <Component id="timeStampScrollPane" alignment="0" max="32767" attributes="0"/>451 <Group type="102" alignment="1" attributes="0">452 <Component id="scriptEventsPanel1" max="32767" attributes="0"/>453 <EmptySpace max="-2" attributes="0"/>454 <Component id="scriptEventsPanel" max="32767" attributes="0"/>455 </Group>456 449 <Group type="102" alignment="0" attributes="0"> 457 450 <Component id="selectButton" min="-2" pref="40" max="-2" attributes="0"/> … … 462 455 <EmptySpace type="separate" max="-2" attributes="0"/> 463 456 <Group type="103" groupAlignment="0" attributes="0"> 464 <Component id="zoomInIcon" alignment="0" min="-2" max="-2" attributes="0"/> 465 <Component id="zoomSlider" alignment="0" min="-2" pref="31" max="-2" attributes="0"/> 466 <Component id="zoomOutIcon" alignment="0" min="-2" max="-2" attributes="0"/> 467 </Group> 457 <Group type="102" alignment="0" attributes="0"> 458 <Group type="103" groupAlignment="0" attributes="0"> 459 <Component id="zoomInIcon" alignment="0" min="-2" max="-2" attributes="0"/> 460 <Component id="zoomOutIcon" alignment="0" min="-2" max="-2" attributes="0"/> 461 </Group> 462 <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 463 </Group> 464 <Group type="102" alignment="0" attributes="0"> 465 <Component id="zoomSlider" min="-2" pref="31" max="-2" attributes="0"/> 466 <EmptySpace max="-2" attributes="0"/> 467 <Component id="btnAddTime" max="32767" attributes="0"/> 468 </Group> 469 </Group> 470 </Group> 471 <Component id="timelinesScrollPane" alignment="0" min="0" pref="0" max="32767" attributes="1"/> 472 <Component id="timeStampScrollPane" alignment="0" max="32767" attributes="0"/> 473 <Group type="102" alignment="1" attributes="0"> 474 <Component id="scriptEventsPanel1" max="32767" attributes="0"/> 475 <EmptySpace max="-2" attributes="0"/> 476 <Component id="scriptEventsPanel" max="32767" attributes="0"/> 468 477 </Group> 469 478 </Group> … … 490 499 <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> 491 500 <Component id="zoomInIcon" min="-2" max="-2" attributes="0"/> 492 <EmptySpace min="-2" pref="1" max="-2" attributes="0"/> 493 <Component id="zoomSlider" min="-2" pref="69" max="-2" attributes="1"/> 501 <Group type="103" groupAlignment="0" attributes="0"> 502 <Group type="102" attributes="0"> 503 <EmptySpace min="-2" pref="1" max="-2" attributes="0"/> 504 <Component id="zoomSlider" min="-2" pref="69" max="-2" attributes="1"/> 505 </Group> 506 <Group type="102" alignment="0" attributes="0"> 507 <EmptySpace min="-2" pref="17" max="-2" attributes="0"/> 508 <Component id="btnAddTime" min="-2" pref="44" max="-2" attributes="0"/> 509 </Group> 510 </Group> 494 511 <EmptySpace max="-2" attributes="0"/> 495 512 <Component id="zoomOutIcon" min="-2" max="-2" attributes="0"/> … … 1271 1288 <DimensionLayout dim="0"> 1272 1289 <Group type="103" groupAlignment="0" attributes="0"> 1273 <EmptySpace min="0" pref="103 2" max="32767" attributes="0"/>1290 <EmptySpace min="0" pref="1036" max="32767" attributes="0"/> 1274 1291 </Group> 1275 1292 </DimensionLayout> … … 1283 1300 </SubComponents> 1284 1301 </Container> 1302 <Component class="javax.swing.JButton" name="btnAddTime"> 1303 <Properties> 1304 <Property name="text" type="java.lang.String" value="+15:00"/> 1305 </Properties> 1306 <Events> 1307 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddTimeActionPerformed"/> 1308 </Events> 1309 </Component> 1285 1310 </SubComponents> 1286 1311 </Form> -
trunk/src/scriptbuilder/gui/IncidentEditorFrame.java
r89 r98 22 22 import javax.swing.DefaultListModel; 23 23 import javax.swing.JButton; 24 import scriptbuilder.gui.panels.IncidentTimelinePanel; 24 25 import scriptbuilder.structures.ScriptEvent; 25 26 import scriptbuilder.structures.ScriptEvent.ScriptEventType; … … 310 311 theIncident = (ScriptIncident) arg; 311 312 312 timelineTickPanel.update(theIncident );313 timeStampPanel.update(theIncident );313 timelineTickPanel.update(theIncident, incidentTimelinePanel1); 314 timeStampPanel.update(theIncident, incidentTimelinePanel1); 314 315 315 316 incidentTimelinePanel1.timelinePanelUpdate(theIncident); … … 438 439 timeStampScrollPane = new javax.swing.JScrollPane(); 439 440 timeStampPanel = new scriptbuilder.gui.panels.TimeStampPanel(); 441 btnAddTime = new javax.swing.JButton(); 440 442 441 443 cadEvent.setText("CAD Event"); … … 1245 1247 timeStampPanelLayout.setHorizontalGroup( 1246 1248 timeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1247 .addGap(0, 103 2, Short.MAX_VALUE)1249 .addGap(0, 1036, Short.MAX_VALUE) 1248 1250 ); 1249 1251 timeStampPanelLayout.setVerticalGroup( … … 1253 1255 1254 1256 timeStampScrollPane.setViewportView(timeStampPanel); 1257 1258 btnAddTime.setText("+15:00"); 1259 btnAddTime.addActionListener(new java.awt.event.ActionListener() 1260 { 1261 public void actionPerformed(java.awt.event.ActionEvent evt) 1262 { 1263 btnAddTimeActionPerformed(evt); 1264 } 1265 }); 1255 1266 1256 1267 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); … … 1261 1272 .addContainerGap() 1262 1273 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1263 .addComponent(timelinesScrollPane, 0, 0, Short.MAX_VALUE)1264 .addComponent(timeStampScrollPane)1265 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()1266 .addComponent(scriptEventsPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)1267 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)1268 .addComponent(scriptEventsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))1269 1274 .addGroup(layout.createSequentialGroup() 1270 1275 .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) … … 1275 1280 .addGap(18, 18, 18) 1276 1281 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1277 .addComponent(zoomInIcon) 1278 .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) 1279 .addComponent(zoomOutIcon)))) 1282 .addGroup(layout.createSequentialGroup() 1283 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1284 .addComponent(zoomInIcon) 1285 .addComponent(zoomOutIcon)) 1286 .addGap(0, 0, Short.MAX_VALUE)) 1287 .addGroup(layout.createSequentialGroup() 1288 .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) 1289 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1290 .addComponent(btnAddTime, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) 1291 .addComponent(timelinesScrollPane, 0, 0, Short.MAX_VALUE) 1292 .addComponent(timeStampScrollPane) 1293 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 1294 .addComponent(scriptEventsPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 1295 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1296 .addComponent(scriptEventsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) 1280 1297 .addContainerGap()) 1281 1298 ); … … 1295 1312 .addGap(20, 20, 20) 1296 1313 .addComponent(zoomInIcon) 1297 .addGap(1, 1, 1) 1298 .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE) 1314 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1315 .addGroup(layout.createSequentialGroup() 1316 .addGap(1, 1, 1) 1317 .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)) 1318 .addGroup(layout.createSequentialGroup() 1319 .addGap(17, 17, 17) 1320 .addComponent(btnAddTime, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))) 1299 1321 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1300 1322 .addComponent(zoomOutIcon))) … … 1691 1713 zoomSlider.setValue(zoomSlider.getValue() <= 5 ? 5 : zoomSlider.getValue() - 1); 1692 1714 }//GEN-LAST:event_zoomOutIconMouseClicked 1715 1716 private void btnAddTimeActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnAddTimeActionPerformed 1717 {//GEN-HEADEREND:event_btnAddTimeActionPerformed 1718 incidentTimelinePanel1.requestedEditorFillerTime += IncidentTimelinePanel.FILLER_INTERVAL_SECONDS; 1719 this.update(null, theIncident); 1720 }//GEN-LAST:event_btnAddTimeActionPerformed 1693 1721 1694 1722 /** … … 1781 1809 private javax.swing.JButton atmsEvalButton; 1782 1810 private javax.swing.JButton audioButton; 1811 private javax.swing.JButton btnAddTime; 1783 1812 private javax.swing.JButton cadButton; 1784 1813 private javax.swing.JButton cadEvalButton; -
trunk/src/scriptbuilder/gui/ScriptBuilderFrame.form
r89 r98 905 905 <Component id="timeStampScrollPane" alignment="0" max="32767" attributes="0"/> 906 906 <Group type="102" alignment="1" attributes="0"> 907 <EmptySpace min="0" pref=" 597" max="32767" attributes="0"/>907 <EmptySpace min="0" pref="604" max="32767" attributes="0"/> 908 908 <Component id="zoomOutIcon" min="-2" max="-2" attributes="0"/> 909 909 <EmptySpace max="-2" attributes="0"/> … … 911 911 <EmptySpace max="-2" attributes="0"/> 912 912 <Component id="zoomInIcon" min="-2" max="-2" attributes="0"/> 913 <EmptySpace min="-2" pref="136" max="-2" attributes="0"/> 913 <EmptySpace type="separate" max="-2" attributes="0"/> 914 <Component id="btnAddTime" min="-2" max="-2" attributes="0"/> 915 <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> 914 916 </Group> 915 917 </Group> … … 926 928 <Component id="zoomSlider" min="-2" max="-2" attributes="1"/> 927 929 <Component id="zoomInIcon" min="-2" max="-2" attributes="0"/> 930 <Component id="btnAddTime" min="-2" max="-2" attributes="0"/> 928 931 </Group> 929 932 <EmptySpace min="-2" max="-2" attributes="0"/> … … 1504 1507 </SubComponents> 1505 1508 </Container> 1509 <Component class="javax.swing.JButton" name="btnAddTime"> 1510 <Properties> 1511 <Property name="text" type="java.lang.String" value="+15:00"/> 1512 </Properties> 1513 <Events> 1514 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddTimeActionPerformed"/> 1515 </Events> 1516 </Component> 1506 1517 </SubComponents> 1507 1518 </Form> -
trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java
r95 r98 25 25 import javax.swing.UIManager; 26 26 import javax.swing.UnsupportedLookAndFeelException; 27 import scriptbuilder.gui.panels.IncidentTimelinePanel; 27 28 import scriptbuilder.structures.ScriptEvent; 28 29 import scriptbuilder.structures.ScriptEvent.ScriptEventType; … … 333 334 timeStampScrollPane = new javax.swing.JScrollPane(); 334 335 timeStampPanel = new scriptbuilder.gui.panels.TimeStampPanel(); 336 btnAddTime = new javax.swing.JButton(); 335 337 scriptBuilderMenuBar = new javax.swing.JMenuBar(); 336 338 fileMenu = new javax.swing.JMenu(); … … 1177 1179 timeStampScrollPane.setViewportView(timeStampPanel); 1178 1180 1181 btnAddTime.setText("+15:00"); 1182 btnAddTime.addActionListener(new java.awt.event.ActionListener() 1183 { 1184 public void actionPerformed(java.awt.event.ActionEvent evt) 1185 { 1186 btnAddTimeActionPerformed(evt); 1187 } 1188 }); 1189 1179 1190 fileMenu.setText("File"); 1180 1191 fileMenu.setMargin(new java.awt.Insets(0, 10, 0, 10)); … … 1400 1411 .addComponent(timeStampScrollPane) 1401 1412 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 1402 .addGap(0, 597, Short.MAX_VALUE)1413 .addGap(0, 604, Short.MAX_VALUE) 1403 1414 .addComponent(zoomOutIcon) 1404 1415 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) … … 1406 1417 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1407 1418 .addComponent(zoomInIcon) 1408 .addGap(136, 136, 136))) 1419 .addGap(18, 18, 18) 1420 .addComponent(btnAddTime) 1421 .addGap(21, 21, 21))) 1409 1422 .addContainerGap()) 1410 1423 ); … … 1416 1429 .addComponent(zoomOutIcon) 1417 1430 .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 1418 .addComponent(zoomInIcon)) 1431 .addComponent(zoomInIcon) 1432 .addComponent(btnAddTime)) 1419 1433 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1420 1434 .addComponent(timeStampScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) … … 2025 2039 }//GEN-LAST:event_deleteIncidentActionPerformed 2026 2040 2041 private void btnAddTimeActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnAddTimeActionPerformed 2042 {//GEN-HEADEREND:event_btnAddTimeActionPerformed 2043 IncidentTimelinePanel.requestedScriptBuilderFillerTime += IncidentTimelinePanel.FILLER_INTERVAL_SECONDS; 2044 this.update(script, script); 2045 }//GEN-LAST:event_btnAddTimeActionPerformed 2046 2027 2047 /** 2028 2048 * Read the version number from the application properties. The file … … 2116 2136 private javax.swing.JSpinner addIncidentStart; 2117 2137 private javax.swing.JFrame addNoiseFrame; 2138 private javax.swing.JButton btnAddTime; 2118 2139 private javax.swing.JMenuItem cadEvent; 2119 2140 private javax.swing.JFrame cadEventFrame; -
trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java
r96 r98 62 62 63 63 /** 64 * Filler time at the end of the screen for a particular incident 65 */ 66 public int requestedEditorFillerTime; 67 68 /** 69 * Filler time at the end of the screen for the whole script 70 */ 71 public static int requestedScriptBuilderFillerTime = 0; 72 73 /** 74 * Constant for amount of filler to add, in seconds. Set to 15 minutes 75 */ 76 public static final int FILLER_INTERVAL_SECONDS = 900; 77 78 /** 64 79 * The map representing the properties of this incident's events. Keys: 65 80 * event types. Values: Properties objects for those events. … … 310 325 super(); 311 326 327 requestedEditorFillerTime = 0; 312 328 // FACILITATOR_EVAL_EVENT, RADIO_EVAL_EVENT 313 329 eventTypeToPropertyMap = new HashMap(); … … 352 368 { 353 369 354 newSize = new Dimension(((incident.length + incident.offset) 355 / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 356 * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK) 357 + ScriptBuilderGuiConstants.EVENT_ICON_WIDTH, 358 ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT 359 + ScriptBuilderGuiConstants.SCRIPT_EVENT_ICON_STEP * 2); 370 if (getTopLevelAncestor() instanceof IncidentEditorFrame) 371 { 372 373 newSize = new Dimension(((incident.length + incident.offset + requestedEditorFillerTime) 374 / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 375 * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK) 376 + ScriptBuilderGuiConstants.EVENT_ICON_WIDTH, 377 ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT 378 + ScriptBuilderGuiConstants.SCRIPT_EVENT_ICON_STEP * 2); 379 } 380 else 381 { 382 newSize = new Dimension(((incident.length + incident.offset + requestedScriptBuilderFillerTime) 383 / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 384 * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK) 385 + ScriptBuilderGuiConstants.EVENT_ICON_WIDTH, 386 ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT 387 + ScriptBuilderGuiConstants.SCRIPT_EVENT_ICON_STEP * 2); 388 } 360 389 361 390 } -
trunk/src/scriptbuilder/gui/panels/TimeStampPanel.java
r76 r98 61 61 if ((incident.length + incident.offset) > longestLength) 62 62 { 63 longestLength = incident.length + incident.offset ;63 longestLength = incident.length + incident.offset + IncidentTimelinePanel.requestedScriptBuilderFillerTime; 64 64 } 65 65 } … … 92 92 * @param incident the incident which this window is editing. 93 93 */ 94 public void update(ScriptIncident incident )94 public void update(ScriptIncident incident, IncidentTimelinePanel timeline) 95 95 { 96 96 longestLength = ScriptBuilderGuiConstants.TICK_TIMELINE_SMALLEST_LENGTH; … … 105 105 if ((incident.length + incident.offset) > longestLength) 106 106 { 107 longestLength = incident.length + incident.offset ;107 longestLength = incident.length + incident.offset + timeline.requestedEditorFillerTime; 108 108 } 109 109 } -
trunk/src/scriptbuilder/gui/panels/TimelineTickPanel.java
r76 r98 118 118 if ((incident.length + incident.offset) > longestLength) 119 119 { 120 longestLength = incident.length + incident.offset ;120 longestLength = incident.length + incident.offset + IncidentTimelinePanel.requestedScriptBuilderFillerTime; 121 121 } 122 122 } … … 141 141 * @param incident the incident being edited 142 142 */ 143 public void update(ScriptIncident incident )143 public void update(ScriptIncident incident, IncidentTimelinePanel timeline) 144 144 { 145 145 longestLength = ScriptBuilderGuiConstants.TICK_TIMELINE_SMALLEST_LENGTH; … … 155 155 if ((incident.length + incident.offset) > longestLength) 156 156 { 157 longestLength = incident.length + incident.offset ;157 longestLength = incident.length + incident.offset + timeline.requestedEditorFillerTime; 158 158 } 159 159
Note: See TracChangeset
for help on using the changeset viewer.
