Revision 8401 trunk/extensions/extGraph_predes/src/com/iver/cit/gvsig/graph/gui/RouteControlPanel.java
RouteControlPanel.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.2 2006-10-26 16:31:21 jaume
|
|
46 |
* Revision 1.3 2006-10-27 12:41:09 jaume
|
|
47 | 47 |
* GUI |
48 | 48 |
* |
49 |
* Revision 1.2 2006/10/26 16:31:21 jaume |
|
50 |
* GUI |
|
51 |
* |
|
49 | 52 |
* Revision 1.1 2006/10/25 10:50:41 jaume |
50 | 53 |
* movement of classes and gui stuff |
51 | 54 |
* |
... | ... | |
71 | 74 |
import java.awt.Dimension; |
72 | 75 |
import java.awt.FlowLayout; |
73 | 76 |
import java.awt.Font; |
77 |
import java.awt.GridLayout; |
|
74 | 78 |
import java.awt.event.ActionEvent; |
75 | 79 |
import java.awt.event.ActionListener; |
76 | 80 |
import java.util.ArrayList; |
... | ... | |
122 | 126 |
PluginServices.getText(this, "stage"), |
123 | 127 |
PluginServices.getText(this, "cost"), |
124 | 128 |
}; |
129 |
private JButton btnGenerateRoute; |
|
130 |
private JButton btnSaveRoute; |
|
125 | 131 |
/** |
126 | 132 |
* This method initializes |
127 | 133 |
* |
... | ... | |
181 | 187 |
|
182 | 188 |
public WindowInfo getWindowInfo() { |
183 | 189 |
if (wi==null) { |
184 |
wi = new WindowInfo(WindowInfo.RESIZABLE);
|
|
190 |
wi = new WindowInfo(WindowInfo.PALETTE);
|
|
185 | 191 |
wi.setWidth(450); |
186 | 192 |
wi.setHeight(320); |
187 | 193 |
wi.setTitle(PluginServices.getText(this, "create_network") + "..."); |
... | ... | |
211 | 217 |
private JButton getBtnPullDownStage() { |
212 | 218 |
if (btnPullDownStage == null) { |
213 | 219 |
btnPullDownStage = new JButton(new ImageIcon(this.getClass().getClassLoader().getResource("images/down-arrow.png"))); |
214 |
btnPullDownStage.setName("btnPullDownStage"); |
|
220 |
// btnPullDownStage.setName("btnPullDownStage");
|
|
215 | 221 |
btnPullDownStage.addActionListener(this); |
216 | 222 |
} |
217 | 223 |
return btnPullDownStage; |
... | ... | |
220 | 226 |
private JButton getBtnPushUpStage() { |
221 | 227 |
if (btnPushUpStage == null) { |
222 | 228 |
btnPushUpStage = new JButton(new ImageIcon(this.getClass().getClassLoader().getResource("images/up-arrow.png"))); |
223 |
btnPushUpStage.setName("btnPushUpStage"); |
|
229 |
// btnPushUpStage.setName("btnPushUpStage");
|
|
224 | 230 |
btnPushUpStage.addActionListener(this); |
225 | 231 |
} |
226 | 232 |
return btnPushUpStage; |
... | ... | |
229 | 235 |
private JButton getBtnRemoveStage() { |
230 | 236 |
if (btnRemoveStage == null) { |
231 | 237 |
btnRemoveStage = new JButton(new ImageIcon(this.getClass().getClassLoader().getResource("images/delete.png"))); |
232 |
btnRemoveStage.setName("btnRemoveStage"); |
|
238 |
// btnRemoveStage.setName("btnRemoveStage");
|
|
233 | 239 |
btnRemoveStage.addActionListener(this); |
234 | 240 |
} |
235 | 241 |
return btnRemoveStage; |
... | ... | |
244 | 250 |
if (scrlStages == null) { |
245 | 251 |
scrlStages = new JScrollPane(); |
246 | 252 |
scrlStages.setViewportView(getTblStages()); |
247 |
scrlStages.setPreferredSize(new Dimension(300, 200));
|
|
253 |
scrlStages.setPreferredSize(new Dimension(270, 200));
|
|
248 | 254 |
} |
249 | 255 |
return scrlStages; |
250 | 256 |
} |
... | ... | |
409 | 415 |
*/ |
410 | 416 |
private JPanel getEastPanel() { |
411 | 417 |
if (eastPanel == null) { |
418 |
GridLayout layout = new GridLayout(); |
|
419 |
layout.setColumns(1); |
|
420 |
layout.setVgap(5); |
|
421 |
JPanel aux = new JPanel(); |
|
422 |
aux.add(getBtnLoadStage()); |
|
423 |
aux.add(getBtnSaveStage()); |
|
424 |
aux.add(getBtnSaveRoute()); |
|
425 |
aux.add(getBtnGenerateReport()); |
|
426 |
layout.setRows(aux.getComponentCount()); |
|
427 |
aux.setLayout(layout); |
|
412 | 428 |
eastPanel = new GridBagLayoutPanel(); |
413 |
eastPanel.addComponent(getBtnLoadStage()); |
|
414 |
eastPanel.add(getBtnSaveStage()); |
|
429 |
eastPanel.addComponent(aux); |
|
415 | 430 |
} |
416 | 431 |
return eastPanel; |
417 | 432 |
} |
418 | 433 |
|
419 |
/** |
|
434 |
private JButton getBtnGenerateReport() { |
|
435 |
if (btnGenerateRoute == null) { |
|
436 |
btnGenerateRoute = new JButton(); |
|
437 |
btnGenerateRoute.setText(PluginServices.getText(this, "generate_report")); |
|
438 |
btnGenerateRoute.addActionListener(this); |
|
439 |
} |
|
440 |
return btnGenerateRoute; |
|
441 |
} |
|
442 |
|
|
443 |
private JButton getBtnSaveRoute() { |
|
444 |
if (btnSaveRoute == null) { |
|
445 |
btnSaveRoute = new JButton(); |
|
446 |
btnSaveRoute.setText(PluginServices.getText(this, "save_route")); |
|
447 |
btnSaveRoute.addActionListener(this); |
|
448 |
} |
|
449 |
return btnSaveRoute; |
|
450 |
} |
|
451 |
|
|
452 |
/** |
|
420 | 453 |
* This method initializes defaultTableModel |
421 | 454 |
* |
422 | 455 |
* @return javax.swing.table.DefaultTableModel |
... | ... | |
500 | 533 |
} |
501 | 534 |
|
502 | 535 |
public void actionPerformed(ActionEvent e) { |
503 |
String name = ((Component) e.getSource()).getName();
|
|
504 |
if (name.equals(getBtnLoadStage().getName())) {
|
|
536 |
Component c = (Component) e.getSource();
|
|
537 |
if (c.equals(getBtnLoadStage())) {
|
|
505 | 538 |
// load |
506 | 539 |
|
507 |
} else if (name.equals(getBtnSaveStage().getName())) {
|
|
540 |
} else if (c.equals(getBtnSaveStage())) {
|
|
508 | 541 |
// save |
509 | 542 |
|
510 |
} else if (name.equals(getBtnPushUpStage().getName())) {
|
|
543 |
} else if (c.equals(getBtnPushUpStage())) {
|
|
511 | 544 |
// push up |
512 | 545 |
int[] selected = tblStages.getSelectedRows(); |
513 | 546 |
if (selected.length == 0 || selected[0] == 0) |
... | ... | |
523 | 556 |
tblStages.addRowSelectionInterval(selected[i], selected[i]); |
524 | 557 |
} |
525 | 558 |
|
526 |
} else if (name.equals(getBtnPullDownStage().getName())) {
|
|
559 |
} else if (c.equals(getBtnPullDownStage())) {
|
|
527 | 560 |
// pull down |
528 | 561 |
int[] selected = tblStages.getSelectedRows(); |
529 | 562 |
if (selected.length == 0 || selected[selected.length-1] >= _getFlags().size()-1) |
... | ... | |
540 | 573 |
} |
541 | 574 |
|
542 | 575 |
|
543 |
} else if (name.equals(getBtnRemoveStage().getName())) {
|
|
576 |
} else if (c.equals(getBtnRemoveStage())) {
|
|
544 | 577 |
// remove |
545 | 578 |
int[] selected = tblStages.getSelectedRows(); |
546 | 579 |
for (int i = selected.length-1; i >=0 ; i--) { |
Also available in: Unified diff