- Timestamp:
- 09/07/2017 02:08:40 PM (9 years ago)
- Location:
- trunk/src/scriptbuilder
- Files:
-
- 6 edited
-
gui/IncidentEditorFrame.form (modified) (7 diffs)
-
gui/IncidentEditorFrame.java (modified) (15 diffs)
-
gui/ScriptBuilderFrame.java (modified) (1 diff)
-
gui/panels/IncidentTimelinePanel.java (modified) (1 diff)
-
gui/panels/TimeStampPanel.java (modified) (4 diffs)
-
structures/ScriptIncident.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/gui/IncidentEditorFrame.form
r113 r117 456 456 <Group type="103" groupAlignment="0" attributes="0"> 457 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 458 <Component id="zoomSlider" min="-2" pref="31" max="-2" attributes="0"/> 466 459 <EmptySpace max="-2" attributes="0"/> 467 460 <Component id="btnAddTime" max="32767" attributes="0"/> 461 </Group> 462 <Group type="102" attributes="0"> 463 <Group type="103" groupAlignment="0" attributes="0"> 464 <Component id="zoomInIcon" min="-2" max="-2" attributes="0"/> 465 <Component id="zoomOutIcon" min="-2" max="-2" attributes="0"/> 466 </Group> 467 <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 468 468 </Group> 469 469 </Group> … … 476 476 <Component id="scriptEventsPanel" max="32767" attributes="0"/> 477 477 </Group> 478 <Component id="timeStampScrollPane1" alignment="0" max="32767" attributes="0"/> 478 479 </Group> 479 480 <EmptySpace max="-2" attributes="0"/> … … 484 485 <Group type="103" groupAlignment="0" attributes="0"> 485 486 <Group type="102" alignment="1" attributes="0"> 486 <Group type="103" groupAlignment="0" attributes="0">487 <Group type="103" groupAlignment="0" max="-2" attributes="0"> 487 488 <Group type="102" attributes="0"> 488 489 <EmptySpace max="-2" attributes="0"/> … … 496 497 </Group> 497 498 </Group> 498 <Group type="102" alignment="0" attributes="0"> 499 <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> 500 <Component id="zoomInIcon" min="-2" max="-2" attributes="0"/> 501 <Group type="103" groupAlignment="0" attributes="0"> 499 <Group type="102" attributes="0"> 500 <Group type="103" groupAlignment="0" max="-2" attributes="0"> 502 501 <Group type="102" attributes="0"> 503 <EmptySpace min="-2" pref="1" max="-2" attributes="0"/> 502 <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> 503 <Component id="zoomInIcon" min="-2" max="-2" attributes="0"/> 504 <EmptySpace max="32767" attributes="0"/> 504 505 <Component id="zoomSlider" min="-2" pref="69" max="-2" attributes="1"/> 505 506 </Group> 506 <Group type="102" a lignment="0" attributes="0">507 <EmptySpace min="-2" pref=" 17" max="-2" attributes="0"/>507 <Group type="102" attributes="0"> 508 <EmptySpace min="-2" pref="61" max="-2" attributes="0"/> 508 509 <Component id="btnAddTime" min="-2" pref="44" max="-2" attributes="0"/> 509 510 </Group> 510 511 </Group> 511 <EmptySpace max=" -2" attributes="0"/>512 <EmptySpace max="32767" attributes="0"/> 512 513 <Component id="zoomOutIcon" min="-2" max="-2" attributes="0"/> 513 514 </Group> … … 516 517 <Component id="timeStampScrollPane" min="-2" pref="20" max="-2" attributes="0"/> 517 518 <EmptySpace max="-2" attributes="0"/> 519 <Component id="timeStampScrollPane1" min="-2" pref="20" max="-2" attributes="0"/> 520 <EmptySpace min="-2" max="-2" attributes="0"/> 518 521 <Component id="timelinesScrollPane" min="-2" pref="324" max="-2" attributes="0"/> 519 522 <EmptySpace max="-2" attributes="0"/> … … 1286 1289 <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 1287 1290 <SubComponents> 1288 <Container class="scriptbuilder.gui.panels.TimeStampPanel" name=" timeStampPanel">1291 <Container class="scriptbuilder.gui.panels.TimeStampPanel" name="absoluteTimeStampPanel"> 1289 1292 1290 1293 <Layout> … … 1311 1314 </Events> 1312 1315 </Component> 1316 <Container class="javax.swing.JScrollPane" name="timeStampScrollPane1"> 1317 <Properties> 1318 <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> 1319 <Border info="null"/> 1320 </Property> 1321 <Property name="horizontalScrollBarPolicy" type="int" value="31"/> 1322 <Property name="verticalScrollBarPolicy" type="int" value="21"/> 1323 </Properties> 1324 1325 <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 1326 <SubComponents> 1327 <Container class="scriptbuilder.gui.panels.TimeStampPanel" name="relativeTimeStampPanel"> 1328 1329 <Layout> 1330 <DimensionLayout dim="0"> 1331 <Group type="103" groupAlignment="0" attributes="0"> 1332 <EmptySpace min="0" pref="1036" max="32767" attributes="0"/> 1333 </Group> 1334 </DimensionLayout> 1335 <DimensionLayout dim="1"> 1336 <Group type="103" groupAlignment="0" attributes="0"> 1337 <EmptySpace min="0" pref="100" max="32767" attributes="0"/> 1338 </Group> 1339 </DimensionLayout> 1340 </Layout> 1341 </Container> 1342 </SubComponents> 1343 </Container> 1313 1344 </SubComponents> 1314 1345 </Form> -
trunk/src/scriptbuilder/gui/IncidentEditorFrame.java
r113 r117 89 89 { 90 90 timeStampScrollPane.getHorizontalScrollBar() 91 .setValue(timelinesScrollPane.getHorizontalScrollBar().getValue()); 92 timeStampScrollPane1.getHorizontalScrollBar() 91 93 .setValue(timelinesScrollPane.getHorizontalScrollBar().getValue()); 92 94 } … … 249 251 initComponents(); 250 252 253 absoluteTimeStampPanel.setOffset(savedOffset); 254 absoluteTimeStampPanel.setAbsolute(true); 251 255 timelineTickPanel.update(theIncident, incidentTimelinePanel1); 252 timeStampPanel.update(theIncident, incidentTimelinePanel1);253 256 absoluteTimeStampPanel.update(theIncident, incidentTimelinePanel1); 257 relativeTimeStampPanel.update(theIncident, incidentTimelinePanel1); 254 258 incidentTimelinePanel1.timelinePanelUpdate(theIncident); 255 259 … … 344 348 //Update the appropriate panels 345 349 timelineTickPanel.update(theIncident, incidentTimelinePanel1); 346 timeStampPanel.update(theIncident, incidentTimelinePanel1); 350 absoluteTimeStampPanel.update(theIncident, incidentTimelinePanel1); 351 relativeTimeStampPanel.update(theIncident, incidentTimelinePanel1); 347 352 348 353 incidentTimelinePanel1.timelinePanelUpdate(theIncident); … … 384 389 //gotoIncident.setSelectedItem(i); 385 390 } 386 391 387 392 //Regardless of update type, do these things to refresh the window 388 389 393 //Resize the zoom slider scale so that the most zoomed-out state displays 390 394 //the entire incident on the window … … 480 484 zoomOutIcon = new javax.swing.JLabel(); 481 485 timeStampScrollPane = new javax.swing.JScrollPane(); 482 timeStampPanel = new scriptbuilder.gui.panels.TimeStampPanel();486 absoluteTimeStampPanel = new scriptbuilder.gui.panels.TimeStampPanel(); 483 487 btnAddTime = new javax.swing.JButton(); 488 timeStampScrollPane1 = new javax.swing.JScrollPane(); 489 relativeTimeStampPanel = new scriptbuilder.gui.panels.TimeStampPanel(); 484 490 485 491 cadEvent.setText("CAD Event"); … … 1285 1291 timeStampScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); 1286 1292 1287 javax.swing.GroupLayout timeStampPanelLayout = new javax.swing.GroupLayout(timeStampPanel);1288 timeStampPanel.setLayout(timeStampPanelLayout);1289 timeStampPanelLayout.setHorizontalGroup(1290 timeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)1293 javax.swing.GroupLayout absoluteTimeStampPanelLayout = new javax.swing.GroupLayout(absoluteTimeStampPanel); 1294 absoluteTimeStampPanel.setLayout(absoluteTimeStampPanelLayout); 1295 absoluteTimeStampPanelLayout.setHorizontalGroup( 1296 absoluteTimeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1291 1297 .addGap(0, 1036, Short.MAX_VALUE) 1292 1298 ); 1293 timeStampPanelLayout.setVerticalGroup(1294 timeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)1299 absoluteTimeStampPanelLayout.setVerticalGroup( 1300 absoluteTimeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1295 1301 .addGap(0, 100, Short.MAX_VALUE) 1296 1302 ); 1297 1303 1298 timeStampScrollPane.setViewportView( timeStampPanel);1304 timeStampScrollPane.setViewportView(absoluteTimeStampPanel); 1299 1305 1300 1306 btnAddTime.setText("+15:00"); … … 1306 1312 } 1307 1313 }); 1314 1315 timeStampScrollPane1.setBorder(null); 1316 timeStampScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); 1317 timeStampScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); 1318 1319 javax.swing.GroupLayout relativeTimeStampPanelLayout = new javax.swing.GroupLayout(relativeTimeStampPanel); 1320 relativeTimeStampPanel.setLayout(relativeTimeStampPanelLayout); 1321 relativeTimeStampPanelLayout.setHorizontalGroup( 1322 relativeTimeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1323 .addGap(0, 1036, Short.MAX_VALUE) 1324 ); 1325 relativeTimeStampPanelLayout.setVerticalGroup( 1326 relativeTimeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1327 .addGap(0, 100, Short.MAX_VALUE) 1328 ); 1329 1330 timeStampScrollPane1.setViewportView(relativeTimeStampPanel); 1308 1331 1309 1332 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); … … 1323 1346 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1324 1347 .addGroup(layout.createSequentialGroup() 1348 .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) 1349 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1350 .addComponent(btnAddTime, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 1351 .addGroup(layout.createSequentialGroup() 1325 1352 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1326 1353 .addComponent(zoomInIcon) 1327 1354 .addComponent(zoomOutIcon)) 1328 .addGap(0, 0, Short.MAX_VALUE)) 1329 .addGroup(layout.createSequentialGroup() 1330 .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) 1331 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1332 .addComponent(btnAddTime, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) 1355 .addGap(0, 0, Short.MAX_VALUE)))) 1333 1356 .addComponent(timelinesScrollPane, 0, 0, Short.MAX_VALUE) 1334 1357 .addComponent(timeStampScrollPane) … … 1336 1359 .addComponent(scriptEventsPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 1337 1360 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1338 .addComponent(scriptEventsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) 1361 .addComponent(scriptEventsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 1362 .addComponent(timeStampScrollPane1)) 1339 1363 .addContainerGap()) 1340 1364 ); … … 1342 1366 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1343 1367 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 1344 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING )1368 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 1345 1369 .addGroup(layout.createSequentialGroup() 1346 1370 .addContainerGap() … … 1352 1376 .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))) 1353 1377 .addGroup(layout.createSequentialGroup() 1354 .addGap(20, 20, 20) 1355 .addComponent(zoomInIcon) 1356 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 1378 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 1357 1379 .addGroup(layout.createSequentialGroup() 1358 .addGap(1, 1, 1) 1380 .addGap(9, 9, 9) 1381 .addComponent(zoomInIcon) 1382 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 1359 1383 .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)) 1360 1384 .addGroup(layout.createSequentialGroup() 1361 .addGap( 17, 17, 17)1385 .addGap(61, 61, 61) 1362 1386 .addComponent(btnAddTime, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))) 1363 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED )1387 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 1364 1388 .addComponent(zoomOutIcon))) 1365 1389 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1366 1390 .addComponent(timeStampScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) 1391 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1392 .addComponent(timeStampScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) 1367 1393 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 1368 1394 .addComponent(timelinesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE) … … 1760 1786 * Add 15 minutes to the end of the timeline. This allows the user to add 1761 1787 * new events past the current end of the incident 1762 * 1788 * 1763 1789 * @param evt the button press event 1764 1790 */ … … 1802 1828 return version; 1803 1829 } 1804 1830 1805 1831 // Variables declaration - do not modify//GEN-BEGIN:variables 1832 private scriptbuilder.gui.panels.TimeStampPanel absoluteTimeStampPanel; 1806 1833 private javax.swing.JButton activityLogEvalButton; 1807 1834 private javax.swing.JFrame addNoiseFrame; … … 1859 1886 private javax.swing.JComboBox radioTypeComboBox; 1860 1887 private javax.swing.JLabel radioTypeLabel; 1888 private scriptbuilder.gui.panels.TimeStampPanel relativeTimeStampPanel; 1861 1889 private javax.swing.JList scriptEventsList; 1862 1890 private javax.swing.JScrollPane scriptEventsPane; … … 1870 1898 private javax.swing.JSlider sliderTMCAL; 1871 1899 private javax.swing.JButton telephoneButton; 1872 private scriptbuilder.gui.panels.TimeStampPanel timeStampPanel;1873 1900 private javax.swing.JScrollPane timeStampScrollPane; 1901 private javax.swing.JScrollPane timeStampScrollPane1; 1874 1902 private scriptbuilder.gui.panels.TimelineTickPanel timelineTickPanel; 1875 1903 private javax.swing.JScrollPane timelinesScrollPane; -
trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java
r114 r117 1543 1543 script.incidents.get(indx).setOffset((Integer) addIncidentStart.getValue() * 60); 1544 1544 script.numberOfIncidents++; 1545 new IncidentEditorFrame(script.incidents.get(indx), this).setVisible(true); 1545 IncidentEditorFrame editor = new IncidentEditorFrame(script.incidents.get(indx), this); 1546 1547 editor.setVisible(true); 1546 1548 } 1547 1549 else//editing existing incident -
trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java
r113 r117 243 243 if (getTopLevelAncestor() instanceof IncidentEditorFrame) 244 244 { 245 if (incident.slices.size() == 0) 246 { 247 newSlice = 0; 248 } 245 249 if (g.currentEventType != null) 246 250 { -
trunk/src/scriptbuilder/gui/panels/TimeStampPanel.java
r115 r117 1 1 package scriptbuilder.gui.panels; 2 2 3 import java.awt.Color; 3 4 import java.awt.Dimension; 4 5 import java.awt.Graphics; … … 20 21 { 21 22 23 private int offset = 0; 24 25 private boolean isAbsolute = false; 26 22 27 private int longestLength = ScriptBuilderGuiConstants.TICK_TIMELINE_SMALLEST_LENGTH; 23 28 … … 38 43 { 39 44 super(); 45 } 46 47 public void setOffset(int newOffset) 48 { 49 offset = newOffset; 50 } 51 52 public void setAbsolute(boolean abs) 53 { 54 isAbsolute = abs; 40 55 } 41 56 … … 144 159 * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK 145 160 + ScriptBuilderGuiConstants.TICK_TIMELINE_LEFT_MARGIN; 146 int seconds = 0;161 int seconds = offset; 147 162 148 163 // Major Ticks 149 g2d.setColor(ScriptBuilderGuiConstants.TIMELINE_TICK_COLOR); 150 seconds = 0; 164 if (isAbsolute) 165 { 166 g2d.setColor(Color.red); 167 } 168 else 169 { 170 g2d.setColor(ScriptBuilderGuiConstants.TIMELINE_TICK_COLOR); 171 } 151 172 for (int i = ScriptBuilderGuiConstants.TICK_TIMELINE_LEFT_MARGIN; 152 173 i <= longestLengthPlusMargin; -
trunk/src/scriptbuilder/structures/ScriptIncident.java
r116 r117 188 188 public void addNewEvent(I_ScriptEvent ev, int start) 189 189 { 190 //The first event in the incident defines its start point, so it should 191 //be placed at time 0 192 if (start != 0 && slices.size() == 0) 193 { 194 addNewEvent(ev, 0); 195 } 196 190 //Check to see if there's already a timeslice here 191 TimeSlice t = slices.get(start); 192 //If not, make one; then, add the event to it 193 if (t == null) 194 { 195 t = new TimeSlice(start, this); 196 t.addEvent(ev); 197 slices.put(start, t); 198 } 197 199 else 198 200 { 199 //Check to see if there's already a timeslice here 200 TimeSlice t = slices.get(start); 201 //If not, make one; then, add the event to it 202 if (t == null) 203 { 204 t = new TimeSlice(start, this); 205 t.addEvent(ev); 206 slices.put(start, t); 207 } 208 else 209 { 210 t.addEvent(ev); 211 } 212 eventCount++; 213 214 //If this is the latest start time in the incident, update that number 215 if (start > latestStart) 216 { 217 latestStart = start; 218 } 201 t.addEvent(ev); 202 } 203 eventCount++; 204 205 //If this is the latest start time in the incident, update that number 206 if (start > latestStart) 207 { 208 latestStart = start; 209 } 219 210 //If this event is earlier than all previous events, or if there are 220 //no other events, the offset is equal to this event's start time 221 if (start < offset || eventCount == 1) 222 { 223 offset = start; 224 //System.out.println("Offset: " + offset); 225 } 226 updateLength(); 227 } 211 //no other events, the offset is equal to this event's start time 212 if (start < offset || eventCount == 1) 213 { 214 offset = start; 215 //System.out.println("Offset: " + offset); 216 } 217 updateLength(); 228 218 } 229 219
Note: See TracChangeset
for help on using the changeset viewer.
