Changeset 16590 in osm for applications/editors/josm/plugins
- Timestamp:
- 2009-07-19T19:46:30+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/waydownloader
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waydownloader/.classpath
r15412 r16590 3 3 <classpathentry kind="src" path="src"/> 4 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 5 <classpathentry combineaccessrules="false" kind="src" path="/ josm"/>5 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 6 6 <classpathentry kind="output" path="bin"/> 7 7 </classpath> -
applications/editors/josm/plugins/waydownloader/build.xml
r16290 r16590 91 91 <attribute name="Plugin-Description" value="Easy downloading along a long set of interconnected ways"/> 92 92 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WayDownloaderPlugin"/> 93 <attribute name="Plugin-Mainversion" value="1 722"/>93 <attribute name="Plugin-Mainversion" value="1813"/> 94 94 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 95 95 </manifest> -
applications/editors/josm/plugins/waydownloader/src/WayDownloaderPlugin.java
r16290 r16590 5 5 import java.util.ArrayList; 6 6 import java.util.Collection; 7 import java.util.Iterator;8 7 import java.util.LinkedList; 9 8 … … 12 11 import org.openstreetmap.josm.Main; 13 12 import org.openstreetmap.josm.actions.JosmAction; 13 import org.openstreetmap.josm.actions.MergeNodesAction; 14 14 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask; 15 import org.openstreetmap.josm.actions.MergeNodesAction;16 15 import org.openstreetmap.josm.data.Bounds; 17 16 import org.openstreetmap.josm.data.osm.DataSource; … … 20 19 import org.openstreetmap.josm.data.osm.Way; 21 20 import org.openstreetmap.josm.gui.MainMenu; 21 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor; 22 22 import org.openstreetmap.josm.plugins.Plugin; 23 23 import org.openstreetmap.josm.tools.Shortcut; … … 92 92 errMsg = tr("Select a starting node on the end of a way"); 93 93 } else { 94 priorConnectedWay = (Way)connectedWays.get(0);94 priorConnectedWay =connectedWays.get(0); 95 95 96 96 //Download a little rectangle around the selected node … … 102 102 selectedNode.getCoor().lon()-lonbuffer, 103 103 selectedNode.getCoor().lat()+latbuffer, 104 selectedNode.getCoor().lon()+lonbuffer); 104 selectedNode.getCoor().lon()+lonbuffer, 105 new PleaseWaitProgressMonitor()); 105 106 106 107 //The download is scheduled to be executed. … … 157 158 //Figure out which of the two is new. 158 159 System.out.println("connectedWays.toString()=" + connectedWays.toString()); 159 Way wayA = (Way)connectedWays.get(0);160 Way wayB = (Way)connectedWays.get(1);160 Way wayA = connectedWays.get(0); 161 Way wayB = connectedWays.get(1); 161 162 Way nextWay = wayA; 162 163 if (priorConnectedWay.equals(wayA)) nextWay = wayB; … … 176 177 /** See if there's another node at the same coordinates. If so return it. Otherwise null */ 177 178 private Node duplicateNode() { 178 Iterator nodesIter = Main.ds.nodes.iterator(); 179 while (nodesIter.hasNext()) { 180 Node onNode = (Node) nodesIter.next(); 179 for (Node onNode:Main.ds.nodes) { 181 180 if (!onNode.equals(this.selectedNode) 182 181 && onNode.getCoor().lat()==selectedNode.getCoor().lat() … … 200 199 201 200 //loop through every way 202 Iterator waysIter = Main.ds.ways.iterator(); 203 while (waysIter.hasNext()) { 204 Way onWay = (Way) waysIter.next(); 205 206 201 for (Way onWay:Main.ds.ways) { 207 202 Object[] nodes = onWay.nodes.toArray(); 208 203 if (nodes.length<2) { … … 233 228 } else { 234 229 Way selectedWay = (Way) selection.toArray()[0]; 235 selectedNode = (Node)selectedWay.nodes.get(0);230 selectedNode = selectedWay.nodes.get(0); 236 231 237 232 if (isDownloaded(selectedNode)) { … … 246 241 247 242 private boolean isDownloaded(Node node) { 248 Iterator downloadedAreasIter = Main.ds.dataSources.iterator(); 249 while (downloadedAreasIter.hasNext()) { 250 DataSource datasource = (DataSource) downloadedAreasIter.next(); 243 for (DataSource datasource:Main.ds.dataSources) { 251 244 Bounds bounds = datasource.bounds; 252 245
Note:
See TracChangeset
for help on using the changeset viewer.