Changeset 4686 in josm
- Timestamp:
- 2011-12-21T20:17:44+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r4668 r4686 45 45 46 46 protected void importData(InputStream in, final File associatedFile) throws IllegalDataException { 47 loadLayer(in, associatedFile, associatedFile .getName(), NullProgressMonitor.INSTANCE);47 loadLayer(in, associatedFile, associatedFile == null ? OsmDataLayer.createNewName() : associatedFile.getName(), NullProgressMonitor.INSTANCE); 48 48 // FIXME: remove UI stuff from IO subsystem 49 49 Runnable uiStuff = new Runnable() { … … 68 68 public void loadLayer(InputStream in, final File associatedFile, final String layerName, ProgressMonitor progressMonitor) throws IllegalDataException { 69 69 final DataSet dataSet = OsmReader.parseDataSet(in, progressMonitor); 70 String name = associatedFile == null ? OsmDataLayer.createNewName() : associatedFile.getName(); 71 layer = new OsmDataLayer(dataSet, layerName, associatedFile); 72 postLayerTask = new Runnable() { 70 layer = createLayer(dataSet, associatedFile, layerName); 71 postLayerTask = createPostLayerTask(dataSet, associatedFile, layerName); 72 } 73 74 protected OsmDataLayer createLayer(final DataSet dataSet, final File associatedFile, final String layerName) { 75 return new OsmDataLayer(dataSet, layerName, associatedFile); 76 } 77 78 protected Runnable createPostLayerTask(final DataSet dataSet, final File associatedFile, final String layerName) { 79 return new Runnable() { 73 80 @Override 74 81 public void run() {
Note:
See TracChangeset
for help on using the changeset viewer.