- Timestamp:
- 2021-09-27T21:45:27+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/DuplicateAction.java
r13654 r18233 8 8 import javax.swing.AbstractAction; 9 9 10 import org.openstreetmap.josm.data.osm.DataSet;11 10 import org.openstreetmap.josm.gui.MainApplication; 12 11 import org.openstreetmap.josm.gui.dialogs.IEnabledStateUpdating; … … 54 53 if (layer instanceof OsmDataLayer) { 55 54 String newName = LayerListTransferHandler.suggestNewLayerName(layer.getName(), MainApplication.getLayerManager().getLayers()); 56 OsmDataLayer oldLayer = (OsmDataLayer) layer; 57 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(oldLayer.getDataSet()), newName, null)); 55 MainApplication.getLayerManager().addLayer(((OsmDataLayer) layer).duplicate(newName)); 58 56 } 59 57 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r18208 r18233 1355 1355 return true; 1356 1356 } 1357 1358 /** 1359 * Duplicates this layer with a new name and a copy of this layer dataset. 1360 * @param newName name of new layer 1361 * @return A copy of this layer 1362 * @since 18233 1363 */ 1364 public OsmDataLayer duplicate(String newName) { 1365 return new OsmDataLayer(new DataSet(getDataSet()), newName, null); 1366 } 1357 1367 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelationSupportLayer.java
r18078 r18233 41 41 data.setUploadPolicy(UploadPolicy.BLOCKED); 42 42 rebuildGpxData(); 43 } 44 45 @Override 46 public GpxData toGpxData() { 47 GpxData gpxData = new GpxData(); 48 fillGpxData(gpxData, data, getAssociatedFile(), CORRELATION_PREFIX); 49 return gpxData; 50 } 51 52 @Override 53 public CorrelationSupportLayer duplicate(String newName) { 54 return new CorrelationSupportLayer(gpxData, newName); 43 55 } 44 56
Note:
See TracChangeset
for help on using the changeset viewer.