Rev 89 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 89 | Rev 93 | ||
---|---|---|---|
Line 109... | Line 109... | ||
109 | rcnt++;
|
109 | rcnt++;
|
110 | }
|
110 | }
|
111 | startButton.setEnabled(rcnt < cnt); |
111 | startButton.setEnabled(rcnt < cnt); |
112 | stopButton.setEnabled(rcnt > 0); |
112 | stopButton.setEnabled(rcnt > 0); |
113 | }
|
113 | }
|
- | 114 | ||
- | 115 | propsButton.setEnabled(cnt == 1); |
|
114 | }
|
116 | }
|
115 | 117 | ||
116 | /**
|
118 | /**
|
117 | * Updates the buttons according the current selection.
|
119 | * Updates the buttons according the current selection.
|
118 | * @param e list selection event
|
120 | * @param e list selection event
|
Line 134... | Line 136... | ||
134 | startButton = new javax.swing.JButton(); |
136 | startButton = new javax.swing.JButton(); |
135 | stopButton = new javax.swing.JButton(); |
137 | stopButton = new javax.swing.JButton(); |
136 | addButton = new javax.swing.JButton(); |
138 | addButton = new javax.swing.JButton(); |
137 | removeButton = new javax.swing.JButton(); |
139 | removeButton = new javax.swing.JButton(); |
138 | resetButton = new javax.swing.JButton(); |
140 | resetButton = new javax.swing.JButton(); |
- | 141 | propsButton = new javax.swing.JButton(); |
|
139 | jScrollPane1 = new javax.swing.JScrollPane(); |
142 | jScrollPane1 = new javax.swing.JScrollPane(); |
140 | jTable1 = new javax.swing.JTable(); |
143 | jTable1 = new javax.swing.JTable(); |
141 | 144 | ||
142 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
145 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
143 | setTitle("LWTT"); |
146 | setTitle("LWTT"); |
Line 184... | Line 187... | ||
184 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
187 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
185 | resetPressed(evt); |
188 | resetPressed(evt); |
186 | }
|
189 | }
|
187 | }); |
190 | }); |
188 | 191 | ||
- | 192 | propsButton.setText("Properties..."); |
|
- | 193 | propsButton.setActionCommand("Properties"); |
|
- | 194 | propsButton.addActionListener(new java.awt.event.ActionListener() { |
|
- | 195 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
- | 196 | propsPressed(evt); |
|
- | 197 | }
|
|
- | 198 | }); |
|
- | 199 | ||
189 | org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); |
200 | org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); |
190 | jPanel1.setLayout(jPanel1Layout); |
201 | jPanel1.setLayout(jPanel1Layout); |
191 | jPanel1Layout.setHorizontalGroup( |
202 | jPanel1Layout.setHorizontalGroup( |
192 | jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
203 | jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
193 | .add(jPanel1Layout.createSequentialGroup() |
204 | .add(jPanel1Layout.createSequentialGroup() |
Line 198... | Line 209... | ||
198 | .add(addButton) |
209 | .add(addButton) |
199 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
210 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
200 | .add(removeButton) |
211 | .add(removeButton) |
201 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
212 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
202 | .add(resetButton) |
213 | .add(resetButton) |
- | 214 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|
- | 215 | .add(propsButton) |
|
203 | .addContainerGap(251, Short.MAX_VALUE)) |
216 | .addContainerGap(152, Short.MAX_VALUE)) |
204 | ); |
217 | ); |
205 | jPanel1Layout.setVerticalGroup( |
218 | jPanel1Layout.setVerticalGroup( |
206 | jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
219 | jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
207 | .add(startButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
220 | .add(startButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
208 | .add(stopButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
221 | .add(stopButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
209 | .add(addButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
222 | .add(addButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
210 | .add(removeButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
223 | .add(removeButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
211 | .add(resetButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
224 | .add(resetButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) |
- | 225 | .add(propsButton) |
|
212 | ); |
226 | ); |
213 | 227 | ||
214 | jSplitPane1.setTopComponent(jPanel1); |
228 | jSplitPane1.setTopComponent(jPanel1); |
215 | 229 | ||
216 | jScrollPane1.setPreferredSize(new java.awt.Dimension(454, 400)); |
230 | jScrollPane1.setPreferredSize(new java.awt.Dimension(454, 400)); |
Line 300... | Line 314... | ||
300 | if (cnt > 0) { |
314 | if (cnt > 0) { |
301 | model.startTasks(start, start + cnt - 1); |
315 | model.startTasks(start, start + cnt - 1); |
302 | updateButtons(); |
316 | updateButtons(); |
303 | }
|
317 | }
|
304 | }//GEN-LAST:event_startPressed |
318 | }//GEN-LAST:event_startPressed |
- | 319 | ||
- | 320 | private void propsPressed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_propsPressed |
|
- | 321 | TaskPropetiesDialog d = new TaskPropetiesDialog(this, true); |
|
- | 322 | int start = jTable1.getSelectedRow(); |
|
- | 323 | int cnt = jTable1.getSelectedRowCount(); |
|
- | 324 | if (cnt == 1) { |
|
- | 325 | Task t = model.getTask(start); |
|
- | 326 | d.setPrice(t.getPrice()); |
|
- | 327 | d.setVisible(true); |
|
- | 328 | if (d.getReturnStatus() == TaskPropetiesDialog.RET_OK) { |
|
- | 329 | t.setPrice(d.getPrice()); |
|
- | 330 | model.fireTableCellUpdated(start, 2); |
|
- | 331 | }
|
|
- | 332 | }
|
|
- | 333 | }//GEN-LAST:event_propsPressed |
|
305 | 334 | ||
306 | // Variables declaration - do not modify//GEN-BEGIN:variables
|
335 | // Variables declaration - do not modify//GEN-BEGIN:variables
|
307 | private javax.swing.JButton addButton; |
336 | private javax.swing.JButton addButton; |
308 | private javax.swing.JPanel jPanel1; |
337 | private javax.swing.JPanel jPanel1; |
309 | private javax.swing.JScrollPane jScrollPane1; |
338 | private javax.swing.JScrollPane jScrollPane1; |
310 | private javax.swing.JSplitPane jSplitPane1; |
339 | private javax.swing.JSplitPane jSplitPane1; |
311 | private javax.swing.JTable jTable1; |
340 | private javax.swing.JTable jTable1; |
- | 341 | private javax.swing.JButton propsButton; |
|
312 | private javax.swing.JButton removeButton; |
342 | private javax.swing.JButton removeButton; |
313 | private javax.swing.JButton resetButton; |
343 | private javax.swing.JButton resetButton; |
314 | private javax.swing.JButton startButton; |
344 | private javax.swing.JButton startButton; |
315 | private javax.swing.JButton stopButton; |
345 | private javax.swing.JButton stopButton; |
316 | // End of variables declaration//GEN-END:variables
|
346 | // End of variables declaration//GEN-END:variables
|