Changeset 98 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/ScriptBuilderFrame.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/ScriptBuilderFrame.java

    r95 r98  
    2525import javax.swing.UIManager; 
    2626import javax.swing.UnsupportedLookAndFeelException; 
     27import scriptbuilder.gui.panels.IncidentTimelinePanel; 
    2728import scriptbuilder.structures.ScriptEvent; 
    2829import scriptbuilder.structures.ScriptEvent.ScriptEventType; 
     
    333334        timeStampScrollPane = new javax.swing.JScrollPane(); 
    334335        timeStampPanel = new scriptbuilder.gui.panels.TimeStampPanel(); 
     336        btnAddTime = new javax.swing.JButton(); 
    335337        scriptBuilderMenuBar = new javax.swing.JMenuBar(); 
    336338        fileMenu = new javax.swing.JMenu(); 
     
    11771179        timeStampScrollPane.setViewportView(timeStampPanel); 
    11781180 
     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 
    11791190        fileMenu.setText("File"); 
    11801191        fileMenu.setMargin(new java.awt.Insets(0, 10, 0, 10)); 
     
    14001411                    .addComponent(timeStampScrollPane) 
    14011412                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 
    1402                         .addGap(0, 597, Short.MAX_VALUE) 
     1413                        .addGap(0, 604, Short.MAX_VALUE) 
    14031414                        .addComponent(zoomOutIcon) 
    14041415                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
     
    14061417                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    14071418                        .addComponent(zoomInIcon) 
    1408                         .addGap(136, 136, 136))) 
     1419                        .addGap(18, 18, 18) 
     1420                        .addComponent(btnAddTime) 
     1421                        .addGap(21, 21, 21))) 
    14091422                .addContainerGap()) 
    14101423        ); 
     
    14161429                    .addComponent(zoomOutIcon) 
    14171430                    .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)) 
    14191433                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    14201434                .addComponent(timeStampScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) 
     
    20252039    }//GEN-LAST:event_deleteIncidentActionPerformed 
    20262040 
     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 
    20272047    /** 
    20282048     * Read the version number from the application properties. The file 
     
    21162136    private javax.swing.JSpinner addIncidentStart; 
    21172137    private javax.swing.JFrame addNoiseFrame; 
     2138    private javax.swing.JButton btnAddTime; 
    21182139    private javax.swing.JMenuItem cadEvent; 
    21192140    private javax.swing.JFrame cadEventFrame; 
Note: See TracChangeset for help on using the changeset viewer.