Changeset 187 in tmcsimulator-scriptbuilder for trunk/src/event/editor


Ignore:
Timestamp:
01/14/2020 06:49:40 AM (6 years ago)
Author:
jdalbey
Message:

TelephonePanel?.java deleted "Remove" button as it's function is not performed by the "Remove this event" button.

Location:
trunk/src/event/editor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/TelephonePanel.form

    r145 r187  
    1919          <Group type="102" alignment="1" attributes="0"> 
    2020              <EmptySpace max="-2" attributes="0"/> 
    21               <Group type="103" groupAlignment="1" attributes="0"> 
    22                   <Component id="jScrollPane1" alignment="0" pref="602" max="32767" attributes="0"/> 
    23                   <Group type="102" alignment="0" attributes="0"> 
    24                       <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 
    25                       <EmptySpace max="-2" attributes="0"/> 
    26                       <Component id="txtInstructorRole" pref="478" max="32767" attributes="0"/> 
    27                   </Group> 
     21              <Group type="103" groupAlignment="0" attributes="0"> 
    2822                  <Group type="102" alignment="0" attributes="0"> 
    2923                      <Component id="addInstructorButton" min="-2" max="-2" attributes="0"/> 
     
    3226                      <EmptySpace type="unrelated" max="-2" attributes="0"/> 
    3327                      <Component id="deleteSelectedButton" min="-2" pref="178" max="-2" attributes="0"/> 
    34                       <EmptySpace pref="86" max="32767" attributes="0"/> 
     28                      <EmptySpace pref="133" max="32767" attributes="0"/> 
    3529                  </Group> 
    36                   <Component id="removeButton" alignment="1" min="-2" max="-2" attributes="0"/> 
     30                  <Group type="102" attributes="0"> 
     31                      <Group type="103" groupAlignment="1" attributes="0"> 
     32                          <Component id="jScrollPane1" alignment="0" pref="602" max="32767" attributes="0"/> 
     33                          <Group type="102" alignment="0" attributes="0"> 
     34                              <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 
     35                              <EmptySpace max="-2" attributes="0"/> 
     36                              <Component id="txtInstructorRole" pref="478" max="32767" attributes="0"/> 
     37                          </Group> 
     38                      </Group> 
     39                      <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> 
     40                  </Group> 
    3741              </Group> 
    38               <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> 
    3942          </Group> 
    4043      </Group> 
     
    4346      <Group type="103" groupAlignment="0" attributes="0"> 
    4447          <Group type="102" alignment="0" attributes="0"> 
    45               <EmptySpace max="-2" attributes="0"/> 
    46               <Component id="removeButton" min="-2" max="-2" attributes="0"/> 
    47               <EmptySpace max="-2" attributes="0"/> 
     48              <EmptySpace min="-2" pref="49" max="-2" attributes="0"/> 
    4849              <Group type="103" groupAlignment="3" attributes="0"> 
    4950                  <Component id="txtInstructorRole" alignment="3" min="-2" max="-2" attributes="0"/> 
     
    8485        <Property name="toolTipText" type="java.lang.String" value="Deletes the selected row in the table"/> 
    8586      </Properties> 
    86       <Events> 
    87         <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteSelectedButtonActionPerformed"/> 
    88       </Events> 
    8987    </Component> 
    9088    <Component class="javax.swing.JButton" name="addInstructorButton"> 
     
    107105      </Properties> 
    108106    </Component> 
    109     <Component class="javax.swing.JButton" name="removeButton"> 
    110       <Properties> 
    111         <Property name="text" type="java.lang.String" value="Remove"/> 
    112         <Property name="toolTipText" type="java.lang.String" value="Removes this property"/> 
    113       </Properties> 
    114       <Events> 
    115         <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="removeThisProperty"/> 
    116         <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeButtonActionPerformed"/> 
    117       </Events> 
    118     </Component> 
    119107  </SubComponents> 
    120108</Form> 
  • trunk/src/event/editor/TelephonePanel.java

    r145 r187  
    9999                    event.roles.remove(e.getLastRow()); 
    100100                    event.lines.remove(e.getLastRow()); 
     101                    System.out.println("deleted table row"); 
    101102                } 
    102103            } 
     
    110111    } 
    111112     
     113    /** Implementation of remove this event action */ 
    112114    @Override 
    113115    public boolean removeAssociatedEvent() 
     
    139141        txtInstructorRole = new javax.swing.JTextField(); 
    140142        jLabel1 = new javax.swing.JLabel(); 
    141         removeButton = new javax.swing.JButton(); 
    142143 
    143144        addStudentButton.setText("Add Student Line"); 
     
    148149        deleteSelectedButton.setText("Delete Selected Line"); 
    149150        deleteSelectedButton.setToolTipText("Deletes the selected row in the table"); 
    150         deleteSelectedButton.addActionListener(new java.awt.event.ActionListener() { 
    151             public void actionPerformed(java.awt.event.ActionEvent evt) { 
    152                 deleteSelectedButtonActionPerformed(evt); 
    153             } 
    154         }); 
    155151 
    156152        addInstructorButton.setText("Add Instructor Line"); 
     
    165161 
    166162        jLabel1.setText("Role of instructor:"); 
    167  
    168         removeButton.setText("Remove"); 
    169         removeButton.setToolTipText("Removes this property"); 
    170         removeButton.addMouseListener(new java.awt.event.MouseAdapter() { 
    171             public void mouseClicked(java.awt.event.MouseEvent evt) { 
    172                 removeThisProperty(evt); 
    173             } 
    174         }); 
    175         removeButton.addActionListener(new java.awt.event.ActionListener() { 
    176             public void actionPerformed(java.awt.event.ActionEvent evt) { 
    177                 removeButtonActionPerformed(evt); 
    178             } 
    179         }); 
    180163 
    181164        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 
     
    185168            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() 
    186169                .addContainerGap() 
    187                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) 
    188                     .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 602, Short.MAX_VALUE) 
    189                     .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() 
    190                         .add(jLabel1) 
    191                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
    192                         .add(txtInstructorRole, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)) 
    193                     .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() 
     170                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
     171                    .add(layout.createSequentialGroup() 
    194172                        .add(addInstructorButton) 
    195173                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) 
     
    197175                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) 
    198176                        .add(deleteSelectedButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 178, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    199                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 86, Short.MAX_VALUE)) 
    200                     .add(removeButton)) 
    201                 .add(26, 26, 26)) 
     177                        .addContainerGap(133, Short.MAX_VALUE)) 
     178                    .add(layout.createSequentialGroup() 
     179                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) 
     180                            .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 602, Short.MAX_VALUE) 
     181                            .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() 
     182                                .add(jLabel1) 
     183                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
     184                                .add(txtInstructorRole, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE))) 
     185                        .add(26, 26, 26)))) 
    202186        ); 
    203187        layout.setVerticalGroup( 
    204188            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    205189            .add(layout.createSequentialGroup() 
    206                 .addContainerGap() 
    207                 .add(removeButton) 
    208                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
     190                .add(49, 49, 49) 
    209191                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 
    210192                    .add(txtInstructorRole, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
     
    221203    }// </editor-fold>//GEN-END:initComponents 
    222204 
    223     private void removeThisProperty(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_removeThisProperty 
    224         //linked to remove button - removes the current buton 
    225         if (removeListener != null) 
    226         { 
    227             removeListener.actionPerformed(new ActionEvent(this, 0, "")); 
    228         } 
    229     }//GEN-LAST:event_removeThisProperty 
    230  
    231205    private void addInstructorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addInstructorButtonActionPerformed 
    232206        // TODO add your handling code here: 
     
    237211    }//GEN-LAST:event_addInstructorButtonActionPerformed 
    238212 
    239     private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed 
    240         // TODO add your handling code here: 
    241     }//GEN-LAST:event_removeButtonActionPerformed 
    242  
    243     private void deleteSelectedButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSelectedButtonActionPerformed 
    244         // TODO add your handling code here: 
    245     }//GEN-LAST:event_deleteSelectedButtonActionPerformed 
    246  
    247213 
    248214    // Variables declaration - do not modify//GEN-BEGIN:variables 
     
    252218    private javax.swing.JLabel jLabel1; 
    253219    private javax.swing.JScrollPane jScrollPane1; 
    254     private javax.swing.JButton removeButton; 
    255220    private javax.swing.JTextField txtInstructorRole; 
    256221    // End of variables declaration//GEN-END:variables 
Note: See TracChangeset for help on using the changeset viewer.