Ignore:
Timestamp:
2018-08-15T14:19:24+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

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

Legend:

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

    r33850 r34483  
    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="12643"/>
     6    <property name="plugin.main.version" value="14153"/>
    77
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DirectDownload.java

    r34481 r34483  
    88import java.util.HashMap;
    99
    10 import org.openstreetmap.josm.Main;
    1110import org.openstreetmap.josm.actions.JosmAction;
     11import org.openstreetmap.josm.data.gpx.GpxConstants;
    1212import org.openstreetmap.josm.data.gpx.GpxData;
    1313import org.openstreetmap.josm.data.gpx.GpxTrack;
    14 import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
    15 import org.openstreetmap.josm.data.gpx.GpxConstants;
    1614import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
    1715import org.openstreetmap.josm.gui.MainApplication;
     
    2119import org.openstreetmap.josm.plugins.Plugin;
    2220import org.openstreetmap.josm.plugins.PluginInformation;
     21import org.openstreetmap.josm.spi.preferences.Config;
    2322
    2423public class DirectDownload extends Plugin {
     
    6362
    6463                for (GpxTrack trk : data.getTracks()) {
    65                     HashMap<String, Object> attrib = new HashMap<String, Object>(trk.getAttributes());
     64                    HashMap<String, Object> attrib = new HashMap<>(trk.getAttributes());
    6665                    if (!trk.getAttributes().containsKey(GpxConstants.GPX_NAME)) {
    6766                        System.out.println(track.filename);
     
    7473                    // replace the existing trace in the unmodifiable tracks
    7574                    data.removeTrack(trk);
    76                     trk = new ImmutableGpxTrack(new ArrayList<GpxTrackSegment>(trk.getSegments()), attrib);
     75                    trk = new ImmutableGpxTrack(new ArrayList<>(trk.getSegments()), attrib);
    7776                    data.addTrack(trk);
    7877                }
     
    8483                }
    8584
    86                 if (Main.pref.getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) {
     85                if (Config.getPref().getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) {
    8786                    MarkerLayer ml = new MarkerLayer(data, tr("Markers from {0}", track.filename), null, gpxLayer);
    8887                    if (ml.data.size() > 0) {
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DownloadDataGui.java

    r34481 r34483  
    2323import javax.swing.table.TableColumn;
    2424
    25 import org.openstreetmap.josm.Main;
    2625import org.openstreetmap.josm.gui.ExtendedDialog;
     26import org.openstreetmap.josm.gui.MainApplication;
    2727
    2828public class DownloadDataGui extends ExtendedDialog {
     
    3434    public DownloadDataGui() {
    3535        // Initalizes ExtendedDialog
    36         super(Main.parent,
     36        super(MainApplication.getMainFrame(),
    3737          tr("Download Track"),
    3838          new String[] {tr("Download Track"), tr("Cancel")},
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/GpxServerReader.java

    r34481 r34483  
    1010import javax.swing.JOptionPane;
    1111
    12 import org.openstreetmap.josm.Main;
    1312import org.openstreetmap.josm.data.gpx.GpxData;
     13import org.openstreetmap.josm.gui.MainApplication;
    1414import org.openstreetmap.josm.io.GpxReader;
    1515import org.openstreetmap.josm.io.OsmApi;
     
    3333                boolean parsedProperly = r.parse(true);
    3434                if (!parsedProperly) {
    35                     JOptionPane.showMessageDialog(Main.parent,
     35                    JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    3636                            tr("Error occurred while parsing gpx file {0}. Only a part of the file will be available.", urlString));
    3737                }
     
    4040        } catch (IOException | OsmTransferException e) {
    4141            Logging.warn(e);
    42             JOptionPane.showMessageDialog(Main.parent, tr("Error fetching URL {0}", urlString));
     42            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Error fetching URL {0}", urlString));
    4343            return null;
    4444        } catch (SAXException e) {
    4545            Logging.warn(e);
    46             JOptionPane.showMessageDialog(Main.parent, tr("Error parsing data from URL {0}", urlString));
     46            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Error parsing data from URL {0}", urlString));
    4747            return null;
    4848        }
Note: See TracChangeset for help on using the changeset viewer.