Changeset 3458 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2010-08-23T15:05:06+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r3457 r3458 431 431 */ 432 432 public void setSelected(Collection<? extends PrimitiveId> selection, boolean fireSelectionChangeEvent) { 433 boolean wasEmpty;433 boolean changed; 434 434 synchronized (selectionLock) { 435 wasEmpty = selectedPrimitives.isEmpty();435 boolean wasEmpty = selectedPrimitives.isEmpty(); 436 436 selectedPrimitives = new LinkedHashSet<OsmPrimitive>(); 437 addSelected(selection, fireSelectionChangeEvent); 438 if (!wasEmpty && selectedPrimitives.isEmpty()) { 437 changed = addSelected(selection, false) 438 || (!wasEmpty && selectedPrimitives.isEmpty()); 439 if (changed) { 439 440 selectionSnapshot = null; 440 441 } 441 442 } 442 443 443 if ( !wasEmpty && selectedPrimitives.isEmpty()&& fireSelectionChangeEvent) {444 if (changed && fireSelectionChangeEvent) { 444 445 // If selection is not empty then event was already fired in addSelecteds 445 446 fireSelectionChanged(); … … 486 487 * @param selection the selection 487 488 * @param fireSelectionChangeEvent true, if the selection change listeners are to be notified; false, otherwise 488 */ 489 public void addSelected(Collection<? extends PrimitiveId> selection, boolean fireSelectionChangeEvent) { 489 * @return if the selection was changed in the process 490 */ 491 private boolean addSelected(Collection<? extends PrimitiveId> selection, boolean fireSelectionChangeEvent) { 490 492 boolean changed = false; 491 493 synchronized (selectionLock) { … … 503 505 fireSelectionChanged(); 504 506 } 507 return changed; 505 508 } 506 509
Note:
See TracChangeset
for help on using the changeset viewer.