Changeset 3662 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-11-20T15:32:33+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r3661 r3662 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.dialogs; 2 3 … … 35 36 import javax.swing.ListSelectionModel; 36 37 import javax.swing.UIManager; 37 import javax.swing.event.ListDataEvent;38 38 import javax.swing.event.ListSelectionEvent; 39 39 import javax.swing.event.ListSelectionListener; … … 203 203 model.addLayerListModelListener( 204 204 new LayerListModelListener() { 205 @Override 205 206 public void makeVisible(int row, Layer layer) { 206 207 System.err.println(Thread.currentThread()); … … 208 209 layerList.repaint(); 209 210 } 211 @Override 210 212 public void refresh() { 211 213 layerList.repaint(); … … 249 251 listSelectionModel.addListSelectionListener( 250 252 new ListSelectionListener() { 253 @Override 251 254 public void valueChanged(ListSelectionEvent e) { 252 255 listener.updateEnabledState(); … … 324 327 } 325 328 329 @Override 326 330 public void actionPerformed(ActionEvent e) { 327 331 List<Layer> selectedLayers = getModel().getSelectedLayers(); … … 335 339 } 336 340 341 @Override 337 342 public void updateEnabledState() { 338 343 setEnabled(! getModel().getSelectedLayers().isEmpty()); … … 390 395 } 391 396 397 @Override 392 398 public void actionPerformed(ActionEvent e) { 393 399 if (layer != null) { 394 400 layer.toggleVisible(); 395 401 } else { 396 for(Layer layer: model.getSelectedLayers()) { 397 layer.toggleVisible(); 398 } 399 } 400 } 401 402 for(Layer l : model.getSelectedLayers()) { 403 l.toggleVisible(); 404 } 405 } 406 } 407 408 @Override 402 409 public void updateEnabledState() { 403 410 if (layer == null) { … … 451 458 } 452 459 460 @Override 453 461 public void actionPerformed(ActionEvent e) { 454 462 Layer toActivate; … … 470 478 } 471 479 480 @Override 472 481 public void updateEnabledState() { 473 482 if (layer == null) { … … 483 492 } 484 493 494 @Override 485 495 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 486 496 updateEnabledState(); 487 497 } 498 @Override 488 499 public void layerAdded(Layer newLayer) { 489 500 updateEnabledState(); 490 501 } 502 @Override 491 503 public void layerRemoved(Layer oldLayer) { 492 504 updateEnabledState(); … … 515 527 } 516 528 529 @Override 517 530 public void actionPerformed(ActionEvent e) { 518 531 if (layer != null) { … … 530 543 } 531 544 545 @Override 532 546 public void updateEnabledState() { 533 547 if (layer == null) { … … 567 581 } 568 582 583 @Override 569 584 public void actionPerformed(ActionEvent e) { 570 585 if (layer != null) { … … 582 597 } 583 598 599 @Override 584 600 public void updateEnabledState() { 585 601 if (layer == null) { … … 715 731 } 716 732 733 @Override 717 734 public void updateEnabledState() { 718 735 setEnabled(model.canMoveUp()); 719 736 } 720 737 738 @Override 721 739 public void actionPerformed(ActionEvent e) { 722 740 model.moveUp(); … … 734 752 } 735 753 754 @Override 736 755 public void updateEnabledState() { 737 756 setEnabled(model.canMoveDown()); 738 757 } 739 758 759 @Override 740 760 public void actionPerformed(ActionEvent e) { 741 761 model.moveDown(); … … 965 985 if (!canMoveUp()) return; 966 986 List<Integer> sel = getSelectedRows(); 967 for (int row : sel) {987 for (int row : sel) { 968 988 Layer l1 = getLayers().get(row); 969 989 Layer l2 = getLayers().get(row-1); … … 973 993 fireTableDataChanged(); 974 994 selectionModel.clearSelection(); 975 for (int row: sel) {995 for (int row : sel) { 976 996 selectionModel.addSelectionInterval(row-1, row-1); 977 997 } … … 999 1019 List<Integer> sel = getSelectedRows(); 1000 1020 Collections.reverse(sel); 1001 for (int row : sel) {1021 for (int row : sel) { 1002 1022 Layer l1 = getLayers().get(row); 1003 1023 Layer l2 = getLayers().get(row+1); … … 1007 1027 fireTableDataChanged(); 1008 1028 selectionModel.clearSelection(); 1009 for (int row: sel) {1029 for (int row : sel) { 1010 1030 selectionModel.addSelectionInterval(row+1, row+1); 1011 1031 } … … 1020 1040 protected void ensureSelectedIsVisible() { 1021 1041 int index = selectionModel.getMinSelectionIndex(); 1022 if (index < 0 )return;1042 if (index < 0) return; 1023 1043 if (index >= getLayers().size()) return; 1024 1044 Layer layer = getLayers().get(index); … … 1038 1058 if (source == null) 1039 1059 return targets; 1040 for (Layer target: getLayers()) {1060 for (Layer target : getLayers()) { 1041 1061 if (source == target) { 1042 1062 continue; … … 1119 1139 } 1120 1140 1141 @Override 1121 1142 public boolean isCellEditable(int row, int col) { 1122 1143 if (col == 0 && getActiveLayer() == getLayers().get(row)) … … 1125 1146 } 1126 1147 1148 @Override 1127 1149 public void setValueAt(Object value, int row, int col) { 1128 1150 Layer l = getLayers().get(row); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r3411 r3662 3 3 // Parts of code from Geotagged plugin (by Rob Neild) 4 4 // and the core JOSM source code (by Immanuel Scholz and others) 5 6 5 package org.openstreetmap.josm.gui.layer.geoimage; 7 6 … … 206 205 207 206 protected String formatErrorMessages() { 208 StringBu ffer sb = new StringBuffer();207 StringBuilder sb = new StringBuilder(); 209 208 sb.append("<html>"); 210 209 if (errorMessages.size() == 1) {
Note:
See TracChangeset
for help on using the changeset viewer.