Changeset 4815 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-01-18T15:39:14+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r4809 r4815 194 194 System.err.println(tr("It supports protocol version 0.6, while the server says it supports {0} to {1}.", 195 195 capabilities.get("version", "minimum"), capabilities.get("version", "maximum"))); 196 initialized = false; // FIXME get 's overridden by next assignment196 initialized = false; // FIXME gets overridden by next assignment 197 197 } 198 198 initialized = true; -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r4814 r4815 22 22 public class OsmImporter extends FileImporter { 23 23 24 protected class OsmImporterData { 25 public OsmDataLayer layer; 26 public Runnable postLayerTask; 24 public static class OsmImporterData { 25 26 private OsmDataLayer layer; 27 private Runnable postLayerTask; 28 29 public OsmImporterData(OsmDataLayer layer, Runnable postLayerTask) { 30 this.layer = layer; 31 this.postLayerTask = postLayerTask; 32 } 33 34 public OsmDataLayer getLayer() { 35 return layer; 36 } 37 38 public Runnable getPostLayerTask() { 39 return postLayerTask; 40 } 27 41 } 28 42 … … 47 61 48 62 protected void importData(InputStream in, final File associatedFile) throws IllegalDataException { 49 final OsmImporterData data = loadLayer(in, associatedFile, 63 final OsmImporterData data = loadLayer(in, associatedFile, 50 64 associatedFile == null ? OsmDataLayer.createNewName() : associatedFile.getName(), NullProgressMonitor.INSTANCE); 51 65 … … 70 84 throw new IllegalDataException(tr("Invalid dataset")); 71 85 } 72 OsmImporterData data = new OsmImporterData(); 73 data.layer = createLayer(dataSet, associatedFile, layerName); 74 data.postLayerTask = createPostLayerTask(dataSet, associatedFile, layerName, data.layer); 75 return data; 86 OsmDataLayer layer = createLayer(dataSet, associatedFile, layerName); 87 Runnable postLayerTask = createPostLayerTask(dataSet, associatedFile, layerName, layer); 88 return new OsmImporterData(layer, postLayerTask); 76 89 } 77 90 78 91 protected DataSet parseDataSet(InputStream in, ProgressMonitor progressMonitor) throws IllegalDataException { 79 92 return OsmReader.parseDataSet(in, progressMonitor); 80 93 } 81 94 82 95 protected OsmDataLayer createLayer(final DataSet dataSet, final File associatedFile, final String layerName) { 83 96 return new OsmDataLayer(dataSet, layerName, associatedFile); 84 97 } 85 98 86 99 protected Runnable createPostLayerTask(final DataSet dataSet, final File associatedFile, final String layerName, final OsmDataLayer layer) { 87 100 return new Runnable() { -
trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionImporter.java
r4668 r4815 40 40 OsmImporter importer = new OsmImporter(); 41 41 InputStream in = support.getInputStream(fileStr); 42 importer.loadLayer(in, support.getFile(fileStr), support.getLayerName(), progressMonitor);42 OsmImporter.OsmImporterData importData = importer.loadLayer(in, support.getFile(fileStr), support.getLayerName(), progressMonitor); 43 43 44 support.addPostLayersTask(import er.getPostLayerTask());45 return import er.getLayer();44 support.addPostLayersTask(importData.getPostLayerTask()); 45 return importData.getLayer(); 46 46 47 47 } catch (XPathExpressionException e) {
Note:
See TracChangeset
for help on using the changeset viewer.