Changeset 98 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/IncidentEditorFrame.java


Ignore:
Timestamp:
08/29/2017 10:40:27 AM (9 years ago)
Author:
bmcguffin
Message:

Added "Add 15 minutes" button, btnAddTime, to both Script Builder and Incident Editor windows. Clicking the button allows the user to add 15 minutes of scrollable space to the end of the timeline window, so that new events can be added after the end. This extra time does not interact with the model and so does not enter the save file, or persist between iterations of the program.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/IncidentEditorFrame.java

    r89 r98  
    2222import javax.swing.DefaultListModel; 
    2323import javax.swing.JButton; 
     24import scriptbuilder.gui.panels.IncidentTimelinePanel; 
    2425import scriptbuilder.structures.ScriptEvent; 
    2526import scriptbuilder.structures.ScriptEvent.ScriptEventType; 
     
    310311            theIncident = (ScriptIncident) arg; 
    311312             
    312             timelineTickPanel.update(theIncident); 
    313             timeStampPanel.update(theIncident); 
     313            timelineTickPanel.update(theIncident, incidentTimelinePanel1); 
     314            timeStampPanel.update(theIncident, incidentTimelinePanel1); 
    314315 
    315316            incidentTimelinePanel1.timelinePanelUpdate(theIncident); 
     
    438439        timeStampScrollPane = new javax.swing.JScrollPane(); 
    439440        timeStampPanel = new scriptbuilder.gui.panels.TimeStampPanel(); 
     441        btnAddTime = new javax.swing.JButton(); 
    440442 
    441443        cadEvent.setText("CAD Event"); 
     
    12451247        timeStampPanelLayout.setHorizontalGroup( 
    12461248            timeStampPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    1247             .addGap(0, 1032, Short.MAX_VALUE) 
     1249            .addGap(0, 1036, Short.MAX_VALUE) 
    12481250        ); 
    12491251        timeStampPanelLayout.setVerticalGroup( 
     
    12531255 
    12541256        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        }); 
    12551266 
    12561267        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 
     
    12611272                .addContainerGap() 
    12621273                .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)) 
    12691274                    .addGroup(layout.createSequentialGroup() 
    12701275                        .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) 
     
    12751280                        .addGap(18, 18, 18) 
    12761281                        .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))) 
    12801297                .addContainerGap()) 
    12811298        ); 
     
    12951312                        .addGap(20, 20, 20) 
    12961313                        .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))) 
    12991321                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    13001322                        .addComponent(zoomOutIcon))) 
     
    16911713        zoomSlider.setValue(zoomSlider.getValue() <= 5 ? 5 : zoomSlider.getValue() - 1); 
    16921714    }//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 
    16931721 
    16941722    /** 
     
    17811809    private javax.swing.JButton atmsEvalButton; 
    17821810    private javax.swing.JButton audioButton; 
     1811    private javax.swing.JButton btnAddTime; 
    17831812    private javax.swing.JButton cadButton; 
    17841813    private javax.swing.JButton cadEvalButton; 
Note: See TracChangeset for help on using the changeset viewer.