Changeset 10658 in josm for trunk/src/org
- Timestamp:
- 2016-07-27T02:16:37+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r10601 r10658 26 26 import java.util.Objects; 27 27 import java.util.Set; 28 import java.util.function.Predicate; 28 29 29 30 import javax.swing.ButtonGroup; … … 54 55 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; 55 56 import org.openstreetmap.josm.tools.GBC; 56 import org.openstreetmap.josm.tools.Predicate;57 57 import org.openstreetmap.josm.tools.Shortcut; 58 58 import org.openstreetmap.josm.tools.Utils; … … 689 689 ++foundMatches; 690 690 } 691 } else if (setting.mode == SearchMode.add && !predicate. evaluate(osm) && matcher.match(osm)) {691 } else if (setting.mode == SearchMode.add && !predicate.test(osm) && matcher.match(osm)) { 692 692 selection.add(osm); 693 693 ++foundMatches; 694 } else if (setting.mode == SearchMode.remove && predicate. evaluate(osm) && matcher.match(osm)) {694 } else if (setting.mode == SearchMode.remove && predicate.test(osm) && matcher.match(osm)) { 695 695 selection.remove(osm); 696 696 ++foundMatches; 697 } else if (setting.mode == SearchMode.in_selection && predicate. evaluate(osm) && !matcher.match(osm)) {697 } else if (setting.mode == SearchMode.in_selection && predicate.test(osm) && !matcher.match(osm)) { 698 698 selection.remove(osm); 699 699 --foundMatches; -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r10378 r10658 5 5 import java.util.Set; 6 6 import java.util.TreeSet; 7 import java.util.function.Predicate; 7 8 8 9 import org.openstreetmap.josm.Main; … … 13 14 import org.openstreetmap.josm.data.projection.Projections; 14 15 import org.openstreetmap.josm.tools.CheckParameterUtil; 15 import org.openstreetmap.josm.tools.Predicate;16 16 import org.openstreetmap.josm.tools.Utils; 17 17 … … 381 381 final boolean containsN = visited.contains(n); 382 382 visited.add(n); 383 if (!containsN && (predicate == null || predicate. evaluate(n))383 if (!containsN && (predicate == null || predicate.test(n)) 384 384 && n.isConnectedTo(otherNodes, hops - 1, predicate, visited)) { 385 385 return true; -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r10656 r10658 888 888 * @return {@code true} if the node is inside the multipolygon 889 889 */ 890 public static boolean isNodeInsideMultiPolygon(Node node, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) {890 public static boolean isNodeInsideMultiPolygon(Node node, Relation multiPolygon, java.util.function.Predicate<Way> isOuterWayAMatch) { 891 891 return isPolygonInsideMultiPolygon(Collections.singletonList(node), multiPolygon, isOuterWayAMatch); 892 892 } … … 902 902 * @return {@code true} if the polygon formed by nodes is inside the multipolygon 903 903 */ 904 public static boolean isPolygonInsideMultiPolygon(List<Node> nodes, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) { 904 public static boolean isPolygonInsideMultiPolygon(List<Node> nodes, Relation multiPolygon, 905 java.util.function.Predicate<Way> isOuterWayAMatch) { 905 906 // Extract outer/inner members from multipolygon 906 907 final MultiPolygonMembers mpm = new MultiPolygonMembers(multiPolygon); … … 936 937 if (!insideInner) { 937 938 // Final check using predicate 938 if (isOuterWayAMatch == null || isOuterWayAMatch. evaluate(out.ways.get(0)939 if (isOuterWayAMatch == null || isOuterWayAMatch.test(out.ways.get(0) 939 940 /* TODO give a better representation of the outer ring to the predicate */)) { 940 941 return true;
Note:
See TracChangeset
for help on using the changeset viewer.