Changeset 92 in tmcsimulator-scriptbuilder for trunk/src/event/editor/AudioPanel.java


Ignore:
Timestamp:
08/28/2017 04:12:45 PM (9 years ago)
Author:
bmcguffin
Message:

Removed superfluous "Remove" buttons on several panels.

Removed interface "RemovablePanel?" as it was no longer necessary or useful; removed related methods from classes implementing it.

File:
1 edited

Legend:

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

    r89 r92  
    1111 * @author nathaniellehrer 
    1212 */ 
    13 public class AudioPanel extends javax.swing.JPanel implements RemoveablePanel, ScriptEventEditorPanel 
     13public class AudioPanel extends javax.swing.JPanel implements I_ScriptEventEditorPanel 
    1414{ 
    1515 
     
    2626    } 
    2727 
    28     /** 
    29      * Load the script event associated with this editor panel. 
    30      * 
    31      * @param sei The script event in question 
    32      */ 
    3328    @Override 
    3429    public void getEventObject(I_ScriptEvent sei) 
     
    8580    } 
    8681 
    87     public void setRemoveListener(ActionListener listener) 
    88     { 
    89         removeListener = listener; 
    90     } 
    91  
     82    @Override 
    9283    public void update(Observable o, Object arg) 
    9384    { 
     
    113104    { 
    114105 
    115         removeButton = new javax.swing.JButton(); 
    116106        jLabel1 = new javax.swing.JLabel(); 
    117107        audioFileText = new javax.swing.JTextField(); 
     
    119109        audioLengthText = new javax.swing.JFormattedTextField(); 
    120110        browseButton = new javax.swing.JButton(); 
    121  
    122         removeButton.setText("Remove"); 
    123         removeButton.setToolTipText("Removes this property"); 
    124         removeButton.addMouseListener(new java.awt.event.MouseAdapter() 
    125         { 
    126             public void mouseClicked(java.awt.event.MouseEvent evt) 
    127             { 
    128                 removeThisProperty(evt); 
    129             } 
    130         }); 
    131         removeButton.addActionListener(new java.awt.event.ActionListener() 
    132         { 
    133             public void actionPerformed(java.awt.event.ActionEvent evt) 
    134             { 
    135                 removeButtonActionPerformed(evt); 
    136             } 
    137         }); 
    138111 
    139112        jLabel1.setText("Audio File"); 
     
    162135                .addContainerGap() 
    163136                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    164                     .add(org.jdesktop.layout.GroupLayout.TRAILING, removeButton) 
     137                    .add(jLabel1) 
     138                    .add(jLabel2)) 
     139                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
     140                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    165141                    .add(layout.createSequentialGroup() 
    166                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    167                             .add(jLabel1) 
    168                             .add(jLabel2)) 
     142                        .add(audioFileText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 395, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    169143                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
    170                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    171                             .add(layout.createSequentialGroup() 
    172                                 .add(audioFileText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 395, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    173                                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
    174                                 .add(browseButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)) 
    175                             .add(audioLengthText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)))) 
     144                        .add(browseButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)) 
     145                    .add(audioLengthText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)) 
    176146                .addContainerGap()) 
    177147        ); 
     
    179149            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    180150            .add(layout.createSequentialGroup() 
    181                 .addContainerGap() 
    182                 .add(removeButton) 
    183                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
     151                .add(41, 41, 41) 
    184152                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 
    185153                    .add(audioFileText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
     
    193161        ); 
    194162    }// </editor-fold>//GEN-END:initComponents 
    195  
    196     private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed 
    197         // TODO add your handling code here: 
    198     }//GEN-LAST:event_removeButtonActionPerformed 
    199  
    200     private void removeThisProperty(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_removeThisProperty 
    201         if (removeListener != null) 
    202         { 
    203             removeListener.actionPerformed(new ActionEvent(this, 0, "")); 
    204         } 
    205     }//GEN-LAST:event_removeThisProperty 
    206163 
    207164    private void browse(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_browse 
     
    221178    private javax.swing.JLabel jLabel1; 
    222179    private javax.swing.JLabel jLabel2; 
    223     private javax.swing.JButton removeButton; 
    224180    // End of variables declaration//GEN-END:variables 
    225181 
Note: See TracChangeset for help on using the changeset viewer.