Changeset 14556 in josm for trunk/src/org
- Timestamp:
- 2018-12-12T15:59:43+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r14247 r14556 1036 1036 @Override 1037 1037 public void clear() { 1038 //TODO: Why can't we clear a dataset that is locked? 1039 //TODO: Report listeners that are still active (should be none) 1038 1040 checkModifiable(); 1039 1041 beginUpdate(); -
trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java
r12630 r14556 12 12 import java.util.function.Consumer; 13 13 14 import org.openstreetmap.josm.data.osm.DataSet; 14 15 import org.openstreetmap.josm.gui.MainApplication; 15 16 import org.openstreetmap.josm.gui.util.GuiHelper; … … 478 479 } 479 480 } 481 if (layer instanceof OsmDataLayer) { 482 DataSet data = ((OsmDataLayer)layer).data; 483 if (data != null && !data.isLocked()) 484 data.clear(); 485 } 480 486 return e.scheduleForRemoval; 481 487 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r14537 r14556 359 359 */ 360 360 public final DataSet data; 361 private DataSetListenerAdapter dataSetListenerAdapter; 361 362 362 363 /** … … 412 413 this.data = data; 413 414 this.data.setName(name); 415 this.dataSetListenerAdapter = new DataSetListenerAdapter(this); 414 416 this.setAssociatedFile(associatedFile); 415 data.addDataSetListener( new DataSetListenerAdapter(this));417 data.addDataSetListener(dataSetListenerAdapter); 416 418 data.addDataSetListener(MultipolygonCache.getInstance()); 417 419 data.addHighlightUpdateListener(this); … … 1059 1061 data.removeSelectionListener(this); 1060 1062 data.removeHighlightUpdateListener(this); 1063 data.removeDataSetListener(dataSetListenerAdapter); 1064 data.removeDataSetListener(MultipolygonCache.getInstance()); 1061 1065 removeClipboardDataFor(this); 1062 if (!data.isLocked()) { 1063 data.clear(); 1064 } 1066 recentRelations.clear(); 1065 1067 } 1066 1068
Note:
See TracChangeset
for help on using the changeset viewer.