Ignore:
Timestamp:
2016-06-14T17:33:13+02:00 (9 years ago)
Author:
darya
Message:

Clarification

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  
    33import java.util.ArrayList;
    44
    5 import org.openstreetmap.josm.actions.DownloadPrimitiveAction;
     5import org.openstreetmap.josm.Main;
    66import org.openstreetmap.josm.data.osm.PrimitiveId;
    77import org.openstreetmap.josm.data.osm.Relation;
     8import org.openstreetmap.josm.data.osm.RelationMember;
     9import org.openstreetmap.josm.gui.io.DownloadPrimitivesWithReferrersTask;
    810
    911public class IncompleteMembersDownloadThread extends Thread {
     
    1921        public void run() {
    2022
    21                         synchronized (this) {
     23                 try {
     24                synchronized (this) {
    2225
    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                        }
    2630
    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();
    2936
    30                         }
     37
     38                }
     39
     40                 } catch (InterruptedException e) {
     41                 // TODO Auto-generated catch block
     42                 e.printStackTrace();
     43               
     44                 }
    3145
    3246        }
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java

    r32233 r32237  
    176176                                String message = tr("The relation (id=" + r.getId()
    177177                                                + ") 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"));
    179179                                Object[] params = { message, checkbox };
    180180                                String[] options = { tr("Yes"), tr("No") };
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java

    r32235 r32237  
    2828
    2929        public PTAssitantValidatorTest() {
    30                  super(tr("Public Transport Assistant tests"),
    31                  tr("Check if route relations are compatible with public transport version 2"));
     30                super(tr("Public Transport Assistant tests"),
     31                                tr("Check if route relations are compatible with public transport version 2"));
    3232        }
    3333
     
    4040
    4141                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);
    5057
    5158                        if (userInput == 0) {
     
    6168                                }
    6269
    63 
    6470                        }
    65 
    6671                }
    6772
     
    108113                        }
    109114                }
     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               
    110120        }
    111121
Note: See TracChangeset for help on using the changeset viewer.