Ignore:
Timestamp:
2009-06-06T22:25:31+02:00 (16 years ago)
Author:
stoecker
Message:

lots of updates due to josm changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisibleAction.java

    r13497 r15707  
    2929import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3030import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
     31import org.openstreetmap.josm.io.GpxImporter;
    3132import org.openstreetmap.josm.io.GpxReader;
     33import org.openstreetmap.josm.io.OsmImporter;
    3234import org.openstreetmap.josm.io.OsmReader;
    3335import org.openstreetmap.josm.tools.Shortcut;
     
    100102    private void openAsData(File file) throws SAXException, IOException, FileNotFoundException {
    101103        String fn = file.getName();
    102         if (ExtensionFileFilter.filters[ExtensionFileFilter.OSM].acceptName(fn)) {
     104        if (new OsmImporter().acceptFile(file)) {
    103105            DataSet dataSet = OsmReader.parseDataSet(new FileInputStream(file), null, Main.pleaseWaitDlg);
    104             OsmDataLayer layer = new OsmDataLayer(dataSet, file.getName(), file);
     106            OsmDataLayer layer = new OsmDataLayer(dataSet, fn, file);
    105107            Main.main.addLayer(layer);
    106108        }
    107109        else
    108             JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("Unknown file extension: {0}", fn.substring(file.getName().lastIndexOf('.')+1)));
     110            JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("Unknown file extension: {0}", fn.substring(fn.lastIndexOf('.')+1)));
    109111    }
    110112
    111113    private void openFileAsGpx(File file) throws SAXException, IOException, FileNotFoundException {
    112114        String fn = file.getName();
    113         if (ExtensionFileFilter.filters[ExtensionFileFilter.GPX].acceptName(fn)) {
     115        if (new GpxImporter().acceptFile(file)) {
    114116            GpxReader r = null;
    115117            if (file.getName().endsWith(".gpx.gz")) {
Note: See TracChangeset for help on using the changeset viewer.