Changeset 33850 in osm for applications/editors/josm/plugins/DirectDownload
- Timestamp:
- 2017-11-21T01:42:42+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/DirectDownload
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/DirectDownload
- Property svn:ignore
-
old new 2 2 checkstyle-josm-DirectDownload.xml 3 3 findbugs-josm-DirectDownload.xml 4 spotbugs-josm-DirectDownload.xml
-
- Property svn:ignore
-
applications/editors/josm/plugins/DirectDownload/build.xml
r32680 r33850 4 4 <property name="commit.message" value="Commit message"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 0580"/>6 <property name="plugin.main.version" value="12643"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DirectDownload.java
r32442 r33850 8 8 import org.openstreetmap.josm.actions.JosmAction; 9 9 import org.openstreetmap.josm.data.gpx.GpxData; 10 import org.openstreetmap.josm.gui.MainApplication; 10 11 import org.openstreetmap.josm.gui.MainMenu; 11 12 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 26 27 27 28 openaction = new DownloadAction(); 28 MainMenu.add(Main .main.menu.gpsMenu, openaction);29 MainMenu.add(MainApplication.getMenu().gpsMenu, openaction); 29 30 } 30 31 31 class DownloadAction extends JosmAction {32 static class DownloadAction extends JosmAction { 32 33 public DownloadAction() { 33 34 super(tr("Download Track ..."), "DownloadAction", … … 35 36 } 36 37 38 @Override 37 39 public void actionPerformed(ActionEvent event) { 38 40 DownloadDataGui go = new DownloadDataGui(); … … 52 54 53 55 if (data.hasRoutePoints() || data.hasTrackPoints()) { 54 Main .getLayerManager().addLayer(gpxLayer);56 MainApplication.getLayerManager().addLayer(gpxLayer); 55 57 } 56 58 … … 58 60 MarkerLayer ml = new MarkerLayer(data, tr("Markers from {0}", track.filename), null, gpxLayer); 59 61 if (ml.data.size() > 0) { 60 Main .getLayerManager().addLayer(ml);62 MainApplication.getLayerManager().addLayer(ml); 61 63 } 62 64 } -
applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DownloadDataGui.java
r32442 r33850 17 17 import javax.swing.ListSelectionModel; 18 18 import javax.swing.UIManager; 19 import javax.swing.event.ListSelectionEvent;20 import javax.swing.event.ListSelectionListener;21 19 import javax.swing.table.DefaultTableColumnModel; 22 20 import javax.swing.table.DefaultTableModel; … … 151 149 } 152 150 153 class ListSelectionHandler implements ListSelectionListener {154 @Override155 public void valueChanged(ListSelectionEvent lse) {156 }157 }158 159 151 static class NamedResultCellRenderer extends JLabel implements TableCellRenderer { 160 152 -
applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/GpxServerReader.java
r31934 r33850 8 8 import org.openstreetmap.josm.io.OsmTransferException; 9 9 import org.openstreetmap.josm.tools.HttpClient; 10 import org.openstreetmap.josm.tools.Logging; 10 11 import org.xml.sax.SAXException; 11 12 … … 36 37 } 37 38 } catch (IOException | OsmTransferException e) { 38 Main.warn(e);39 Logging.warn(e); 39 40 JOptionPane.showMessageDialog(Main.parent, tr("Error fetching URL {0}", urlString)); 40 41 return null; 41 42 } catch (SAXException e) { 42 Main.warn(e);43 Logging.warn(e); 43 44 JOptionPane.showMessageDialog(Main.parent, tr("Error parsing data from URL {0}", urlString)); 44 45 return null; 45 46 46 } 47 47 } 48 49 48 } -
applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/UserTrackReader.java
r31934 r33850 1 1 package org.openstreetmap.josm.plugins.directdownload; 2 2 3 import org.openstreetmap.josm.Main; 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 5 import java.io.IOException; 6 import java.io.InputStream; 7 import java.net.MalformedURLException; 8 import java.net.URL; 9 import java.util.LinkedList; 10 import java.util.List; 11 12 import javax.swing.JOptionPane; 13 import javax.xml.parsers.ParserConfigurationException; 14 import javax.xml.parsers.SAXParser; 15 import javax.xml.parsers.SAXParserFactory; 16 4 17 import org.openstreetmap.josm.io.OsmApi; 5 18 import org.openstreetmap.josm.io.OsmConnection; 6 19 import org.openstreetmap.josm.io.OsmTransferException; 7 20 import org.openstreetmap.josm.tools.HttpClient; 21 import org.openstreetmap.josm.tools.Logging; 8 22 import org.xml.sax.Attributes; 9 23 import org.xml.sax.SAXException; 10 24 import org.xml.sax.helpers.DefaultHandler; 11 12 import javax.swing.*;13 import javax.xml.parsers.ParserConfigurationException;14 import javax.xml.parsers.SAXParser;15 import javax.xml.parsers.SAXParserFactory;16 import java.io.InputStream;17 import java.net.URL;18 import java.util.LinkedList;19 import java.util.List;20 21 import static org.openstreetmap.josm.tools.I18n.tr;22 25 23 26 public class UserTrackReader extends OsmConnection { … … 42 45 43 46 return handler.getResult(); 44 } catch ( java.net.MalformedURLException e) {45 Main.error(e);47 } catch (MalformedURLException e) { 48 Logging.error(e); 46 49 JOptionPane.showMessageDialog(null, tr("Invalid URL {0}", urlString)); 47 } catch ( java.io.IOException | OsmTransferException e) {48 Main.error(e);50 } catch (IOException | OsmTransferException e) { 51 Logging.error(e); 49 52 JOptionPane.showMessageDialog(null, tr("Error fetching URL {0}", urlString)); 50 53 } catch (SAXException | ParserConfigurationException e) { 51 Main.error(e);54 Logging.error(e); 52 55 JOptionPane.showMessageDialog(null, tr("Error parsing data from URL {0}", urlString)); 53 56 }
Note:
See TracChangeset
for help on using the changeset viewer.