Changeset 32338 in osm
- Timestamp:
- 2016-06-20T16:49:47+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/IncompleteMembersDownloadThread.java
r32277 r32338 2 2 3 3 import java.util.ArrayList; 4 import java.util.Collection; 4 5 6 import javax.swing.JOptionPane; 7 8 import org.openstreetmap.josm.Main; 9 import org.openstreetmap.josm.data.osm.Node; 5 10 import org.openstreetmap.josm.data.osm.PrimitiveId; 6 11 import org.openstreetmap.josm.data.osm.Relation; 7 12 import org.openstreetmap.josm.gui.io.DownloadPrimitivesWithReferrersTask; 13 import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; 8 14 9 15 public class IncompleteMembersDownloadThread extends Thread { 10 16 11 private Relation relation; 17 public IncompleteMembersDownloadThread() { 18 super(); 12 19 13 public IncompleteMembersDownloadThread(Relation r) {14 super();15 relation = r;16 20 } 17 21 18 22 private void realRun() { 19 23 // TODO 20 24 } 21 25 … … 23 27 public void run() { 24 28 25 26 synchronized (this) { 29 try { 30 synchronized (this) { 27 31 28 ArrayList<PrimitiveId> list = new ArrayList<>(1); 29 list.add(relation); 32 ArrayList<PrimitiveId> list = new ArrayList<>(); 30 33 31 DownloadPrimitivesWithReferrersTask task = new DownloadPrimitivesWithReferrersTask(false, list, false, true, 32 null, null); 33 Thread t = new Thread(task); 34 t.start(); 35 t.join(); 34 // add all route relations that are of public_transport version 2: 35 Collection<Relation> allRelations = Main.getLayerManager().getEditDataSet().getRelations(); 36 for (Relation currentRelation : allRelations) { 37 if (RouteUtils.isTwoDirectionRoute(currentRelation)) { 38 list.add(currentRelation); 39 } 40 } 41 42 // add all stop_positions: 43 Collection<Node> allNodes = Main.getLayerManager().getEditDataSet().getNodes(); 44 for (Node currentNode: allNodes) { 45 if (currentNode.hasTag("public_transport", "stop_position")) { 46 list.add(currentNode); 47 } 48 } 49 50 51 DownloadPrimitivesWithReferrersTask task = new DownloadPrimitivesWithReferrersTask(false, list, false, 52 true, null, null); 53 Thread t = new Thread(task); 54 t.start(); 55 t.join(); 36 56 57 } 58 59 } catch (InterruptedException e) { 60 // TODO Auto-generated catch block 61 e.printStackTrace(); 37 62 38 63 } 39 64 40 } catch (InterruptedException e) {41 // TODO Auto-generated catch block42 e.printStackTrace();43 44 }45 46 65 } 47 66 } -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/gui/IncompleteMembersDownloadDialog.java
r32330 r32338 29 29 selectedOption = Integer.MIN_VALUE; 30 30 31 message = tr("The relation (id={0}) has incomplete members.\n"+ 32 "They need to be downloaded to proceed with validation of this relation.\nDo you want to download incomplete members?", id); 31 // message = tr("The relation (id={0}) has incomplete members.\n"+ 32 // "They need to be downloaded to proceed with validation of this relation.\nDo you want to download incomplete members?", id); 33 message = tr("Route relations have incomplete members.\nThey need to be downloaded to proceed with validation.\nDo you want to download them?"); 33 34 checkbox = new JCheckBox(tr("Remember my choice and do not ask me again in this session")); 34 35 options = new String[2]; -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java
r32303 r32338 83 83 if (userInput == JOptionPane.YES_OPTION) { 84 84 85 Thread t = new IncompleteMembersDownloadThread( r);85 Thread t = new IncompleteMembersDownloadThread(); 86 86 t.start(); 87 87 synchronized (t) {
Note:
See TracChangeset
for help on using the changeset viewer.