Changeset 32237 in osm for applications/editors/josm/plugins/pt_assistant
- Timestamp:
- 2016-06-14T17:33:13+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
r32233 r32237 3 3 import java.util.ArrayList; 4 4 5 import org.openstreetmap.josm. actions.DownloadPrimitiveAction;5 import org.openstreetmap.josm.Main; 6 6 import org.openstreetmap.josm.data.osm.PrimitiveId; 7 7 import org.openstreetmap.josm.data.osm.Relation; 8 import org.openstreetmap.josm.data.osm.RelationMember; 9 import org.openstreetmap.josm.gui.io.DownloadPrimitivesWithReferrersTask; 8 10 9 11 public class IncompleteMembersDownloadThread extends Thread { … … 19 21 public void run() { 20 22 21 synchronized (this) { 23 try { 24 synchronized (this) { 22 25 23 ArrayList<PrimitiveId> list = new ArrayList<>(); 24 list.add(relation); 25 DownloadPrimitiveAction.processItems(false, list, false, true); 26 ArrayList<PrimitiveId> list = new ArrayList<>(); 27 for (RelationMember rm : relation.getMembers()) { 28 list.add(rm); 29 } 26 30 27 28 notify(); 31 DownloadPrimitivesWithReferrersTask task = new DownloadPrimitivesWithReferrersTask(false, list, false, true, 32 null, null); 33 Thread t = new Thread(task); 34 t.start(); 35 t.join(); 29 36 30 } 37 38 } 39 40 } catch (InterruptedException e) { 41 // TODO Auto-generated catch block 42 e.printStackTrace(); 43 44 } 31 45 32 46 } -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java
r32233 r32237 176 176 String message = tr("The relation (id=" + r.getId() 177 177 + ") has incomplete members.\nThey need to be downloaded to proceed with validation of this relation.\nDo you want to download incomplete members?"); 178 JCheckBox checkbox = new JCheckBox(tr("Remember my choice and do not ask me again in this session"));178 JCheckBox checkbox = new JCheckBox(tr("Remember my choice and don't ask me again in this session")); 179 179 Object[] params = { message, checkbox }; 180 180 String[] options = { tr("Yes"), tr("No") }; -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java
r32235 r32237 28 28 29 29 public PTAssitantValidatorTest() { 30 31 30 super(tr("Public Transport Assistant tests"), 31 tr("Check if route relations are compatible with public transport version 2")); 32 32 } 33 33 … … 40 40 41 41 if (r.hasIncompleteMembers()) { 42 String message = tr("The relation (id=" + r.getId() 43 + ") has incomplete members.\nThey need to be downloaded to proceed with validation of this relation.\nDo you want to download incomplete members?"); 44 JCheckBox checkbox = new JCheckBox(tr("Remember my choice and do not ask me again in this session")); 45 Object[] params = { message, checkbox }; 46 String[] options = { tr("Yes"), tr("No") }; 47 int userInput = JOptionPane.showOptionDialog(null, params, 48 tr("Fetch Request"), JOptionPane.YES_NO_OPTION, 49 JOptionPane.QUESTION_MESSAGE, null, options, 0); 42 43 // IncompleteMembersDownloadDialog incompleteDialog = new 44 // IncompleteMembersDownloadDialog(r.getId()); 45 // 46 // int userInput = incompleteDialog.getUserSelection(); 47 48 String message = tr("The relation (id=" + r.getId() 49 + ") has incomplete members.\nThey need to be downloaded to proceed with validation of this relation.\nDo you want to download incomplete members?"); 50 JCheckBox checkbox = new JCheckBox(tr("Remember my choice and don't ask me again in this session")); 51 Object[] params = { message, checkbox }; 52 String[] options = { tr("Yes"), tr("No") }; 53 54 int userInput = Integer.MIN_VALUE; 55 userInput = JOptionPane.showOptionDialog(null, params, tr("Fetch Request"), JOptionPane.YES_NO_OPTION, 56 JOptionPane.QUESTION_MESSAGE, null, options, 0); 50 57 51 58 if (userInput == 0) { … … 61 68 } 62 69 63 64 70 } 65 66 71 } 67 72 … … 108 113 } 109 114 } 115 116 // List<Relation> primitives = new ArrayList<>(1); 117 // primitives.add(r); 118 // errors.add(new TestError(this, Severity.WARNING, tr("PT: test warning"), ERROR_CODE_DIRECTION, primitives)); 119 110 120 } 111 121
Note:
See TracChangeset
for help on using the changeset viewer.