Changeset 11033 in josm for trunk/src/org
- Timestamp:
- 2016-09-20T12:28:48+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r10972 r11033 31 31 import java.util.Set; 32 32 import java.util.concurrent.CopyOnWriteArrayList; 33 import java.util.concurrent.atomic.AtomicInteger; 33 34 import java.util.regex.Pattern; 34 35 … … 98 99 import org.openstreetmap.josm.gui.widgets.JosmTextArea; 99 100 import org.openstreetmap.josm.io.OsmImporter; 101 import org.openstreetmap.josm.tools.AlphanumComparator; 100 102 import org.openstreetmap.josm.tools.CheckParameterUtil; 101 103 import org.openstreetmap.josm.tools.GBC; … … 198 200 199 201 /** the global counter for created data layers */ 200 private static int dataLayerCounter;202 private static final AtomicInteger dataLayerCounter = new AtomicInteger(); 201 203 202 204 /** … … 206 208 */ 207 209 public static String createNewName() { 208 dataLayerCounter++; 209 return tr("Data Layer {0}", dataLayerCounter); 210 return createLayerName(dataLayerCounter.incrementAndGet()); 211 } 212 213 static String createLayerName(Object arg) { 214 return tr("Data Layer {0}", arg); 210 215 } 211 216 … … 352 357 data.addDataSetListener(MultipolygonCache.getInstance()); 353 358 DataSet.addSelectionListener(this); 359 if (name != null && name.startsWith(createLayerName(""))) { 360 while (AlphanumComparator.getInstance().compare(createLayerName(dataLayerCounter), name) < 0) { 361 dataLayerCounter.incrementAndGet(); 362 } 363 } 354 364 } 355 365
Note:
See TracChangeset
for help on using the changeset viewer.