Changeset 10716 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2016-08-03T15:30:04+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r10619 r10716 94 94 for (Node node : selectedNodes) { 95 95 List<WaySegment> wss = Main.map.mapView.getNearestWaySegments( 96 Main.map.mapView.getPoint(node), OsmPrimitive .isSelectablePredicate);96 Main.map.mapView.getPoint(node), OsmPrimitive::isSelectable); 97 97 98 98 MultiMap<Way, Integer> insertPoints = new MultiMap<>(); -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r10552 r10716 73 73 if (selectedNodes.size() == 1) { 74 74 List<Node> nearestNodes = Main.map.mapView.getNearestNodes( 75 Main.map.mapView.getPoint(selectedNodes.get(0)), selectedNodes, OsmPrimitive .isUsablePredicate);75 Main.map.mapView.getPoint(selectedNodes.get(0)), selectedNodes, OsmPrimitive::isUsable); 76 76 if (nearestNodes.isEmpty()) { 77 77 new Notification( -
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r10657 r10716 134 134 @Override 135 135 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 136 setEnabled(selection.stream().anyMatch( OsmPrimitive.wayPredicate));136 setEnabled(selection.stream().anyMatch(Way.class::isInstance)); 137 137 } 138 138 } -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r10657 r10716 255 255 private static boolean isUsedInRelations(final Collection<Node> existingNodes) { 256 256 return existingNodes.stream().anyMatch( 257 selectedNode -> selectedNode.getReferrers().stream().anyMatch( OsmPrimitive.relationPredicate));257 selectedNode -> selectedNode.getReferrers().stream().anyMatch(Relation.class::isInstance)); 258 258 } 259 259 -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r10467 r10716 362 362 DeleteParameters result = new DeleteParameters(); 363 363 364 result.nearestNode = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive .isSelectablePredicate);364 result.nearestNode = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive::isSelectable); 365 365 if (result.nearestNode == null) { 366 result.nearestSegment = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive .isSelectablePredicate);366 result.nearestSegment = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive::isSelectable); 367 367 if (result.nearestSegment != null) { 368 368 if (shift) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10678 r10716 399 399 400 400 boolean newNode = false; 401 Node n = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive .isSelectablePredicate);401 Node n = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive::isSelectable); 402 402 if (ctrl) { 403 403 Iterator<Way> it = ds.getSelectedWays().iterator(); … … 469 469 // Insert the node into all the nearby way segments 470 470 List<WaySegment> wss = Main.map.mapView.getNearestWaySegments( 471 Main.map.mapView.getPoint(n), OsmPrimitive .isSelectablePredicate);471 Main.map.mapView.getPoint(n), OsmPrimitive::isSelectable); 472 472 if (snapHelper.isActive()) { 473 473 tryToMoveNodeOnIntersection(wss, n); … … 761 761 */ 762 762 private void tryToSetBaseSegmentForAngleSnap() { 763 WaySegment seg = Main.map.mapView.getNearestWaySegment(mousePos, OsmPrimitive .isSelectablePredicate);763 WaySegment seg = Main.map.mapView.getNearestWaySegment(mousePos, OsmPrimitive::isSelectable); 764 764 if (seg != null) { 765 765 snapHelper.setBaseSegment(seg); … … 790 790 791 791 if (!ctrl && mousePos != null) { 792 currentMouseNode = mv.getNearestNode(mousePos, OsmPrimitive .isSelectablePredicate);792 currentMouseNode = mv.getNearestNode(mousePos, OsmPrimitive::isSelectable); 793 793 } 794 794 … … 796 796 // *and* there is no node nearby (because nodes beat ways when re-using) 797 797 if (!ctrl && currentMouseNode == null) { 798 List<WaySegment> wss = mv.getNearestWaySegments(mousePos, OsmPrimitive .isSelectablePredicate);798 List<WaySegment> wss = mv.getNearestWaySegments(mousePos, OsmPrimitive::isSelectable); 799 799 for (WaySegment ws : wss) { 800 800 mouseOnExistingWays.add(ws.way); … … 1088 1088 // This happens when nothing is selected, but we still want to highlight the "target node" 1089 1089 if (mouseOnExistingNode == null && getLayerManager().getEditDataSet().selectionEmpty() && mousePos != null) { 1090 mouseOnExistingNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive .isSelectablePredicate);1090 mouseOnExistingNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive::isSelectable); 1091 1091 } 1092 1092 -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r10463 r10716 391 391 updateKeyModifiers(e); 392 392 393 selectedNode = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive .isSelectablePredicate);394 selectedSegment = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive .isSelectablePredicate);393 selectedNode = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive::isSelectable); 394 selectedSegment = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive::isSelectable); 395 395 396 396 // If nothing gets caught, stay in select mode … … 570 570 private static void addNewNode(MouseEvent e) { 571 571 // Should maybe do the same as in DrawAction and fetch all nearby segments? 572 WaySegment ws = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive .isSelectablePredicate);572 WaySegment ws = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive::isSelectable); 573 573 if (ws != null) { 574 574 Node n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY())); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyHelper.java
r8590 r10716 41 41 } 42 42 43 Node node = mv.getNearestNode(p, OsmPrimitive .isSelectablePredicate);43 Node node = mv.getNearestNode(p, OsmPrimitive::isSelectable); 44 44 Way candidate = null; 45 45 … … 57 57 } 58 58 59 return Main.map.mapView.getNearestWay(p, OsmPrimitive .isSelectablePredicate);59 return Main.map.mapView.getNearestWay(p, OsmPrimitive::isSelectable); 60 60 } 61 61 -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r10463 r10716 321 321 if (!mouseHasBeenDragged) { 322 322 // use point from press or click event? (or are these always the same) 323 Way nearestWay = mv.getNearestWay(e.getPoint(), OsmPrimitive .isSelectablePredicate);323 Way nearestWay = mv.getNearestWay(e.getPoint(), OsmPrimitive::isSelectable); 324 324 if (nearestWay == null) { 325 325 if (matchesCurrentModifiers(setSelectedModifierCombo)) { … … 522 522 // TODO: rename 523 523 private boolean initParallelWays(Point p, boolean copyTags) { 524 referenceSegment = mv.getNearestWaySegment(p, Way.isUsablePredicate, true);524 referenceSegment = mv.getNearestWaySegment(p, OsmPrimitive::isUsable, true); 525 525 if (referenceSegment == null) 526 526 return false; -
trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java
r9971 r10716 27 27 // Diamond operator does not work with Java 9 here 28 28 return new SubclassFilteredCollection<OsmPrimitive, Relation>( 29 primitives, OsmPrimitive.relationPredicate);29 primitives, Relation.class::isInstance); 30 30 } 31 31 }
Note:
See TracChangeset
for help on using the changeset viewer.