Changeset 34483 in osm for applications/editors/josm/plugins/DirectDownload
- Timestamp:
- 2018-08-15T14:19:24+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/DirectDownload
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/DirectDownload/build.xml
r33850 r34483 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 2643"/>6 <property name="plugin.main.version" value="14153"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DirectDownload.java
r34481 r34483 8 8 import java.util.HashMap; 9 9 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.actions.JosmAction; 11 import org.openstreetmap.josm.data.gpx.GpxConstants; 12 12 import org.openstreetmap.josm.data.gpx.GpxData; 13 13 import org.openstreetmap.josm.data.gpx.GpxTrack; 14 import org.openstreetmap.josm.data.gpx.GpxTrackSegment;15 import org.openstreetmap.josm.data.gpx.GpxConstants;16 14 import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack; 17 15 import org.openstreetmap.josm.gui.MainApplication; … … 21 19 import org.openstreetmap.josm.plugins.Plugin; 22 20 import org.openstreetmap.josm.plugins.PluginInformation; 21 import org.openstreetmap.josm.spi.preferences.Config; 23 22 24 23 public class DirectDownload extends Plugin { … … 63 62 64 63 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()); 66 65 if (!trk.getAttributes().containsKey(GpxConstants.GPX_NAME)) { 67 66 System.out.println(track.filename); … … 74 73 // replace the existing trace in the unmodifiable tracks 75 74 data.removeTrack(trk); 76 trk = new ImmutableGpxTrack(new ArrayList< GpxTrackSegment>(trk.getSegments()), attrib);75 trk = new ImmutableGpxTrack(new ArrayList<>(trk.getSegments()), attrib); 77 76 data.addTrack(trk); 78 77 } … … 84 83 } 85 84 86 if ( Main.pref.getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) {85 if (Config.getPref().getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) { 87 86 MarkerLayer ml = new MarkerLayer(data, tr("Markers from {0}", track.filename), null, gpxLayer); 88 87 if (ml.data.size() > 0) { -
applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DownloadDataGui.java
r34481 r34483 23 23 import javax.swing.table.TableColumn; 24 24 25 import org.openstreetmap.josm.Main;26 25 import org.openstreetmap.josm.gui.ExtendedDialog; 26 import org.openstreetmap.josm.gui.MainApplication; 27 27 28 28 public class DownloadDataGui extends ExtendedDialog { … … 34 34 public DownloadDataGui() { 35 35 // Initalizes ExtendedDialog 36 super(Main .parent,36 super(MainApplication.getMainFrame(), 37 37 tr("Download Track"), 38 38 new String[] {tr("Download Track"), tr("Cancel")}, -
applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/GpxServerReader.java
r34481 r34483 10 10 import javax.swing.JOptionPane; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.gpx.GpxData; 13 import org.openstreetmap.josm.gui.MainApplication; 14 14 import org.openstreetmap.josm.io.GpxReader; 15 15 import org.openstreetmap.josm.io.OsmApi; … … 33 33 boolean parsedProperly = r.parse(true); 34 34 if (!parsedProperly) { 35 JOptionPane.showMessageDialog(Main .parent,35 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 36 36 tr("Error occurred while parsing gpx file {0}. Only a part of the file will be available.", urlString)); 37 37 } … … 40 40 } catch (IOException | OsmTransferException e) { 41 41 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)); 43 43 return null; 44 44 } catch (SAXException e) { 45 45 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)); 47 47 return null; 48 48 }
Note:
See TracChangeset
for help on using the changeset viewer.