Changeset 89 in tmcsimulator-scriptbuilder for trunk/src/event/editor/CHPRadioPanel.java


Ignore:
Timestamp:
08/28/2017 01:38:15 PM (9 years ago)
Author:
bmcguffin
Message:

Added dropdown menu item to ScriptBuilderFrame?: "Delete Incident". When clicked, user may select an existing incident to delete. Program will prompt user to confirm the deletion, then remove the incident from the script and refresh the display.

Added button to individual event editor window: "Remove this event". When clicked, the currently displayed event will be removed from the timeslice it is in. The display will be refreshed accordingly. NOTE: This still has some bugs, namely that the last remaining event in a timeslice fails to be deleted.

Restructured Interface ScriptEventEditorPanel? to include a removeAssociatedEvent method, which calls a new method in I_ScriptEvent called removeThis, which causes the event to be removed from its timeslice.

Editor.Java previously contained several classes and enums, none of which were set to private scope. Moved these extra classes to their own files to decrease clutter in Editor.java and increase readability of all files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/CHPRadioPanel.java

    r76 r89  
    101101        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 
    102102    } 
     103     
     104    @Override 
     105    public boolean removeAssociatedEvent() 
     106    { 
     107        ((I_ScriptEvent)event).removeThis(); 
     108        event = null; 
     109        return true; 
     110    } 
    103111 
    104112    /** 
     
    109117    @SuppressWarnings("unchecked") 
    110118    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 
    111     private void initComponents() { 
     119    private void initComponents() 
     120    { 
    112121 
    113122        jLabel4 = new javax.swing.JLabel(); 
     
    125134        jButton2.setText("Browse"); 
    126135        jButton2.setToolTipText("Browse for the radio audio file"); 
    127         jButton2.addMouseListener(new java.awt.event.MouseAdapter() { 
    128             public void mouseClicked(java.awt.event.MouseEvent evt) { 
     136        jButton2.addMouseListener(new java.awt.event.MouseAdapter() 
     137        { 
     138            public void mouseClicked(java.awt.event.MouseEvent evt) 
     139            { 
    129140                browse(evt); 
    130141            } 
     
    139150        addFieldButton.setText("Add Field"); 
    140151        addFieldButton.setToolTipText("Adds a row for dialog by the field operator in the table"); 
    141         addFieldButton.addActionListener(new java.awt.event.ActionListener() { 
    142             public void actionPerformed(java.awt.event.ActionEvent evt) { 
     152        addFieldButton.addActionListener(new java.awt.event.ActionListener() 
     153        { 
     154            public void actionPerformed(java.awt.event.ActionEvent evt) 
     155            { 
    143156                addFieldButtonActionPerformed(evt); 
    144157            } 
     
    158171                        .add(addFieldButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 130, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    159172                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) 
    160                         .add(deleteSelectedButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 131, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    161                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) 
     173                        .add(deleteSelectedButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 131, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 
    162174                    .add(layout.createSequentialGroup() 
    163175                        .add(jLabel4) 
Note: See TracChangeset for help on using the changeset viewer.