Changeset 189 in tmcsimulator-scriptbuilder for trunk/src


Ignore:
Timestamp:
01/20/2020 06:16:07 PM (6 years ago)
Author:
sdanthin
Message:

IncidentPaletteFrame?.java changed behavior of create new in the incident selector to show the incidentFrame window instead of just bringing up the IncidentEditorFrame? itself
ScriptBuilderFrame?.java created separate method to bring up the IncidentFrame? window so that it can be shown/initialized outside of ScriptBuilderFrame? scope

Location:
trunk/src/scriptbuilder/gui
Files:
2 edited

Legend:

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

    r137 r189  
    455455    private void btnCreateIncidentActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnCreateIncidentActionPerformed 
    456456    {//GEN-HEADEREND:event_btnCreateIncidentActionPerformed 
    457         int newLogNum = 100; 
    458         boolean found = false; 
    459         while (!found) 
    460         { 
    461             newLogNum++; 
    462             if (!scriptContainsLogNum(script, newLogNum)) 
    463             { 
    464                 found = true; 
    465                 for (ScriptIncident incident : incidentList) 
    466                 { 
    467                     if (incident.number == newLogNum) 
    468                     { 
    469                         found = false; 
    470                     } 
    471                 } 
    472             } 
    473         } 
    474  
    475         ScriptIncident newInc = new ScriptIncident(newLogNum, "New Incident", LocalDate.now().toString(), script); 
    476         if (script.addIncident(newInc)) 
    477         { 
    478             new IncidentEditorFrame(newInc, parent).setVisible(true); 
    479             this.dispose(); 
    480         } 
     457       parent.openIncidentCreateWindow(); 
     458       this.dispose(); 
     459//        int newLogNum = 100; 
     460//        boolean found = false; 
     461//        while (!found) 
     462//        { 
     463//            newLogNum++; 
     464//            if (!scriptContainsLogNum(script, newLogNum)) 
     465//            { 
     466//                found = true; 
     467//                for (ScriptIncident incident : incidentList) 
     468//                { 
     469//                    if (incident.number == newLogNum) 
     470//                    { 
     471//                        found = false; 
     472//                    } 
     473//                } 
     474//            } 
     475//        } 
     476//        parent. 
     477// 
     478//        ScriptIncident newInc = new ScriptIncident(newLogNum, "New Incident", LocalDate.now().toString(), script); 
     479//        if (script.addIncident(newInc)) 
     480//        { 
     481//            new IncidentEditorFrame(newInc, parent).setVisible(true); 
     482//            this.dispose(); 
     483//        } 
    481484 
    482485    }//GEN-LAST:event_btnCreateIncidentActionPerformed 
  • trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java

    r183 r189  
    17801780     */ 
    17811781    private void newIncidentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newIncidentActionPerformed 
     1782        openIncidentCreateWindow(); 
     1783    }//GEN-LAST:event_newIncidentActionPerformed 
     1784 
     1785    public void openIncidentCreateWindow() 
     1786    { 
    17821787        editingIncident = false; 
    1783  
    17841788        addIncidentName.setText(""); 
    17851789        int newLogNum = 100; 
     
    18121816 
    18131817        incidentFrame.setVisible(true); 
    1814     }//GEN-LAST:event_newIncidentActionPerformed 
    1815  
     1818    } 
    18161819    private void fileMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileMenuActionPerformed 
    18171820    }//GEN-LAST:event_fileMenuActionPerformed 
Note: See TracChangeset for help on using the changeset viewer.