Ignore:
Timestamp:
2005-10-04T00:09:32+02:00 (21 years ago)
Author:
imi
Message:
  • added support for DataReaders
  • added a nice status line and a tooltip when holding middle mouse button
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/actions/OpenGpxAction.java

    r7 r9  
    1313import javax.swing.filechooser.FileFilter;
    1414
    15 import org.jdom.JDOMException;
    1615import org.openstreetmap.josm.data.osm.DataSet;
    1716import org.openstreetmap.josm.gui.Main;
    1817import org.openstreetmap.josm.gui.MapFrame;
    1918import org.openstreetmap.josm.io.GpxReader;
     19import org.openstreetmap.josm.io.DataReader.ConnectionException;
     20import org.openstreetmap.josm.io.DataReader.ParseException;
    2021
    2122/**
     
    5354               
    5455                try {
    55                         DataSet dataSet = new GpxReader().parse(new FileReader(gpxFile));
     56                        DataSet dataSet = new GpxReader(new FileReader(gpxFile)).parse();
    5657                        MapFrame map = new MapFrame(dataSet);
    5758                        Main.main.setMapFrame(gpxFile.getName(), map);
    58                 } catch (JDOMException x) {
     59                } catch (ParseException x) {
    5960                        x.printStackTrace();
    60                         JOptionPane.showMessageDialog(Main.main, "Illegal GPX document:\n"+x.getMessage());
     61                        JOptionPane.showMessageDialog(Main.main, x.getMessage());
    6162                } catch (IOException x) {
    6263                        x.printStackTrace();
    63                         JOptionPane.showMessageDialog(Main.main, "Could not read '"+gpxFile.getName()+"':\n"+x.getMessage());
     64                        JOptionPane.showMessageDialog(Main.main, "Could not read '"+gpxFile.getName()+"'\n"+x.getMessage());
     65                } catch (ConnectionException x) {
     66                        x.printStackTrace();
     67                        JOptionPane.showMessageDialog(Main.main, x.getMessage());
    6468                }
    6569        }
Note: See TracChangeset for help on using the changeset viewer.