Changeset 6869 in josm
- Timestamp:
- 2014-02-18T17:21:45+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r6691 r6869 13 13 import java.util.Set; 14 14 15 import org.openstreetmap.josm.data.osm.Node; 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.data.coor.EastNorth; 16 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 18 import org.openstreetmap.josm.data.osm.Relation; … … 33 34 public abstract class CrossingWays extends Test { 34 35 protected static final int CROSSING_WAYS = 601; 35 36 36 37 private static final String HIGHWAY = "highway"; 37 38 private static final String RAILWAY = "railway"; … … 227 228 for (int i = 0; i < nodesSize - 1; i++) { 228 229 final WaySegment es1 = new WaySegment(w, i); 229 for (List<WaySegment> segments : getSegments(es1.getFirstNode(), es1.getSecondNode())) { 230 final EastNorth en1 = es1.getFirstNode().getEastNorth(); 231 final EastNorth en2 = es1.getSecondNode().getEastNorth(); 232 if (en1 == null || en2 == null) { 233 Main.warn("Crossing ways test skipped "+es1); 234 continue; 235 } 236 for (List<WaySegment> segments : getSegments(en1, en2)) { 230 237 for (WaySegment es2 : segments) { 231 238 List<Way> prims; … … 265 272 * of segments already processed 266 273 * 267 * @param n1 The first node268 * @param n2 The second node274 * @param n1 The first EastNorth 275 * @param n2 The second EastNorth 269 276 * @return A list with all the cells the segment crosses 270 277 */ 271 public List<List<WaySegment>> getSegments( Node n1, Noden2) {278 public List<List<WaySegment>> getSegments(EastNorth n1, EastNorth n2) { 272 279 273 280 List<List<WaySegment>> cells = new ArrayList<List<WaySegment>>(); … … 282 289 return cells; 283 290 } 284 285 291 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r6773 r6869 183 183 })); 184 184 } 185 185 186 186 private static void removeMetaRules(MapCSSStyleSource source) { 187 187 for (Iterator<MapCSSRule> it = source.rules.iterator(); it.hasNext(); ) { … … 270 270 while (m.find()) { 271 271 final String argument = determineArgument((Selector.GeneralSelector) matchingSelector, Integer.parseInt(m.group(1)), m.group(2)); 272 m.appendReplacement(sb, String.valueOf(argument)); 272 try { 273 m.appendReplacement(sb, String.valueOf(argument)); 274 } catch (IndexOutOfBoundsException e) { 275 Main.error(tr("Unable to replace argument {0} in {1}: {2}", argument, sb, e.getMessage())); 276 } 273 277 } 274 278 m.appendTail(sb); -
trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java
r6362 r6869 10 10 import java.util.Set; 11 11 12 import org.openstreetmap.josm.data.coor.EastNorth; 12 13 import org.openstreetmap.josm.data.osm.Node; 13 14 import org.openstreetmap.josm.data.osm.Way; 14 15 import org.openstreetmap.josm.data.validation.OsmValidator; 16 import org.openstreetmap.josm.tools.CheckParameterUtil; 15 17 16 18 /** … … 20 22 */ 21 23 public final class ValUtil { 22 24 23 25 private ValUtil() { 24 26 // Hide default constructor for utils classes 25 27 } 26 28 27 29 /** 28 30 * Returns the start and end cells of a way. … … 103 105 104 106 /** 105 * Returns the coordinates of all cells in a grid that a line between 2 106 * nodes intersects with. 107 * Returns the coordinates of all cells in a grid that a line between 2 nodes intersects with. 107 108 * 108 109 * @param n1 The first node. … … 111 112 * cells, but a bigger number of them. 112 113 * @return A list with the coordinates of all cells 114 * @throws IllegalArgumentException if n1 or n2 is {@code null} or without coordinates 113 115 */ 114 public static List<Point2D> getSegmentCells(Node n1, Node n2, double gridDetail) { 116 public static List<Point2D> getSegmentCells(Node n1, Node n2, double gridDetail) throws IllegalArgumentException { 117 CheckParameterUtil.ensureParameterNotNull(n1, "n1"); 118 CheckParameterUtil.ensureParameterNotNull(n1, "n2"); 119 return getSegmentCells(n1.getEastNorth(), n2.getEastNorth(), gridDetail); 120 } 121 122 /** 123 * Returns the coordinates of all cells in a grid that a line between 2 nodes intersects with. 124 * 125 * @param en1 The first EastNorth. 126 * @param en2 The second EastNorth. 127 * @param gridDetail The detail of the grid. Bigger values give smaller 128 * cells, but a bigger number of them. 129 * @return A list with the coordinates of all cells 130 * @throws IllegalArgumentException if en1 or en2 is {@code null} 131 * @since 6869 132 */ 133 public static List<Point2D> getSegmentCells(EastNorth en1, EastNorth en2, double gridDetail) throws IllegalArgumentException { 134 CheckParameterUtil.ensureParameterNotNull(en1, "en1"); 135 CheckParameterUtil.ensureParameterNotNull(en2, "en2"); 115 136 List<Point2D> cells = new ArrayList<Point2D>(); 116 double x0 = n1.getEastNorth().east() * gridDetail;117 double x1 = n2.getEastNorth().east() * gridDetail;118 double y0 = n1.getEastNorth().north() * gridDetail + 1;119 double y1 = n2.getEastNorth().north() * gridDetail + 1;137 double x0 = en1.east() * gridDetail; 138 double x1 = en2.east() * gridDetail; 139 double y0 = en1.north() * gridDetail + 1; 140 double y1 = en2.north() * gridDetail + 1; 120 141 121 142 if (x0 > x1) { -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r6852 r6869 377 377 }); 378 378 } catch (InterruptedException e) { 379 // Occurs frequently during JOSM shutdown, log set to debugonly380 Main. debug("InterruptedException in "+MapStatus.class.getSimpleName());379 // Occurs frequently during JOSM shutdown, log set to trace only 380 Main.trace("InterruptedException in "+MapStatus.class.getSimpleName()); 381 381 } catch (InvocationTargetException e) { 382 382 Main.warn(e); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r6798 r6869 48 48 49 49 /** 50 * who sen d threquest?51 * the host from ref rerer header or IP of request sender50 * who sent the request? 51 * the host from referer header or IP of request sender 52 52 */ 53 53 protected String sender; … … 108 108 109 109 abstract public String[] getMandatoryParams(); 110 110 111 111 public String[] getOptionalParams() { 112 112 return null; … … 242 242 + Utils.join(", ", missingKeys)); 243 243 } 244 245 244 } 246 245 -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r6841 r6869 452 452 boolean begin = true; 453 453 for (Node n : polygon) { 454 if (begin) { 455 path.moveTo(n.getEastNorth().getX(), n.getEastNorth().getY()); 456 begin = false; 457 } else { 458 path.lineTo(n.getEastNorth().getX(), n.getEastNorth().getY()); 454 EastNorth en = n.getEastNorth(); 455 if (en != null) { 456 if (begin) { 457 path.moveTo(en.getX(), en.getY()); 458 begin = false; 459 } else { 460 path.lineTo(en.getX(), en.getY()); 461 } 459 462 } 460 463 }
Note:
See TracChangeset
for help on using the changeset viewer.