Changeset 1922 in josm for trunk/src/org
- Timestamp:
- 2009-08-07T22:33:37+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/relation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r1920 r1922 1457 1457 class SelectionSynchronizer implements ListSelectionListener, SelectionChangedListener{ 1458 1458 public void valueChanged(ListSelectionEvent e) { 1459 // as long as the model is computing the final selection it emits selection 1460 // change events with getValueIsAdjusting() true. Ignore these events, only 1461 // handle the final selection update. Otherwise, infinite loops of property 1462 // change events occur. 1463 // 1459 1464 if (e.getValueIsAdjusting()) 1460 1465 return; 1461 1466 1462 // Avoid endless loops. memberTableModel is registered as SelectionChangeListener 1463 // too. Only update the selection if it is not in sync with what is already 1464 // selected. 1467 // Avoid infinite loop. Only update the selection if it is not in sync with what 1468 // is already selected. Avoids infinite loops of property change events. 1465 1469 // 1466 1470 if (!memberTableModel.selectionsAreInSync()) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r1920 r1922 394 394 public boolean selectionsAreInSync() { 395 395 HashSet<OsmPrimitive> s1 = new HashSet<OsmPrimitive>(getSelectedReferers()); 396 if (s1.size() >layer.data.getSelected().size()) return false;396 if (s1.size() != layer.data.getSelected().size()) return false; 397 397 s1.removeAll(layer.data.getSelected()); 398 398 return s1.isEmpty(); … … 489 489 */ 490 490 public void selectMembersReferringTo(Collection<? extends OsmPrimitive> primitives) { 491 if (primitives == null || primitives.isEmpty()) return;491 if (primitives == null) return; 492 492 getSelectionModel().setValueIsAdjusting(true); 493 493 getSelectionModel().clearSelection();
Note:
See TracChangeset
for help on using the changeset viewer.