- Timestamp:
- 2016-12-07T23:47:56+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMergeModel.java
r11330 r11365 505 505 } 506 506 fireModelDataChanged(); 507 mergedEntriesSelectionModel.setValueIsAdjusting(true); 507 508 mergedEntriesSelectionModel.clearSelection(); 508 509 for (int row: rows) { 509 510 mergedEntriesSelectionModel.addSelectionInterval(row-1, row-1); 510 511 } 512 mergedEntriesSelectionModel.setValueIsAdjusting(false); 511 513 } 512 514 … … 531 533 } 532 534 fireModelDataChanged(); 535 mergedEntriesSelectionModel.setValueIsAdjusting(true); 533 536 mergedEntriesSelectionModel.clearSelection(); 534 537 for (int row: rows) { 535 538 mergedEntriesSelectionModel.addSelectionInterval(row+1, row+1); 536 539 } 540 mergedEntriesSelectionModel.setValueIsAdjusting(false); 537 541 } 538 542 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r11357 r11365 313 313 @Override 314 314 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 315 lstConflicts.setValueIsAdjusting(true); 315 316 lstConflicts.clearSelection(); 316 317 for (OsmPrimitive osm : newSelection) { … … 322 323 } 323 324 } 325 lstConflicts.setValueIsAdjusting(false); 324 326 } 325 327 -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r10824 r11365 841 841 } 842 842 fireTableDataChanged(); 843 selectionModel.setValueIsAdjusting(true); 843 844 selectionModel.clearSelection(); 844 845 for (int row : sel) { 845 846 selectionModel.addSelectionInterval(row-1, row-1); 846 847 } 848 selectionModel.setValueIsAdjusting(false); 847 849 ensureSelectedIsVisible(); 848 850 } … … 874 876 } 875 877 fireTableDataChanged(); 878 selectionModel.setValueIsAdjusting(true); 876 879 selectionModel.clearSelection(); 877 880 for (int row : sel) { 878 881 selectionModel.addSelectionInterval(row+1, row+1); 879 882 } 883 selectionModel.setValueIsAdjusting(false); 880 884 ensureSelectedIsVisible(); 881 885 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r10694 r11365 351 351 int[] pos = tblStyles.getSelectedRows(); 352 352 MapPaintStyles.toggleStyleActive(pos); 353 selectionModel.setValueIsAdjusting(true); 353 354 selectionModel.clearSelection(); 354 355 for (int p: pos) { 355 356 selectionModel.addSelectionInterval(p, p); 356 357 } 358 selectionModel.setValueIsAdjusting(false); 357 359 } 358 360 } … … 387 389 MapPaintStyles.moveStyles(sel, increment); 388 390 391 selectionModel.setValueIsAdjusting(true); 389 392 selectionModel.clearSelection(); 390 393 for (int row: sel) { 391 394 selectionModel.addSelectionInterval(row + increment, row + increment); 392 395 } 396 selectionModel.setValueIsAdjusting(false); 393 397 model.ensureSelectedIsVisible(); 394 398 } … … 434 438 MapPaintStyles.reloadStyles(rows); 435 439 Main.worker.submit(() -> SwingUtilities.invokeLater(() -> { 440 selectionModel.setValueIsAdjusting(true); 436 441 selectionModel.clearSelection(); 437 442 for (int r: rows) { 438 443 selectionModel.addSelectionInterval(r, r); 439 444 } 445 selectionModel.setValueIsAdjusting(false); 440 446 })); 441 447 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r11357 r11365 149 149 filter = setupFilter(); 150 150 151 displaylist.addListSelectionListener(e -> updateActionsRelationLists()); 151 displaylist.addListSelectionListener(e -> { 152 if (!e.getValueIsAdjusting()) updateActionsRelationLists(); 153 }); 152 154 153 155 // Setup popup menu handler … … 563 565 */ 564 566 public void setSelectedRelations(Collection<Relation> sel) { 567 selectionModel.setValueIsAdjusting(true); 565 568 selectionModel.clearSelection(); 566 if (sel == null || sel.isEmpty()) 567 return; 568 if (!getVisibleRelations().containsAll(sel)) { 569 resetFilter(); 570 } 571 for (Relation r: sel) { 572 Integer i = getVisibleRelationIndex(r); 573 if (i != null) { 574 selectionModel.addSelectionInterval(i, i); 575 } 576 } 569 if (sel != null && !sel.isEmpty()) { 570 if (!getVisibleRelations().containsAll(sel)) { 571 resetFilter(); 572 } 573 for (Relation r: sel) { 574 Integer i = getVisibleRelationIndex(r); 575 if (i != null) { 576 selectionModel.addSelectionInterval(i, i); 577 } 578 } 579 } 580 selectionModel.setValueIsAdjusting(false); 577 581 } 578 582 -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r11177 r11365 578 578 */ 579 579 public synchronized void setSelected(Collection<OsmPrimitive> sel) { 580 selectionModel.setValueIsAdjusting(true); 580 581 selectionModel.clearSelection(); 581 if (sel == null) return; 582 for (OsmPrimitive p: sel) { 583 int i = selection.indexOf(p); 584 if (i >= 0) { 585 selectionModel.addSelectionInterval(i, i); 586 } 587 } 582 if (sel != null) { 583 for (OsmPrimitive p: sel) { 584 int i = selection.indexOf(p); 585 if (i >= 0) { 586 selectionModel.addSelectionInterval(i, i); 587 } 588 } 589 } 590 selectionModel.setValueIsAdjusting(false); 588 591 } 589 592 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerModel.java
r10647 r11365 104 104 */ 105 105 public void setSelectedChangesets(Collection<Changeset> selected) { 106 GuiHelper.runInEDTAndWait(selectionModel::clearSelection); 107 if (selected == null || selected.isEmpty()) 108 return; 109 for (Changeset cs: selected) { 110 final int idx = data.indexOf(cs); 111 if (idx >= 0) { 112 GuiHelper.runInEDTAndWait(() -> selectionModel.addSelectionInterval(idx, idx)); 106 selectionModel.setValueIsAdjusting(true); 107 selectionModel.clearSelection(); 108 if (selected != null) { 109 for (Changeset cs: selected) { 110 final int idx = data.indexOf(cs); 111 if (idx >= 0) { 112 selectionModel.addSelectionInterval(idx, idx); 113 } 113 114 } 114 115 } 116 GuiHelper.runInEDTAndWait(() -> selectionModel.setValueIsAdjusting(false)); 115 117 } 116 118 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java
r10647 r11365 50 50 51 51 public void setSelectedChangesets(Collection<Changeset> changesets) { 52 selectionModel.setValueIsAdjusting(true); 52 53 selectionModel.clearSelection(); 53 if (changesets == null) return; 54 for (Changeset cs: changesets) { 55 int idx = data.indexOf(cs); 56 if (idx < 0) { 57 continue; 58 } 59 selectionModel.addSelectionInterval(idx, idx); 60 } 54 if (changesets != null) { 55 for (Changeset cs: changesets) { 56 int idx = data.indexOf(cs); 57 if (idx >= 0) { 58 selectionModel.addSelectionInterval(idx, idx); 59 } 60 } 61 } 62 selectionModel.setValueIsAdjusting(false); 61 63 } 62 64 -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java
r10755 r11365 192 192 } 193 193 ListSelectionModel s = table.getSelectionModel(); 194 s.setValueIsAdjusting(true); 194 195 s.clearSelection(); 195 196 for (int i = 0; i < layer.trackVisibility.length; i++) { … … 198 199 } 199 200 } 201 s.setValueIsAdjusting(false); 200 202 } 201 203 -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r10733 r11365 665 665 } 666 666 fireTableDataChanged(); 667 selectionModel.setValueIsAdjusting(true); 667 668 selectionModel.clearSelection(); 668 669 for (ExtendedSourceEntry info: sources) { … … 672 673 } 673 674 } 675 selectionModel.setValueIsAdjusting(false); 674 676 } 675 677 … … 699 701 data.set(row + i, t1); 700 702 } 703 selectionModel.setValueIsAdjusting(true); 701 704 selectionModel.clearSelection(); 702 705 for (int row: sel) { 703 706 selectionModel.addSelectionInterval(row + i, row + i); 704 707 } 708 selectionModel.setValueIsAdjusting(false); 705 709 } 706 710 }
Note:
See TracChangeset
for help on using the changeset viewer.