Changeset 32398 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DownloadChosenRelationAction.java
- Timestamp:
- 2016-06-25T11:56:57+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DownloadChosenRelationAction.java
r32395 r32398 31 31 32 32 public DownloadChosenRelationAction(ChosenRelation rel) { 33 super();34 // putValue(NAME, "D");35 33 putValue(SMALL_ICON, ImageProvider.get("relcontext", "download")); 36 34 putValue(SHORT_DESCRIPTION, tr("Download incomplete members for the chosen relation")); … … 43 41 public void actionPerformed(ActionEvent e) { 44 42 Relation relation = rel.get(); 45 if (relation == null || relation.isNew() ) return;43 if (relation == null || relation.isNew()) return; 46 44 int total = relation.getMembersCount(); 47 45 int incomplete = relation.getIncompleteMembers().size(); 48 // if (incomplete <= 5 || (incomplete <= 10 && incomplete * 3 < total) ) 49 if (incomplete <= 10 && incomplete * 3 < total ) { 46 if (incomplete <= 10 && incomplete * 3 < total) { 50 47 downloadIncomplete(relation); 51 48 } else { … … 70 67 protected void downloadMembers(Relation rel) { 71 68 if (!rel.isNew()) { 72 Main.worker.submit(new DownloadRelationTask(Collections.singletonList(rel), Main. main.getEditLayer()));69 Main.worker.submit(new DownloadRelationTask(Collections.singletonList(rel), Main.getLayerManager().getEditLayer())); 73 70 } 74 71 } 75 72 76 73 protected void downloadIncomplete(Relation rel) { 77 if (rel.isNew() ) return;74 if (rel.isNew()) return; 78 75 Set<OsmPrimitive> ret = new HashSet<>(); 79 76 ret.addAll(rel.getIncompleteMembers()); 80 if (ret.isEmpty() ) return;81 Main.worker.submit(new DownloadRelationMemberTask(Collections.singletonList(rel), ret, Main. main.getEditLayer()));77 if (ret.isEmpty()) return; 78 Main.worker.submit(new DownloadRelationMemberTask(Collections.singletonList(rel), ret, Main.getLayerManager().getEditLayer())); 82 79 } 83 80 }
Note:
See TracChangeset
for help on using the changeset viewer.
