Changeset 15240 in josm for trunk/src/org
- Timestamp:
- 2019-07-10T23:58:43+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/relation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r15238 r15240 20 20 import javax.swing.table.AbstractTableModel; 21 21 22 import org.openstreetmap.josm.data.osm.AbstractPrimitive; 22 23 import org.openstreetmap.josm.data.osm.DataSelectionListener; 23 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 381 382 */ 382 383 public Set<OsmPrimitive> getIncompleteMemberPrimitives() { 383 Set<OsmPrimitive> ret = new HashSet<>(); 384 for (RelationMember member : members) { 385 if (member.getMember().isIncomplete()) { 386 ret.add(member.getMember()); 387 } 388 } 389 return ret; 384 return members.stream().map(RelationMember::getMember).filter(AbstractPrimitive::isIncomplete).collect(Collectors.toSet()); 390 385 } 391 386 … … 396 391 */ 397 392 public Set<OsmPrimitive> getSelectedIncompleteMemberPrimitives() { 398 Set<OsmPrimitive> ret = new HashSet<>(); 399 for (RelationMember member : getSelectedMembers()) { 400 if (member.getMember().isIncomplete()) { 401 ret.add(member.getMember()); 402 } 403 } 404 return ret; 393 return getSelectedMembers().stream().map(RelationMember::getMember).filter(AbstractPrimitive::isIncomplete).collect(Collectors.toSet()); 405 394 } 406 395 … … 411 400 */ 412 401 public boolean hasIncompleteMembers() { 413 for (RelationMember member : members) { 414 if (member.getMember().isIncomplete()) 415 return true; 416 } 417 return false; 402 return members.stream().anyMatch(rm -> rm.getMember().isIncomplete()); 418 403 } 419 404 … … 424 409 */ 425 410 public boolean hasIncompleteSelectedMembers() { 426 for (RelationMember member : getSelectedMembers()) { 427 if (member.getMember().isIncomplete()) 428 return true; 429 } 430 return false; 411 return getSelectedMembers().stream().anyMatch(rm -> rm.getMember().isIncomplete()); 431 412 } 432 413 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorAction.java
r14214 r15240 90 90 91 91 protected final boolean canDownload() { 92 if (editorAccess.getEditor().getRelation() == null) 93 return false; 94 DataSet ds = editorAccess.getEditor().getRelation().getDataSet(); 92 DataSet ds = editorAccess.getEditor().getLayer().getDataSet(); 95 93 return !NetworkManager.isOffline(OnlineResource.OSM_API) && ds != null && !ds.isLocked() 96 94 && DownloadPolicy.BLOCKED != ds.getDownloadPolicy();
Note:
See TracChangeset
for help on using the changeset viewer.