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

lots of updates due to josm changes

Location:
applications/editors/josm/plugins/openvisible
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/openvisible/build.xml

    r14015 r15707  
    2626                <attribute name="Plugin-Dependencies" value="jgrapht-jdk1.5"/>
    2727                <attribute name="Plugin-Description" value="Allows opening gpx/osm files that intersect the currently visible screen area"/>
    28                 <attribute name="Plugin-Mainversion" value="1465"/>
     28                <attribute name="Plugin-Mainversion" value="1646"/>
    2929                <attribute name="Plugin-Stage" value="50"/>
    3030                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
  • 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.