Changeset 187 in tmcsimulator-scriptbuilder for trunk/src/event/editor
- Timestamp:
- 01/14/2020 06:49:40 AM (6 years ago)
- Location:
- trunk/src/event/editor
- Files:
-
- 2 edited
-
TelephonePanel.form (modified) (5 diffs)
-
TelephonePanel.java (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/event/editor/TelephonePanel.form
r145 r187 19 19 <Group type="102" alignment="1" attributes="0"> 20 20 <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"> 28 22 <Group type="102" alignment="0" attributes="0"> 29 23 <Component id="addInstructorButton" min="-2" max="-2" attributes="0"/> … … 32 26 <EmptySpace type="unrelated" max="-2" attributes="0"/> 33 27 <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"/> 35 29 </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> 37 41 </Group> 38 <EmptySpace min="-2" pref="26" max="-2" attributes="0"/>39 42 </Group> 40 43 </Group> … … 43 46 <Group type="103" groupAlignment="0" attributes="0"> 44 47 <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"/> 48 49 <Group type="103" groupAlignment="3" attributes="0"> 49 50 <Component id="txtInstructorRole" alignment="3" min="-2" max="-2" attributes="0"/> … … 84 85 <Property name="toolTipText" type="java.lang.String" value="Deletes the selected row in the table"/> 85 86 </Properties> 86 <Events>87 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteSelectedButtonActionPerformed"/>88 </Events>89 87 </Component> 90 88 <Component class="javax.swing.JButton" name="addInstructorButton"> … … 107 105 </Properties> 108 106 </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>119 107 </SubComponents> 120 108 </Form> -
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.
