Changeset 17896 in josm for trunk/src/org
- Timestamp:
- 2021-05-17T19:44:04+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r17188 r17896 108 108 for (WaySegment ws : wss) { 109 109 // Maybe cleaner to pass a "isSelected" predicate to getNearestWaySegments, but this is less invasive. 110 if (restrictToSelectedWays && !ws. way.isSelected()) {110 if (restrictToSelectedWays && !ws.getWay().isSelected()) { 111 111 continue; 112 112 } … … 135 135 // only use the closest WaySegment of each way and ignore those that already contain the node 136 136 if (!ws.getFirstNode().equals(node) && !ws.getSecondNode().equals(node) 137 && !seenWays.contains(ws. way)) {137 && !seenWays.contains(ws.getWay())) { 138 138 if (usedDist == null) 139 139 usedDist = entry.getKey(); 140 MultiMap<Integer, Node> innerMap = data.get(ws. way);140 MultiMap<Integer, Node> innerMap = data.get(ws.getWay()); 141 141 if (innerMap == null) { 142 142 innerMap = new MultiMap<>(); 143 data.put(ws. way, innerMap);143 data.put(ws.getWay(), innerMap); 144 144 } 145 innerMap.put(ws. lowerIndex, node);146 seenWays.add(ws. way);145 innerMap.put(ws.getLowerIndex(), node); 146 seenWays.add(ws.getWay()); 147 147 } 148 148 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r16661 r17896 418 418 return DeleteCommand.deleteWaySegment(parameters.nearestSegment); 419 419 case way: 420 return DeleteCommand.delete(Collections.singleton(parameters.nearestSegment. way), false, silent);420 return DeleteCommand.delete(Collections.singleton(parameters.nearestSegment.getWay()), false, silent); 421 421 case way_with_nodes: 422 return DeleteCommand.delete(Collections.singleton(parameters.nearestSegment. way), true, silent);422 return DeleteCommand.delete(Collections.singleton(parameters.nearestSegment.getWay()), true, silent); 423 423 case way_with_references: 424 return DeleteCommand.deleteWithReferences(Collections.singleton(parameters.nearestSegment. way), true);424 return DeleteCommand.deleteWithReferences(Collections.singleton(parameters.nearestSegment.getWay()), true); 425 425 default: 426 426 return null; -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r17666 r17896 694 694 for (WaySegment ws : wss) { 695 695 List<Integer> is; 696 if (insertPoints.containsKey(ws. way)) {697 is = insertPoints.get(ws. way);696 if (insertPoints.containsKey(ws.getWay())) { 697 is = insertPoints.get(ws.getWay()); 698 698 } else { 699 699 is = new ArrayList<>(); 700 insertPoints.put(ws. way, is);701 } 702 703 is.add(ws. lowerIndex);700 insertPoints.put(ws.getWay(), is); 701 } 702 703 is.add(ws.getLowerIndex()); 704 704 } 705 705 … … 859 859 List<WaySegment> wss = mv.getNearestWaySegments(mousePos, OsmPrimitive::isSelectable); 860 860 for (WaySegment ws : wss) { 861 mouseOnExistingWays.add(ws. way);861 mouseOnExistingWays.add(ws.getWay()); 862 862 } 863 863 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r17461 r17896 432 432 mode = Mode.create_new; 433 433 // create a new segment and then select and extrude the new segment 434 getLayerManager().getEditDataSet().setSelected(selectedSegment. way);434 getLayerManager().getEditDataSet().setSelected(selectedSegment.getWay()); 435 435 alwaysCreateNodes = true; 436 436 } else { 437 437 mode = Mode.extrude; 438 getLayerManager().getEditDataSet().setSelected(selectedSegment. way);438 getLayerManager().getEditDataSet().setSelected(selectedSegment.getWay()); 439 439 alwaysCreateNodes = shift; 440 440 } … … 591 591 EastNorth b = ws.getSecondNode().getEastNorth(); 592 592 n.setEastNorth(Geometry.closestPointToSegment(a, b, n.getEastNorth())); 593 Way wnew = new Way(ws. way);594 wnew.addNode(ws. lowerIndex+1, n);595 DataSet ds = ws. way.getDataSet();593 Way wnew = new Way(ws.getWay()); 594 wnew.addNode(ws.getLowerIndex() +1, n); 595 DataSet ds = ws.getWay().getDataSet(); 596 596 UndoRedoHandler.getInstance().add(new SequenceCommand(tr("Add a new node to an existing way"), 597 new AddCommand(ds, n), new ChangeNodesCommand(ds, ws. way, wnew.getNodes())));597 new AddCommand(ds, n), new ChangeNodesCommand(ds, ws.getWay(), wnew.getNodes()))); 598 598 wnew.setNodes(null); // see #19885 599 599 … … 641 641 // create extrusion 642 642 Collection<Command> cmds = new LinkedList<>(); 643 Way wnew = new Way(selectedSegment. way);643 Way wnew = new Way(selectedSegment.getWay()); 644 644 boolean wayWasModified = false; 645 645 boolean wayWasSingleSegment = wnew.getNodesCount() == 2; 646 int insertionPoint = selectedSegment. lowerIndex + 1;646 int insertionPoint = selectedSegment.getUpperIndex(); 647 647 648 648 //find if the new points overlap existing segments (in case of 90 degree angles) 649 Node prevNode = getPreviousNode(selectedSegment. lowerIndex);649 Node prevNode = getPreviousNode(selectedSegment.getLowerIndex()); 650 650 boolean nodeOverlapsSegment = prevNode != null && Geometry.segmentsParallel(initialN1en, prevNode.getEastNorth(), initialN1en, newN1en); 651 651 // segmentAngleZero marks subset of nodeOverlapsSegment. 652 652 // nodeOverlapsSegment is true if angle between segments is 0 or PI, segmentAngleZero only if angle is 0 653 653 boolean segmentAngleZero = prevNode != null && Math.abs(Geometry.getCornerAngle(prevNode.getEastNorth(), initialN1en, newN1en)) < 1e-5; 654 boolean hasOtherWays = hasNodeOtherWays(selectedSegment.getFirstNode(), selectedSegment. way);654 boolean hasOtherWays = hasNodeOtherWays(selectedSegment.getFirstNode(), selectedSegment.getWay()); 655 655 List<Node> changedNodes = new ArrayList<>(); 656 656 if (nodeOverlapsSegment && !alwaysCreateNodes && !hasOtherWays) { … … 679 679 680 680 //find if the new points overlap existing segments (in case of 90 degree angles) 681 Node nextNode = getNextNode(selectedSegment. lowerIndex + 1);681 Node nextNode = getNextNode(selectedSegment.getUpperIndex()); 682 682 nodeOverlapsSegment = nextNode != null && Geometry.segmentsParallel(initialN2en, nextNode.getEastNorth(), initialN2en, newN2en); 683 683 segmentAngleZero = nextNode != null && Math.abs(Geometry.getCornerAngle(nextNode.getEastNorth(), initialN2en, newN2en)) < 1e-5; 684 hasOtherWays = hasNodeOtherWays(selectedSegment.getSecondNode(), selectedSegment. way);684 hasOtherWays = hasNodeOtherWays(selectedSegment.getSecondNode(), selectedSegment.getWay()); 685 685 686 686 if (nodeOverlapsSegment && !alwaysCreateNodes && !hasOtherWays) { … … 714 714 if (wayWasModified) { 715 715 // we only need to change the way if its node list was really modified 716 cmds.add(new ChangeNodesCommand(selectedSegment. way, wnew.getNodes()));716 cmds.add(new ChangeNodesCommand(selectedSegment.getWay(), wnew.getNodes())); 717 717 } 718 718 wnew.setNodes(null); // see #19885 … … 824 824 825 825 //add directions parallel to neighbor segments 826 Node prevNode = getPreviousNode(selectedSegment. lowerIndex);826 Node prevNode = getPreviousNode(selectedSegment.getLowerIndex()); 827 827 if (prevNode != null) { 828 828 EastNorth en = prevNode.getEastNorth(); … … 833 833 } 834 834 835 Node nextNode = getNextNode(selectedSegment. lowerIndex + 1);835 Node nextNode = getNextNode(selectedSegment.getUpperIndex()); 836 836 if (nextNode != null) { 837 837 EastNorth en = nextNode.getEastNorth(); … … 871 871 */ 872 872 private boolean checkDualAlignConditions() { 873 Node prevNode = getPreviousNode(selectedSegment. lowerIndex);874 Node nextNode = getNextNode(selectedSegment. lowerIndex + 1);873 Node prevNode = getPreviousNode(selectedSegment.getLowerIndex()); 874 Node nextNode = getNextNode(selectedSegment.getUpperIndex()); 875 875 if (prevNode == null || nextNode == null) { 876 876 return false; … … 906 906 907 907 // set neighboring segments 908 Node prevNode = getPreviousNode(selectedSegment. lowerIndex);908 Node prevNode = getPreviousNode(selectedSegment.getLowerIndex()); 909 909 if (prevNode != null) { 910 910 EastNorth prevNodeEn = prevNode.getEastNorth(); … … 915 915 } 916 916 917 Node nextNode = getNextNode(selectedSegment. lowerIndex + 1);917 Node nextNode = getNextNode(selectedSegment.getUpperIndex()); 918 918 if (nextNode != null) { 919 919 EastNorth nextNodeEn = nextNode.getEastNorth(); … … 975 975 if (index > 0) 976 976 return index - 1; 977 else if (selectedSegment. way.isClosed())978 return selectedSegment. way.getNodesCount() - 2;977 else if (selectedSegment.getWay().isClosed()) 978 return selectedSegment.getWay().getNodesCount() - 2; 979 979 else 980 980 return -1; … … 989 989 int indexPrev = getPreviousNodeIndex(index); 990 990 if (indexPrev >= 0) 991 return selectedSegment. way.getNode(indexPrev);991 return selectedSegment.getWay().getNode(indexPrev); 992 992 else 993 993 return null; … … 1000 1000 */ 1001 1001 private int getNextNodeIndex(int index) { 1002 int count = selectedSegment. way.getNodesCount();1002 int count = selectedSegment.getWay().getNodesCount(); 1003 1003 if (index < count - 1) 1004 1004 return index + 1; 1005 else if (selectedSegment. way.isClosed())1005 else if (selectedSegment.getWay().isClosed()) 1006 1006 return 1; 1007 1007 else … … 1017 1017 int indexNext = getNextNodeIndex(index); 1018 1018 if (indexNext >= 0) 1019 return selectedSegment. way.getNode(indexNext);1019 return selectedSegment.getWay().getNode(indexNext); 1020 1020 else 1021 1021 return null; -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r17440 r17896 463 463 // Adding the node to all segments found 464 464 for (WaySegment virtualSegment : virtualSegments) { 465 Way w = virtualSegment. way;465 Way w = virtualSegment.getWay(); 466 466 List<Node> modNodes = w.getNodes(); 467 modNodes.add(virtualSegment. lowerIndex + 1, virtualNode);467 modNodes.add(virtualSegment.getUpperIndex(), virtualNode); 468 468 virtualCmds.add(new ChangeNodesCommand(w, modNodes)); 469 469 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r17157 r17896 508 508 sourceWays.removeIf(w -> w.isIncomplete() || w.isEmpty()); 509 509 510 if (!sourceWays.contains(referenceSegment. way)) {510 if (!sourceWays.contains(referenceSegment.getWay())) { 511 511 clearSourceWays(); 512 addSourceWay(referenceSegment. way);512 addSourceWay(referenceSegment.getWay()); 513 513 } 514 514 … … 517 517 int i = 0; 518 518 for (Way w : sourceWays) { 519 if (w == referenceSegment. way) {519 if (w == referenceSegment.getWay()) { 520 520 referenceWayIndex = i; 521 521 break; -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r17666 r17896 1215 1215 1216 1216 for (WaySegment ws : mv.getNearestWaySegments(p, mv.isSelectablePredicate)) { 1217 Way w = ws. way;1218 1219 wnp.a = w.getNode(ws. lowerIndex);1220 wnp.b = w.getNode(ws. lowerIndex + 1);1217 Way w = ws.getWay(); 1218 1219 wnp.a = w.getNode(ws.getLowerIndex()); 1220 wnp.b = w.getNode(ws.getUpperIndex()); 1221 1221 MapViewPoint p1 = mv.getState().getPointFor(wnp.a); 1222 1222 MapViewPoint p2 = mv.getState().getPointFor(wnp.b); … … 1257 1257 virtualCmds.add(new AddCommand(ds, virtualNode)); 1258 1258 for (WaySegment virtualWay : virtualWays) { 1259 Way w = virtualWay. way;1259 Way w = virtualWay.getWay(); 1260 1260 List<Node> modNodes = w.getNodes(); 1261 modNodes.add(virtualWay. lowerIndex + 1, virtualNode);1261 modNodes.add(virtualWay.getUpperIndex(), virtualNode); 1262 1262 virtualCmds.add(new ChangeNodesCommand(ds, w, modNodes)); 1263 1263 } -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r17205 r17896 479 479 */ 480 480 public static Command deleteWaySegment(WaySegment ws) { 481 if (ws. way.getNodesCount() < 3)482 return delete(Collections.singleton(ws. way), false);483 484 if (ws. way.isClosed()) {481 if (ws.getWay().getNodesCount() < 3) 482 return delete(Collections.singleton(ws.getWay()), false); 483 484 if (ws.getWay().isClosed()) { 485 485 // If the way is circular (first and last nodes are the same), the way shouldn't be splitted 486 486 487 487 List<Node> n = new ArrayList<>(); 488 488 489 n.addAll(ws. way.getNodes().subList(ws.lowerIndex + 1, ws.way.getNodesCount() - 1));490 n.addAll(ws. way.getNodes().subList(0, ws.lowerIndex + 1));491 492 return new ChangeNodesCommand(ws. way, n);489 n.addAll(ws.getWay().getNodes().subList(ws.getUpperIndex(), ws.getWay().getNodesCount() - 1)); 490 n.addAll(ws.getWay().getNodes().subList(0, ws.getUpperIndex())); 491 492 return new ChangeNodesCommand(ws.getWay(), n); 493 493 } 494 494 … … 496 496 List<Node> n2 = new ArrayList<>(); 497 497 498 n1.addAll(ws. way.getNodes().subList(0, ws.lowerIndex + 1));499 n2.addAll(ws. way.getNodes().subList(ws.lowerIndex + 1, ws.way.getNodesCount()));498 n1.addAll(ws.getWay().getNodes().subList(0, ws.getUpperIndex())); 499 n2.addAll(ws.getWay().getNodes().subList(ws.getUpperIndex(), ws.getWay().getNodesCount())); 500 500 501 501 if (n1.size() < 2) { 502 return new ChangeNodesCommand(ws. way, n2);502 return new ChangeNodesCommand(ws.getWay(), n2); 503 503 } else if (n2.size() < 2) { 504 return new ChangeNodesCommand(ws. way, n1);504 return new ChangeNodesCommand(ws.getWay(), n1); 505 505 } else { 506 return SplitWayCommand.splitWay(ws. way, Arrays.asList(n1, n2), Collections.<OsmPrimitive>emptyList());506 return SplitWayCommand.splitWay(ws.getWay(), Arrays.asList(n1, n2), Collections.<OsmPrimitive>emptyList()); 507 507 } 508 508 } -
trunk/src/org/openstreetmap/josm/data/osm/IWaySegment.java
r17867 r17896 19 19 public class IWaySegment<N extends INode, W extends IWay<N>> implements Comparable<IWaySegment<N, W>> { 20 20 21 private final W way; 22 private final int lowerIndex; 23 21 24 /** 22 25 * The way. 23 26 */ 24 public final W way; 27 public W getWay() { 28 return way; 29 } 25 30 26 31 /** 27 * The index of one of the 2 nodes in the way. The other node has the 28 * index <code>lowerIndex + 1</code>. 32 * The index of the first of the 2 nodes in the way. 33 * @see #getUpperIndex() 34 * @see #getFirstNode() 29 35 */ 30 public final int lowerIndex; 36 public int getLowerIndex() { 37 return lowerIndex; 38 } 39 40 /** 41 * The index of the second of the 2 nodes in the way. 42 * @see #getLowerIndex() 43 * @see #getSecondNode() 44 */ 45 public int getUpperIndex() { 46 return lowerIndex; 47 } 31 48 32 49 /** … … 49 66 */ 50 67 public N getFirstNode() { 51 return way.getNode( lowerIndex);68 return way.getNode(getLowerIndex()); 52 69 } 53 70 … … 57 74 */ 58 75 public N getSecondNode() { 59 return way.getNode( lowerIndex + 1);76 return way.getNode(getUpperIndex()); 60 77 } 61 78 -
trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java
r17862 r17896 100 100 @Override 101 101 public String toString() { 102 return "WaySegment [way=" + way.getUniqueId() + ", lowerIndex=" + lowerIndex+ ']';102 return "WaySegment [way=" + getWay().getUniqueId() + ", lowerIndex=" + getLowerIndex() + ']'; 103 103 } 104 104 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
r17333 r17896 149 149 path = new GeneralPath(); 150 150 for (WaySegment wseg: data.getHighlightedVirtualNodes()) { 151 if (wseg. way.isUsable() && !wseg.way.isDisabled()) {151 if (wseg.getWay().isUsable() && !wseg.getWay().isDisabled()) { 152 152 Way tmpWay = wseg.toWay(); 153 153 visitVirtual(path, tmpWay); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r17862 r17896 1291 1291 MapViewPath highlightSegs = null; 1292 1292 for (WaySegment ws : highlightWaySegments) { 1293 if (ws. way != way || ws.lowerIndex< offset) {1293 if (ws.getWay() != way || ws.getLowerIndex() < offset) { 1294 1294 continue; 1295 1295 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r17447 r17896 366 366 367 367 if (!es1.intersects(es2) 368 || (!findSelfCrossingOnly && ignoreWaySegmentCombination(es1. way, es2.way))) {368 || (!findSelfCrossingOnly && ignoreWaySegmentCombination(es1.getWay(), es2.getWay()))) { 369 369 continue; 370 370 } 371 371 372 372 prims = new ArrayList<>(); 373 prims.add(es1. way);374 if (es1. way != es2.way)375 prims.add(es2. way);373 prims.add(es1.getWay()); 374 if (es1.getWay() != es2.getWay()) 375 prims.add(es2.getWay()); 376 376 if ((highlight = seenWays.get(prims)) == null) { 377 377 highlight = new ArrayList<>(); … … 379 379 highlight.add(es2); 380 380 381 final MessageHelper message = createMessage(es1. way, es2.way);381 final MessageHelper message = createMessage(es1.getWay(), es2.getWay()); 382 382 errors.add(TestError.builder(this, Severity.WARNING, message.code) 383 383 .message(message.message) … … 437 437 438 438 List<WaySegment> highlight; 439 if (es2. way== w // reported by CrossingWays.SelfIntersection439 if (es2.getWay() == w // reported by CrossingWays.SelfIntersection 440 440 || (findSharedWaySegments && !es1.isSimilar(es2)) 441 441 || (!findSharedWaySegments && !es1.intersects(es2))) 442 442 continue; 443 443 444 List<Way> prims = Arrays.asList(es1. way, es2.way);444 List<Way> prims = Arrays.asList(es1.getWay(), es2.getWay()); 445 445 if ((highlight = crossingWays.get(prims)) == null) { 446 446 highlight = new ArrayList<>(); -
trunk/src/org/openstreetmap/josm/data/validation/tests/LongSegment.java
r17761 r17896 107 107 errors.add(TestError.builder(this, Severity.WARNING, LONG_SEGMENT) 108 108 .message(tr("Long segments"), marktr("Very long segment of {0} kilometers"), length.intValue()) 109 .primitives(waySegment. way)109 .primitives(waySegment.getWay()) 110 110 .highlightWaySegments(Collections.singleton(waySegment)) 111 111 .build()); -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
r17786 r17896 107 107 for (WaySegment ws : duplicated) { 108 108 // order in set is important 109 grouped.computeIfAbsent(OsmUtils.getLayer(ws. way), k -> new LinkedHashSet<>()).add(ws);109 grouped.computeIfAbsent(OsmUtils.getLayer(ws.getWay()), k -> new LinkedHashSet<>()).add(ws); 110 110 } 111 111 grouped.values().forEach(group -> analyseOverlaps(group, seenWays)); … … 122 122 return; 123 123 124 List<Way> currentWays = duplicated.stream().map(ws -> ws. way).collect(Collectors.toList());124 List<Way> currentWays = duplicated.stream().map(ws -> ws.getWay()).collect(Collectors.toList()); 125 125 Collection<WaySegment> highlight; 126 126 if ((highlight = seenWays.get(currentWays)) != null) { … … 134 134 int numAreas = 0; 135 135 for (WaySegment ws : duplicated) { 136 boolean isArea = ws. way.concernsArea();137 if (ws. way.hasKey(HIGHWAY)) {136 boolean isArea = ws.getWay().concernsArea(); 137 if (ws.getWay().hasKey(HIGHWAY)) { 138 138 if (!isArea) { 139 139 countHighway++; 140 140 } 141 } else if (ws. way.hasKey(RAILWAY)) {141 } else if (ws.getWay().hasKey(RAILWAY)) { 142 142 if (!isArea) { 143 143 countRailway++; 144 144 } 145 } else if (ws. way.hasKey(WATERWAY)) {145 } else if (ws.getWay().hasKey(WATERWAY)) { 146 146 if (!isArea) { 147 147 countWaterway++; 148 148 } 149 149 } else { 150 if (ws. way.getInterestingTags().isEmpty() && parentMultipolygonConcernsArea(ws.way))150 if (ws.getWay().getInterestingTags().isEmpty() && parentMultipolygonConcernsArea(ws.getWay())) 151 151 isArea = true; 152 if (!isArea && isOtherLinear(ws. way)) {152 if (!isArea && isOtherLinear(ws.getWay())) { 153 153 countOther++; 154 154 } -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r17841 r17896 1259 1259 // makes the order of nearestList dependent on current selection state 1260 1260 for (WaySegment ws : wss) { 1261 (ws. way.isSelected() ? nearestList : unselected).add(ws);1261 (ws.getWay().isSelected() ? nearestList : unselected).add(ws); 1262 1262 } 1263 1263 nearestList.addAll(unselected); … … 1307 1307 wayseg = ws; 1308 1308 } 1309 if (ntsel == null && ws. way.isSelected()) {1309 if (ntsel == null && ws.getWay().isSelected()) { 1310 1310 ntsel = ws; 1311 1311 } … … 1342 1342 wayseg = ws; 1343 1343 } 1344 if (useSelected && ws. way.isSelected()) {1344 if (useSelected && ws.getWay().isSelected()) { 1345 1345 return ws; 1346 1346 } … … 1350 1350 return ws; 1351 1351 } 1352 Collection<OsmPrimitive> wayRefs = ws. way.getReferrers();1352 Collection<OsmPrimitive> wayRefs = ws.getWay().getReferrers(); 1353 1353 // prefer member of the given relations 1354 1354 for (OsmPrimitive ref: preferredRefs) { … … 1392 1392 List<Way> nearestList = getNearestWaySegmentsImpl(p, predicate).values().stream() 1393 1393 .flatMap(Collection::stream) 1394 .filter(ws -> wset.add(ws. way))1395 .map(ws -> ws. way)1394 .filter(ws -> wset.add(ws.getWay())) 1395 .map(ws -> ws.getWay()) 1396 1396 .collect(Collectors.toList()); 1397 1397 if (ignore != null) { … … 1428 1428 public final Way getNearestWay(Point p, Predicate<OsmPrimitive> predicate) { 1429 1429 WaySegment nearestWaySeg = getNearestWaySegment(p, predicate); 1430 return (nearestWaySeg == null) ? null : nearestWaySeg. way;1430 return (nearestWaySeg == null) ? null : nearestWaySeg.getWay(); 1431 1431 } 1432 1432 … … 1546 1546 if (ws == null) return osm; 1547 1547 1548 if ((ws. way.isSelected() && useSelected) || osm == null) {1548 if ((ws.getWay().isSelected() && useSelected) || osm == null) { 1549 1549 // either (no _selected_ nearest node found, if desired) or no nearest node was found 1550 osm = ws. way;1550 osm = ws.getWay(); 1551 1551 } else { 1552 1552 int maxWaySegLenSq = 3*PROP_SNAP_DISTANCE.get(); … … 1560 1560 if (wp1.distanceSq(wp2) < maxWaySegLenSq && 1561 1561 p.distanceSq(project(0.5, wp1, wp2)) < p.distanceSq(getPoint2D((Node) osm))) { 1562 osm = ws. way;1562 osm = ws.getWay(); 1563 1563 } 1564 1564 } … … 1603 1603 List<OsmPrimitive> nearestList = getNearestWaySegmentsImpl(p, predicate).values().stream() 1604 1604 .flatMap(Collection::stream) 1605 .filter(ws -> wset.add(ws. way))1606 .map(ws -> ws. way)1605 .filter(ws -> wset.add(ws.getWay())) 1606 .map(ws -> ws.getWay()) 1607 1607 .collect(Collectors.toList()); 1608 1608 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r17261 r17896 562 562 @Override 563 563 public void visit(WaySegment ws) { 564 if (ws. lowerIndex < 0 || ws.lowerIndex + 1 >= ws.way.getNodesCount())564 if (ws.getLowerIndex() < 0 || ws.getUpperIndex() >= ws.getWay().getNodesCount()) 565 565 return; 566 566 visit(ws.getFirstNode()); -
trunk/src/org/openstreetmap/josm/gui/layer/validation/PaintVisitor.java
r15586 r17896 207 207 @Override 208 208 public void visit(WaySegment ws) { 209 if (ws. lowerIndex < 0 || ws.lowerIndex + 1 >= ws.way.getNodesCount())209 if (ws.getLowerIndex() < 0 || ws.getUpperIndex() >= ws.getWay().getNodesCount()) 210 210 return; 211 211 drawSegment(ws.getFirstNode(), ws.getSecondNode(), color);
Note:
See TracChangeset
for help on using the changeset viewer.