Changeset 15707 in osm for applications/editors/josm/plugins/openvisible/src
- Timestamp:
- 2009-06-06T22:25:31+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisibleAction.java
r13497 r15707 29 29 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 30 30 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 31 import org.openstreetmap.josm.io.GpxImporter; 31 32 import org.openstreetmap.josm.io.GpxReader; 33 import org.openstreetmap.josm.io.OsmImporter; 32 34 import org.openstreetmap.josm.io.OsmReader; 33 35 import org.openstreetmap.josm.tools.Shortcut; … … 100 102 private void openAsData(File file) throws SAXException, IOException, FileNotFoundException { 101 103 String fn = file.getName(); 102 if ( ExtensionFileFilter.filters[ExtensionFileFilter.OSM].acceptName(fn)) {104 if (new OsmImporter().acceptFile(file)) { 103 105 DataSet dataSet = OsmReader.parseDataSet(new FileInputStream(file), null, Main.pleaseWaitDlg); 104 OsmDataLayer layer = new OsmDataLayer(dataSet, f ile.getName(), file);106 OsmDataLayer layer = new OsmDataLayer(dataSet, fn, file); 105 107 Main.main.addLayer(layer); 106 108 } 107 109 else 108 JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("Unknown file extension: {0}", fn.substring(f ile.getName().lastIndexOf('.')+1)));110 JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("Unknown file extension: {0}", fn.substring(fn.lastIndexOf('.')+1))); 109 111 } 110 112 111 113 private void openFileAsGpx(File file) throws SAXException, IOException, FileNotFoundException { 112 114 String fn = file.getName(); 113 if ( ExtensionFileFilter.filters[ExtensionFileFilter.GPX].acceptName(fn)) {115 if (new GpxImporter().acceptFile(file)) { 114 116 GpxReader r = null; 115 117 if (file.getName().endsWith(".gpx.gz")) {
Note:
See TracChangeset
for help on using the changeset viewer.