Ignore:
Timestamp:
2017-11-21T01:42:42+01:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12643

Location:
applications/editors/josm/plugins/DirectDownload
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/DirectDownload

    • Property svn:ignore
      •  

        old new  
        22checkstyle-josm-DirectDownload.xml
        33findbugs-josm-DirectDownload.xml
         4spotbugs-josm-DirectDownload.xml
  • applications/editors/josm/plugins/DirectDownload/build.xml

    r32680 r33850  
    44    <property name="commit.message" value="Commit message"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="10580"/>
     6    <property name="plugin.main.version" value="12643"/>
    77
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DirectDownload.java

    r32442 r33850  
    88import org.openstreetmap.josm.actions.JosmAction;
    99import org.openstreetmap.josm.data.gpx.GpxData;
     10import org.openstreetmap.josm.gui.MainApplication;
    1011import org.openstreetmap.josm.gui.MainMenu;
    1112import org.openstreetmap.josm.gui.layer.GpxLayer;
     
    2627
    2728        openaction = new DownloadAction();
    28         MainMenu.add(Main.main.menu.gpsMenu, openaction);
     29        MainMenu.add(MainApplication.getMenu().gpsMenu, openaction);
    2930    }
    3031
    31     class DownloadAction extends JosmAction {
     32    static class DownloadAction extends JosmAction {
    3233        public DownloadAction() {
    3334            super(tr("Download Track ..."), "DownloadAction",
     
    3536        }
    3637
     38        @Override
    3739        public void actionPerformed(ActionEvent event) {
    3840            DownloadDataGui go = new DownloadDataGui();
     
    5254
    5355            if (data.hasRoutePoints() || data.hasTrackPoints()) {
    54                 Main.getLayerManager().addLayer(gpxLayer);
     56                MainApplication.getLayerManager().addLayer(gpxLayer);
    5557            }
    5658
     
    5860                MarkerLayer ml = new MarkerLayer(data, tr("Markers from {0}", track.filename), null, gpxLayer);
    5961                if (ml.data.size() > 0) {
    60                     Main.getLayerManager().addLayer(ml);
     62                    MainApplication.getLayerManager().addLayer(ml);
    6163                }
    6264            }
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DownloadDataGui.java

    r32442 r33850  
    1717import javax.swing.ListSelectionModel;
    1818import javax.swing.UIManager;
    19 import javax.swing.event.ListSelectionEvent;
    20 import javax.swing.event.ListSelectionListener;
    2119import javax.swing.table.DefaultTableColumnModel;
    2220import javax.swing.table.DefaultTableModel;
     
    151149    }
    152150
    153     class ListSelectionHandler implements ListSelectionListener {
    154         @Override
    155                 public void valueChanged(ListSelectionEvent lse) {
    156         }
    157     }
    158 
    159151    static class NamedResultCellRenderer extends JLabel implements TableCellRenderer {
    160152
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/GpxServerReader.java

    r31934 r33850  
    88import org.openstreetmap.josm.io.OsmTransferException;
    99import org.openstreetmap.josm.tools.HttpClient;
     10import org.openstreetmap.josm.tools.Logging;
    1011import org.xml.sax.SAXException;
    1112
     
    3637            }
    3738        } catch (IOException | OsmTransferException e) {
    38             Main.warn(e);
     39            Logging.warn(e);
    3940            JOptionPane.showMessageDialog(Main.parent, tr("Error fetching URL {0}", urlString));
    4041            return null;
    4142        } catch (SAXException e) {
    42             Main.warn(e);
     43            Logging.warn(e);
    4344            JOptionPane.showMessageDialog(Main.parent, tr("Error parsing data from URL {0}", urlString));
    4445            return null;
    45 
    4646        }
    4747    }
    48 
    4948}
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/UserTrackReader.java

    r31934 r33850  
    11package org.openstreetmap.josm.plugins.directdownload;
    22
    3 import org.openstreetmap.josm.Main;
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4
     5import java.io.IOException;
     6import java.io.InputStream;
     7import java.net.MalformedURLException;
     8import java.net.URL;
     9import java.util.LinkedList;
     10import java.util.List;
     11
     12import javax.swing.JOptionPane;
     13import javax.xml.parsers.ParserConfigurationException;
     14import javax.xml.parsers.SAXParser;
     15import javax.xml.parsers.SAXParserFactory;
     16
    417import org.openstreetmap.josm.io.OsmApi;
    518import org.openstreetmap.josm.io.OsmConnection;
    619import org.openstreetmap.josm.io.OsmTransferException;
    720import org.openstreetmap.josm.tools.HttpClient;
     21import org.openstreetmap.josm.tools.Logging;
    822import org.xml.sax.Attributes;
    923import org.xml.sax.SAXException;
    1024import 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;
    2225
    2326public class UserTrackReader extends OsmConnection {
     
    4245
    4346            return handler.getResult();
    44         } catch (java.net.MalformedURLException e) {
    45             Main.error(e);
     47        } catch (MalformedURLException e) {
     48            Logging.error(e);
    4649            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);
    4952            JOptionPane.showMessageDialog(null, tr("Error fetching URL {0}", urlString));
    5053        } catch (SAXException | ParserConfigurationException e) {
    51             Main.error(e);
     54            Logging.error(e);
    5255            JOptionPane.showMessageDialog(null, tr("Error parsing data from URL {0}", urlString));
    5356        }
Note: See TracChangeset for help on using the changeset viewer.