Changeset 15121 in josm
- Timestamp:
- 2019-05-27T12:37:31+02:00 (6 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/gpx-extensions.xsd
r7937 r15121 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://josm.openstreetmap.de/gpx-extensions-1.0" 3 3 xmlns:tns="http://josm.openstreetmap.de/gpx-extensions-1.0" elementFormDefault="qualified"> 4 4 5 5 <!-- true, if gpx data has been downloaded from the osm server --> -
trunk/src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java
r14682 r15121 152 152 final HashMap<String, Integer> names = new HashMap<>(); 153 153 for (int i = 0; i < flat.size(); i++) { 154 if (!wct.get(i).isOnewayLoopBackwardPart) { 155 if (!wct.get(i).direction.isRoundabout()) { 156 if (!wct.get(i).linkPrev && !trkseg.isEmpty()) { 157 gpxData.addTrack(new ImmutableGpxTrack(trk, trkAttr)); 158 trkAttr.clear(); 159 trk.clear(); 160 trkseg.clear(); 161 trk.add(trkseg); 162 } 163 if (trkAttr.isEmpty()) { 164 flat.get(i).getWay().referrers(Relation.class) 165 .filter(relsFound::contains) 166 .findFirst() 167 .ifPresent(r -> { 168 trkAttr.put("name", r.getName() != null ? r.getName() : r.getId()); 169 trkAttr.put("desc", tr("based on osm route relation data, timestamps are synthetic")); 170 }); 171 GpxData.ensureUniqueName(trkAttr, names); 172 } 173 List<Node> ln = flat.get(i).getWay().getNodes(); 174 if (wct.get(i).direction == WayConnectionType.Direction.BACKWARD) 175 Collections.reverse(ln); 176 for (Node n: ln) { 177 trkseg.add(OsmDataLayer.nodeToWayPoint(n, TimeUnit.SECONDS.toMillis(time))); 178 time += 1; 179 } 154 WayConnectionType wayConnectionType = wct.get(i); 155 if (!wayConnectionType.isOnewayLoopBackwardPart && !wayConnectionType.direction.isRoundabout()) { 156 if (!wayConnectionType.linkPrev && !trkseg.isEmpty()) { 157 gpxData.addTrack(new ImmutableGpxTrack(trk, trkAttr)); 158 trkAttr.clear(); 159 trk.clear(); 160 trkseg.clear(); 161 trk.add(trkseg); 162 } 163 if (trkAttr.isEmpty()) { 164 flat.get(i).getWay().referrers(Relation.class) 165 .filter(relsFound::contains) 166 .findFirst() 167 .ifPresent(r -> { 168 trkAttr.put("name", r.getName() != null ? r.getName() : r.getId()); 169 trkAttr.put("desc", tr("based on osm route relation data, timestamps are synthetic")); 170 }); 171 GpxData.ensureUniqueName(trkAttr, names); 172 } 173 List<Node> ln = flat.get(i).getWay().getNodes(); 174 if (wayConnectionType.direction == WayConnectionType.Direction.BACKWARD) 175 Collections.reverse(ln); 176 for (Node n: ln) { 177 trkseg.add(OsmDataLayer.nodeToWayPoint(n, TimeUnit.SECONDS.toMillis(time))); 178 time += 1; 180 179 } 181 180 } -
trunk/src/org/openstreetmap/josm/data/StructUtils.java
r14977 r15121 147 147 * @return the resulting map (same data content as <code>struct</code>) 148 148 */ 149 public static <T> Map<String, String> serializeStruct(T struct, Class<T> klass) {149 public static <T> HashMap<String, String> serializeStruct(T struct, Class<T> klass) { 150 150 T structPrototype; 151 151 try { … … 155 155 } 156 156 157 Map<String, String> hash = new LinkedHashMap<>();157 HashMap<String, String> hash = new LinkedHashMap<>(); 158 158 for (Field f : klass.getDeclaredFields()) { 159 159 if (f.getAnnotation(StructEntry.class) == null) { -
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r14853 r15121 461 461 462 462 List<GpxTrack> trks = getTracks().stream() 463 .flatMap(trk -> { 464 return trk.getSegments().stream().map(seg -> { 463 .flatMap(trk -> trk.getSegments().stream().map(seg -> { 465 464 HashMap<String, Object> attrs = new HashMap<>(trk.getAttributes()); 466 465 ensureUniqueName(attrs, counts); 467 466 return new ImmutableGpxTrack(Arrays.asList(seg), attrs); 468 }); 469 }) 467 })) 470 468 .collect(Collectors.toCollection(ArrayList<GpxTrack>::new)); 471 469 -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java
r13907 r15121 8 8 import java.util.Date; 9 9 import java.util.List; 10 import java.util.Objects; 10 11 11 12 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 137 138 */ 138 139 public boolean isClosed() { 139 return getNumNodes() >= 3 && nodeIds.get(0) == nodeIds.get(nodeIds.size()-1);140 return getNumNodes() >= 3 && Objects.equals(nodeIds.get(0), nodeIds.get(nodeIds.size()-1)); 140 141 } 141 142 -
trunk/src/org/openstreetmap/josm/data/validation/Test.java
r14599 r15121 324 324 */ 325 325 public boolean isCanceled() { 326 return progressMonitor != null ? progressMonitor.isCanceled() : false;326 return progressMonitor != null && progressMonitor.isCanceled(); 327 327 } 328 328 -
trunk/src/org/openstreetmap/josm/data/validation/tests/PublicTransportRouteTest.java
r14473 r15121 52 52 .build()); 53 53 return; 54 } else if (member.hasRole("") && OsmPrimitiveType.WAY .equals(member.getType())) {54 } else if (member.hasRole("") && OsmPrimitiveType.WAY == member.getType()) { 55 55 membersToCheck.add(member); 56 56 routeNodes.addAll(member.getWay().getNodes()); … … 67 67 || !(i == links.size() - 1 || link.linkNext) 68 68 || link.direction == null 69 || WayConnectionType.Direction.NONE .equals(link.direction);69 || WayConnectionType.Direction.NONE == link.direction; 70 70 if (hasError) { 71 71 errors.add(TestError.builder(this, Severity.WARNING, 3602) … … 79 79 for (RelationMember member : r.getMembers()) { 80 80 if (member.hasRole("stop", "stop_exit_only", "stop_entry_only") 81 && OsmPrimitiveType.NODE .equals(member.getType())81 && OsmPrimitiveType.NODE == member.getType() 82 82 && !routeNodes.contains(member.getNode())) { 83 83 errors.add(TestError.builder(this, Severity.WARNING, 3603) -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r15041 r15121 102 102 @Override 103 103 public void mapPaintStylesUpdated() { 104 SwingUtilities.invokeLater(() -> {104 SwingUtilities.invokeLater(() -> 105 105 // Trigger a repaint of all data layers 106 106 MainApplication.getLayerManager().getLayers() 107 107 .stream() 108 108 .filter(layer -> layer instanceof OsmDataLayer) 109 .forEach(Layer::invalidate) ;110 });109 .forEach(Layer::invalidate) 110 ); 111 111 } 112 112 -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayerInfo.java
r9751 r15121 99 99 */ 100 100 public void setDoSaveToFile(boolean doSaveToFile) { 101 this.doSaveToFile = isSavable() ? doSaveToFile : false;101 this.doSaveToFile = isSavable() && doSaveToFile; 102 102 } 103 103 … … 117 117 */ 118 118 public void setDoUploadToServer(boolean doUploadToServer) { 119 this.doUploadToServer = isUploadable() ? doUploadToServer : false;119 this.doUploadToServer = isUploadable() && doUploadToServer; 120 120 } 121 121 -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r15117 r15121 604 604 List<String> forbiddenTerms = Config.getPref().getList(preferencePrefix+".forbidden-terms", defForbidden) 605 605 .stream().map(UploadAction::lower) 606 .filter(x -> uploadValueLc.contains(x) && !exceptions.stream().anyMatch(uploadValueLc::contains))606 .filter(x -> uploadValueLc.contains(x) && exceptions.stream().noneMatch(uploadValueLc::contains)) 607 607 .collect(Collectors.toList()); 608 608 if (!forbiddenTerms.isEmpty()) { -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r14668 r15121 1132 1132 @Override 1133 1133 public boolean checkSaveConditions() { 1134 if (isDataSetEmpty() && 1 != GuiHelper.runInEDTAndWaitAndReturn(() -> {1135 returnnew ExtendedDialog(1134 if (isDataSetEmpty() && 1 != GuiHelper.runInEDTAndWaitAndReturn(() -> 1135 new ExtendedDialog( 1136 1136 MainApplication.getMainFrame(), 1137 1137 tr("Empty document"), … … 1139 1139 .setContent(tr("The document contains no data.")) 1140 1140 .setButtonIcons("save", "cancel") 1141 .showDialog().getValue() ;1142 })) {1141 .showDialog().getValue() 1142 )) { 1143 1143 return false; 1144 1144 } -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r14152 r15121 406 406 } 407 407 for (ColorEntry e : tableModel.getData()) { 408 if (e.info.getValue() != null) { 409 if (e.toProperty().put(e.info.getValue()) 410 && NamedColorProperty.COLOR_CATEGORY_MAPPAINT.equals(e.info.getCategory())) { 411 ret = true; 412 } 408 if (e.info.getValue() != null && e.toProperty().put(e.info.getValue()) 409 && NamedColorProperty.COLOR_CATEGORY_MAPPAINT.equals(e.info.getCategory())) { 410 ret = true; 413 411 } 414 412 } -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryProvidersPanel.java
r15116 r15121 319 319 activeToolbar.add(new NewEntryAction(ImageryInfo.ImageryType.TMS)); 320 320 activeToolbar.add(new NewEntryAction(ImageryInfo.ImageryType.WMTS)); 321 //activeToolbar.add(edit); TODO322 321 activeToolbar.add(remove); 323 322 add(activeToolbar, GBC.eol().anchor(GBC.NORTH).insets(0, 0, 5, 5)); … … 698 697 case 3: 699 698 return info.getExtendedUrl(); 700 } 701 return null; 699 default: 700 return null; 701 } 702 702 } 703 703 -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r15116 r15121 55 55 import org.openstreetmap.josm.gui.util.GuiHelper; 56 56 import org.openstreetmap.josm.gui.widgets.FilterField; 57 import org.openstreetmap.josm.gui.widgets.JosmTextField;58 57 import org.openstreetmap.josm.plugins.PluginDownloadTask; 59 58 import org.openstreetmap.josm.plugins.PluginInformation; … … 82 81 } 83 82 84 private JosmTextField tfFilter;85 83 private PluginListPanel pnlPluginPreferences; 86 84 private PluginPreferencesModel model; … … 190 188 gc.gridx = 1; 191 189 gc.weightx = 1.0; 192 tfFilter =new FilterField().filter(expr -> {190 pnl.add(new FilterField().filter(expr -> { 193 191 model.filterDisplayedPlugins(expr); 194 192 pnlPluginPreferences.refreshView(); 195 }); 196 pnl.add(tfFilter, gc); 193 }), gc); 197 194 return pnl; 198 195 } -
trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java
r15006 r15121 160 160 "0687260331a72403d909f105e69bcf0d32e1bd2493ffc6d9206d11bcd6770739", 161 161 "https://acme-v02.api.letsencrypt.org"), 162 // Government of Netherlands162 // #14649 - Government of Netherlands - for PDOK aerial imagery at https://geodata.nationaalgeoregister.nl 163 163 new NativeCertAmend(Collections.singleton("Staat der Nederlanden Root CA - G2"), 164 164 "Staat_der_Nederlanden_Root_CA_-_G2.crt", 165 165 "668c83947da63b724bece1743c31a0e6aed0db8ec5b31be377bb784f91b6716f", 166 166 "https://roottest-g2.pkioverheid.nl"), 167 // Government of Netherlands167 // #14649 - Government of Netherlands - for PDOK aerial imagery at https://geodata.nationaalgeoregister.nl 168 168 new NativeCertAmend(Arrays.asList("Government of Netherlands G3", "Staat der Nederlanden Root CA - G3"), 169 169 "Staat_der_Nederlanden_Root_CA_-_G3.crt", 170 170 "3c4fb0b95ab8b30032f432b86f535fe172c185d0fd39865837cf36187fa6f428", 171 171 "https://roottest-g3.pkioverheid.nl"), 172 // Trusted and used by French Government- https://www.certigna.fr/autorites/index.xhtml?ac=Racine#lracine172 // #15178 - Trusted and used by French Government - for cadastre - https://www.certigna.fr/autorites/index.xhtml?ac=Racine#lracine 173 173 new NativeCertAmend(Collections.singleton("Certigna"), 174 174 "Certigna.crt", 175 175 "e3b6a2db2ed7ce48842f7ac53241c7b71d54144bfb40c11f3f1d0b42f5eea12d", 176 176 "https://www.certigna.fr"), 177 // Trusted and used by Slovakian Government - https://eidas.disig.sk/en/cacert/177 // #16307 - Trusted and used by Slovakian Government - https://eidas.disig.sk/en/cacert/ 178 178 new NativeCertAmend(Collections.singleton("CA Disig Root R2"), 179 179 "CA_Disig_Root_R2.pem", 180 180 "e23d4a036d7b70e9f595b1422079d2b91edfbb1fb651a0633eaa8a9dc5f80703", 181 181 "https://eidas.disig.sk"), 182 // Government of Taiwan- https://grca.nat.gov.tw/GRCAeng/index.html182 // #17062 - Government of Taiwan - for https://data.gov.tw/license - https://grca.nat.gov.tw/GRCAeng/index.html 183 183 new NativeCertAmend(Arrays.asList("TW Government Root Certification Authority", "Government Root Certification Authority"), 184 184 "Taiwan_GRCA.pem", -
trunk/src/org/openstreetmap/josm/spi/preferences/DefaultPreferenceChangeEvent.java
r14977 r15121 9 9 */ 10 10 public class DefaultPreferenceChangeEvent extends EventObject implements PreferenceChangeEvent { 11 12 private static final long serialVersionUID = 1L; 11 13 12 14 private final String key; -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r15006 r15121 33 33 34 34 /** 35 * {@code PlatformHook} implementation for Apple Mac OS Xsystems.35 * {@code PlatformHook} implementation for Apple macOS (formerly Mac OS X) systems. 36 36 * @since 1023 37 37 */
Note:
See TracChangeset
for help on using the changeset viewer.