Changeset 9949 in osm for applications/editors/josm/plugins/waypoints/src
- Timestamp:
- 2008-08-18T16:47:03+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/waypoints/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waypoints/src/WaypointOpenAction.java
r1495 r9949 14 14 import javax.swing.JFileChooser; 15 15 import javax.swing.JOptionPane; 16 17 import javax.xml.parsers.ParserConfigurationException; 16 18 17 19 import org.openstreetmap.josm.Main; … … 36 38 37 39 public void actionPerformed(ActionEvent e) { 38 JFileChooser fc = createAndOpenFileChooser(true, true );40 JFileChooser fc = createAndOpenFileChooser(true, true, null); 39 41 if (fc == null) 40 42 return; … … 58 60 JOptionPane.showMessageDialog(Main.parent, 59 61 tr("Error while parsing {0}",fn)+": "+x.getMessage()); 62 } catch (ParserConfigurationException x) { 63 x.printStackTrace(); // broken SAXException chaining 64 JOptionPane.showMessageDialog(Main.parent, 65 tr("Error while parsing {0}",fn)+": "+x.getMessage()); 60 66 } catch (IOException x) { 61 67 x.printStackTrace(); -
applications/editors/josm/plugins/waypoints/src/WaypointReader.java
r1495 r9949 7 7 import java.io.InputStreamReader; 8 8 9 import javax.xml.parsers.SAXParserFactory; 10 import javax.xml.parsers.ParserConfigurationException; 11 9 12 import org.openstreetmap.josm.data.coor.LatLon; 10 13 import org.openstreetmap.josm.data.osm.DataSet; // NW … … 12 15 import org.xml.sax.Attributes; 13 16 import org.xml.sax.SAXException; 14 15 import uk.co.wilson.xml.MinML2; 16 17 import org.xml.sax.InputSource; 18 import org.xml.sax.helpers.DefaultHandler; 17 19 18 20 /** … … 21 23 public class WaypointReader { 22 24 23 private static class Parser extends MinML2{25 private static class Parser extends DefaultHandler { 24 26 /** 25 27 * Current track to be read. The last entry is the current trkpt. … … 99 101 */ 100 102 public static DataSet parse(InputStream source) 101 throws SAXException, IOException {103 throws SAXException, IOException, ParserConfigurationException { 102 104 Parser parser = new Parser(); 103 parser.parse(new InputStreamReader(source, "UTF-8"));105 SAXParserFactory.newInstance().newSAXParser().parse(new InputSource(new InputStreamReader(source, "UTF-8")), parser); 104 106 return parser.dataSet; 105 107 }
Note:
See TracChangeset
for help on using the changeset viewer.