Ignore:
Timestamp:
2016-12-07T23:47:56+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #14090 - use DefaultListSelectionModel adjusting selection mode to avoid too much costly listener calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r11177 r11365  
    578578         */
    579579        public synchronized void setSelected(Collection<OsmPrimitive> sel) {
     580            selectionModel.setValueIsAdjusting(true);
    580581            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);
    588591        }
    589592
Note: See TracChangeset for help on using the changeset viewer.