Changeset 13216 in josm
- Timestamp:
- 2017-12-17T22:31:30+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java
r13210 r13216 77 77 */ 78 78 public ExportRelationToGpxAction(EnumSet<Mode> mode) { 79 super(tr("{0} starting from {1} member", 80 mode.contains(TO_FILE) ? tr("Export GPX file") : tr("Convert to GPX layer"), 81 mode.contains(FROM_FIRST_MEMBER) ? tr("first") : tr("last")), 82 mode.contains(TO_FILE) ? "exportgpx" : "dialogs/layerlist", 83 tr("Flatten this relation to a single gpx track "+ 84 "recursively, starting with the {0} member(s), "+ 85 "successively continuing to the {1}.", 86 mode.contains(FROM_FIRST_MEMBER) ? tr("first") : tr("last"), 87 mode.contains(FROM_FIRST_MEMBER) ? tr("last") : tr("first")), 88 null, false, null, false); 79 super(name(mode), mode.contains(TO_FILE) ? "exportgpx" : "dialogs/layerlist", tooltip(mode), 80 null, false, null, false); 89 81 putValue("help", ht("/Action/ExportRelationToGpx")); 90 82 this.mode = mode; 83 } 84 85 private static String name(EnumSet<Mode> mode) { 86 if (mode.contains(TO_FILE)) { 87 if (mode.contains(FROM_FIRST_MEMBER)) { 88 return tr("Export GPX file starting from first member"); 89 } else { 90 return tr("Export GPX file starting from last member"); 91 } 92 } else { 93 if (mode.contains(FROM_FIRST_MEMBER)) { 94 return tr("Convert to GPX layer starting from first member"); 95 } else { 96 return tr("Convert to GPX layer starting from last member"); 97 } 98 } 99 } 100 101 private static String tooltip(EnumSet<Mode> mode) { 102 if (mode.contains(FROM_FIRST_MEMBER)) { 103 return tr("Flatten this relation to a single gpx track recursively, " + 104 "starting with the first member(s), successively continuing to the last."); 105 } else { 106 return tr("Flatten this relation to a single gpx track recursively, " + 107 "starting with the last member(s), successively continuing to the first."); 108 } 91 109 } 92 110 … … 163 181 trk.add(trkseg); 164 182 165 //RelationSorter.sortMembersByConnectivity(defaultMembers); // preserve given order166 183 List<WayConnectionType> wct = new WayConnectionTypeCalculator().updateLinks(flat); 167 184 final HashMap<String, Integer> names = new HashMap<>(); … … 176 193 trk.add(trkseg); 177 194 } 178 if (trkAttr.isEmpty() /* && (!wct.get(i).linkNext || (i+1 == flat.size()))*/) {195 if (trkAttr.isEmpty()) { 179 196 Relation r = Way.getParentRelations(Arrays.asList(flat.get(i).getWay())) 180 197 .stream().filter(relsFound::contains).findFirst().orElseGet(null); … … 201 218 } 202 219 203 //Relation debug = new Relation(); debug.setMembers(flat);204 //MainApplication.getLayerManager().getEditDataSet().addPrimitive(debug);205 220 return new GpxLayer(gpxData, layerName, true); 206 221 }
Note:
See TracChangeset
for help on using the changeset viewer.