Changeset 187 in tmcsimulator-scriptbuilder for trunk/src/event/editor/TelephonePanel.java
- Timestamp:
- 01/14/2020 06:49:40 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/event/editor/TelephonePanel.java (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/event/editor/TelephonePanel.java
r145 r187 99 99 event.roles.remove(e.getLastRow()); 100 100 event.lines.remove(e.getLastRow()); 101 System.out.println("deleted table row"); 101 102 } 102 103 } … … 110 111 } 111 112 113 /** Implementation of remove this event action */ 112 114 @Override 113 115 public boolean removeAssociatedEvent() … … 139 141 txtInstructorRole = new javax.swing.JTextField(); 140 142 jLabel1 = new javax.swing.JLabel(); 141 removeButton = new javax.swing.JButton();142 143 143 144 addStudentButton.setText("Add Student Line"); … … 148 149 deleteSelectedButton.setText("Delete Selected Line"); 149 150 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 });155 151 156 152 addInstructorButton.setText("Add Instructor Line"); … … 165 161 166 162 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 });180 163 181 164 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); … … 185 168 .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() 186 169 .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() 194 172 .add(addInstructorButton) 195 173 .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) … … 197 175 .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) 198 176 .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)))) 202 186 ); 203 187 layout.setVerticalGroup( 204 188 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 205 189 .add(layout.createSequentialGroup() 206 .addContainerGap() 207 .add(removeButton) 208 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 190 .add(49, 49, 49) 209 191 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 210 192 .add(txtInstructorRole, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) … … 221 203 }// </editor-fold>//GEN-END:initComponents 222 204 223 private void removeThisProperty(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_removeThisProperty224 //linked to remove button - removes the current buton225 if (removeListener != null)226 {227 removeListener.actionPerformed(new ActionEvent(this, 0, ""));228 }229 }//GEN-LAST:event_removeThisProperty230 231 205 private void addInstructorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addInstructorButtonActionPerformed 232 206 // TODO add your handling code here: … … 237 211 }//GEN-LAST:event_addInstructorButtonActionPerformed 238 212 239 private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed240 // TODO add your handling code here:241 }//GEN-LAST:event_removeButtonActionPerformed242 243 private void deleteSelectedButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSelectedButtonActionPerformed244 // TODO add your handling code here:245 }//GEN-LAST:event_deleteSelectedButtonActionPerformed246 247 213 248 214 // Variables declaration - do not modify//GEN-BEGIN:variables … … 252 218 private javax.swing.JLabel jLabel1; 253 219 private javax.swing.JScrollPane jScrollPane1; 254 private javax.swing.JButton removeButton;255 220 private javax.swing.JTextField txtInstructorRole; 256 221 // End of variables declaration//GEN-END:variables
Note: See TracChangeset
for help on using the changeset viewer.
