Revision 24306 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/VectorialUniqueValue.java
VectorialUniqueValue.java | ||
---|---|---|
409 | 409 |
} |
410 | 410 |
|
411 | 411 |
|
412 |
private JPanel getPnlMovBut() { |
|
413 |
if(pnlMovBut == null){ |
|
414 |
pnlMovBut = new JPanel(); |
|
415 |
pnlMovBut.setLayout(new BoxLayout(pnlMovBut, BoxLayout.Y_AXIS)); |
|
416 |
pnlMovBut.add(new JBlank(1, 70)); |
|
417 |
pnlMovBut.add(moveUp = new JButton(PluginServices.getIconTheme().get("up-arrow"))); |
|
418 |
moveUp.setSize(new Dimension(15,15)); |
|
419 |
pnlMovBut.add(new JBlank(1,10)); |
|
420 |
pnlMovBut.add(moveDown = new JButton(PluginServices.getIconTheme().get("down-arrow"))); |
|
421 |
pnlMovBut.add(new JBlank(1, 70)); |
|
422 |
moveDown.setActionCommand("MOVE-DOWN"); |
|
423 |
moveUp.setActionCommand("MOVE-UP"); |
|
424 |
moveDown.addActionListener(this); |
|
425 |
moveUp.addActionListener(this); |
|
426 |
} |
|
427 |
return pnlMovBut; |
|
428 |
} |
|
412 |
// private JPanel getPnlMovBut() {
|
|
413 |
// if(pnlMovBut == null){
|
|
414 |
// pnlMovBut = new JPanel();
|
|
415 |
// pnlMovBut.setLayout(new BoxLayout(pnlMovBut, BoxLayout.Y_AXIS));
|
|
416 |
// pnlMovBut.add(new JBlank(1, 70));
|
|
417 |
// pnlMovBut.add(moveUp = new JButton(PluginServices.getIconTheme().get("up-arrow")));
|
|
418 |
// moveUp.setSize(new Dimension(15,15));
|
|
419 |
// pnlMovBut.add(new JBlank(1,10));
|
|
420 |
// pnlMovBut.add(moveDown = new JButton(PluginServices.getIconTheme().get("down-arrow")));
|
|
421 |
// pnlMovBut.add(new JBlank(1, 70));
|
|
422 |
// moveDown.setActionCommand("MOVE-DOWN");
|
|
423 |
// moveUp.setActionCommand("MOVE-UP");
|
|
424 |
// moveDown.addActionListener(this);
|
|
425 |
// moveUp.addActionListener(this);
|
|
426 |
// }
|
|
427 |
// return pnlMovBut;
|
|
428 |
// }
|
|
429 | 429 |
|
430 | 430 |
private void setColorScheme(){ |
431 | 431 |
|
... | ... | |
495 | 495 |
public void actionPerformed(ActionEvent e) { |
496 | 496 |
|
497 | 497 |
|
498 |
if(e.getActionCommand() == "MOVE-UP"){ |
|
499 |
int[] indices = symbolTable.getTable().getSelectedRows(); |
|
500 |
if (indices.length>0) { |
|
501 |
int classIndex = indices[0]; |
|
502 |
int targetPos = Math.max(0, classIndex-1); |
|
503 |
symbolTable.swapClass(classIndex, targetPos,indices.length); |
|
504 |
} |
|
505 |
} |
|
498 |
// if(e.getActionCommand() == "MOVE-UP"){ |
|
499 |
// int[] indices = symbolTable.getTable().getSelectedRows(); |
|
500 |
// if (indices.length>0) { |
|
501 |
// int classIndex = indices[0]; |
|
502 |
// int targetPos = Math.max(0, classIndex-1); |
|
503 |
// symbolTable.swapClass(classIndex, targetPos,indices.length); |
|
504 |
// } |
|
505 |
// } |
|
506 |
// |
|
507 |
// if(e.getActionCommand() == "MOVE-DOWN"){ |
|
508 |
// int[] indices = symbolTable.getTable().getSelectedRows(); |
|
509 |
// if (indices.length>0) { |
|
510 |
// int classIndex = indices[indices.length-1]; |
|
511 |
// int targetPos = Math.min(symbolTable.getRowCount()-1, classIndex+1); |
|
512 |
// symbolTable.swapClass(classIndex, targetPos,indices.length); |
|
513 |
// } |
|
514 |
// } |
|
506 | 515 |
|
507 |
if(e.getActionCommand() == "MOVE-DOWN"){ |
|
508 |
int[] indices = symbolTable.getTable().getSelectedRows(); |
|
509 |
if (indices.length>0) { |
|
510 |
int classIndex = indices[indices.length-1]; |
|
511 |
int targetPos = Math.min(symbolTable.getRowCount()-1, classIndex+1); |
|
512 |
symbolTable.swapClass(classIndex, targetPos,indices.length); |
|
513 |
} |
|
514 |
} |
|
515 |
|
|
516 | 516 |
//modificar el combobox de valor |
517 | 517 |
if (e.getActionCommand() == "FIELD_SELECTED") { |
518 | 518 |
JComboBox cb = (JComboBox) e.getSource(); |
Also available in: Unified diff