- Timestamp:
- 2017-04-30T22:45:11+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r10467 r12031 90 90 Set<Way> waysRef = null; 91 91 for (Node n: nodes) { 92 Collection<Way> ref = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class);92 Collection<Way> ref = n.getParentWays(); 93 93 if (waysRef == null) 94 94 waysRef = new HashSet<>(ref); … … 187 187 if (selectedWays.isEmpty()) 188 188 // No selected way, all way containing this node are used 189 involvedWays = OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class);189 involvedWays = selectedNode.getParentWays(); 190 190 else 191 191 // Selected way, use only these ways -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r11737 r12031 371 371 if (selectedNodes.size() == 1) { 372 372 Node n = selectedNodes.get(0); 373 List<Way> referredWays = 374 OsmPrimitive.getFilteredList(n.getReferrers(), Way.class); 373 List<Way> referredWays = n.getParentWays(); 375 374 Way inTheMiddle = null; 376 375 for (Way w: referredWays) { -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r10717 r12031 96 96 checkAndConfirmOutlyingUnglue(); 97 97 int count = 0; 98 for (Way w : OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) {98 for (Way w : selectedNode.getParentWays()) { 99 99 if (!w.isUsable() || w.getNodesCount() < 1) { 100 100 continue; … … 126 126 for (Node n : selectedNodes) { 127 127 int count = 0; 128 for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {128 for (Way w : n.getParentWays()) { 129 129 if (!w.isUsable()) { 130 130 continue; … … 332 332 if (!(n instanceof Node)) 333 333 return false; 334 if ( OsmPrimitive.getFilteredList(n.getReferrers(), Way.class).isEmpty())334 if (((Node) n).getParentWays().isEmpty()) 335 335 return false; 336 336 … … 564 564 // According to previous check, only one valid way through that node 565 565 Way way = null; 566 for (Way w: OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) {566 for (Way w: selectedNode.getParentWays()) { 567 567 if (w.isUsable() && w.getNodesCount() >= 1) { 568 568 way = w; -
trunk/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java
r11339 r12031 152 152 153 153 // List of ways shared by all nodes 154 List<Way> result = new ArrayList<>( OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class));154 List<Way> result = new ArrayList<>(selectedNodes.get(0).getParentWays()); 155 155 for (int i = 1; i < selectedNodes.size(); i++) { 156 List< OsmPrimitive> ref = selectedNodes.get(i).getReferrers();156 List<Way> ref = selectedNodes.get(i).getParentWays(); 157 157 result.removeIf(way -> !ref.contains(way)); 158 158 } -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r11796 r12031 4 4 import java.awt.geom.Area; 5 5 import java.util.Collection; 6 import java.util.List; 6 7 import java.util.Objects; 7 8 import java.util.Set; … … 429 430 return coor != null && !coor.isIn(area); 430 431 } 432 433 /** 434 * Replies the set of referring ways. 435 * @return the set of referring ways 436 * @since 12031 437 */ 438 public List<Way> getParentWays() { 439 return getFilteredList(getReferrers(), Way.class); 440 } 431 441 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java
r11913 r12031 186 186 carsWays = 0; 187 187 188 for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {188 for (Way w : n.getParentWays()) { 189 189 String highway = w.get(HIGHWAY); 190 190 if (highway != null) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java
r11893 r12031 695 695 */ 696 696 static boolean unconnected(Environment e) { // NO_UCD (unused code) 697 return e.osm instanceof Node && OsmPrimitive.getFilteredList(e.osm.getReferrers(), Way.class).isEmpty();697 return e.osm instanceof Node && ((Node) e.osm).getParentWays().isEmpty(); 698 698 } 699 699
Note:
See TracChangeset
for help on using the changeset viewer.