Changeset 33710 in osm
- Timestamp:
- 2017-10-07T13:58:25+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/download_along
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/download_along/build.xml
r32730 r33710 4 4 <property name="commit.message" value="Changed the constructor signature of the plugin main class"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 0657"/>6 <property name="plugin.main.version" value="12643"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlong.java
r30633 r33710 2 2 package org.openstreetmap.josm.plugin.download_along; 3 3 4 import org.openstreetmap.josm. Main;4 import org.openstreetmap.josm.gui.MainApplication; 5 5 import org.openstreetmap.josm.gui.MainMenu; 6 6 import org.openstreetmap.josm.plugins.Plugin; … … 11 11 public DownloadAlong(PluginInformation info) { 12 12 super(info); 13 MainMenu.add(Main .main.menu.moreToolsMenu, new DownloadAlongWayAction());13 MainMenu.add(MainApplication.getMenu().moreToolsMenu, new DownloadAlongWayAction()); 14 14 } 15 15 } -
applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlongWayAction.java
r32946 r33710 7 7 import java.awt.event.KeyEvent; 8 8 import java.awt.geom.Area; 9 import java.awt.geom.Path2D; 9 10 import java.awt.geom.Rectangle2D; 10 11 import java.util.ArrayList; … … 23 24 import org.openstreetmap.josm.gui.layer.gpx.DownloadAlongPanel; 24 25 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 26 import org.openstreetmap.josm.tools.Logging; 25 27 import org.openstreetmap.josm.tools.Shortcut; 26 28 … … 84 86 double buffer_x = buffer_y / scale; 85 87 double max_area = panel.getArea() / 10000.0 / scale; 86 Area a = new Area();88 Path2D path = new Path2D.Double(); 87 89 Rectangle2D r = new Rectangle2D.Double(); 88 90 … … 101 103 Double d = c.greatCircleDistance(previous) / buffer_dist; 102 104 int nbNodes = d.intValue(); 103 Main.info(tr("{0} intermediate nodes to download.", nbNodes));104 Main.info(tr("between {0} {1} and {2} {3}", c.lat(), c.lon(), previous.lat(),105 Logging.info(tr("{0} intermediate nodes to download.", nbNodes)); 106 Logging.info(tr("between {0} {1} and {2} {3}", c.lat(), c.lon(), previous.lat(), 105 107 previous.lon())); 106 108 for (int i = 1; i < nbNodes; i++) { … … 108 110 + (i * (c.lat() - previous.lat()) / (nbNodes + 1)), previous.lon() 109 111 + (i * (c.lon() - previous.lon()) / (nbNodes + 1)))); 110 Main.info(tr(" adding {0} {1}", previous.lat()112 Logging.info(tr(" adding {0} {1}", previous.lat() 111 113 + (i * (c.lat() - previous.lat()) / (nbNodes + 1)), previous.lon() 112 114 + (i * (c.lon() - previous.lon()) / (nbNodes + 1)))); … … 118 120 // we add a buffer around the point. 119 121 r.setRect(d.lon() - buffer_x, d.lat() - buffer_y, 2 * buffer_x, 2 * buffer_y); 120 a.add(new Area(r));122 path.append(r, false); 121 123 previous = d; 122 124 } … … 125 127 } 126 128 } 127 129 Area a = new Area(path); 128 130 confirmAndDownloadAreas(a, max_area, panel.isDownloadOsmData(), panel.isDownloadGpxData(), 129 131 tr("Download from OSM along selected ways"), NullProgressMonitor.INSTANCE);
Note:
See TracChangeset
for help on using the changeset viewer.