Changeset 14624 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-12-31T19:36:59+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
r14153 r14624 237 237 oldMapMode = map.mapMode; 238 238 super.actionPerformed(e); 239 } 240 241 private static final class ConfirmOverwriteBookmarkDialog extends ExtendedDialog { 242 ConfirmOverwriteBookmarkDialog() { 243 super(MainApplication.getMainFrame(), tr("Overwrite"), new String[] {tr("Overwrite"), tr("Cancel")}); 244 contentInsets = new Insets(10, 15, 10, 15); 245 setContent(tr("Offset bookmark already exists. Overwrite?")); 246 setButtonIcons("ok", "cancel"); 247 } 239 248 } 240 249 … … 326 335 327 336 private boolean confirmOverwriteBookmark() { 328 ExtendedDialog dialog = new ExtendedDialog( 329 MainApplication.getMainFrame(), 330 tr("Overwrite"), 331 tr("Overwrite"), tr("Cancel") 332 ) { { 333 contentInsets = new Insets(10, 15, 10, 15); 334 } }; 335 dialog.setContent(tr("Offset bookmark already exists. Overwrite?")); 336 dialog.setButtonIcons("ok", "cancel"); 337 dialog.setupDialog(); 338 dialog.setVisible(true); 339 return dialog.getValue() == 1; 337 return new ConfirmOverwriteBookmarkDialog().showDialog().getValue() == 1; 340 338 } 341 339 -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r14374 r14624 327 327 } 328 328 329 /**330 * @param layerName the name of the new layer331 * @deprecated Use {@link #createNewLayer(DataSet, Optional)}332 * @return a newly constructed layer333 */334 @Deprecated335 protected OsmDataLayer createNewLayer(final String layerName) {336 return createNewLayer(Optional.ofNullable(layerName).filter(it -> !Utils.isStripEmpty(it)));337 }338 339 /**340 * @deprecated Use {@link #createNewLayer(Optional)}341 * @return a newly constructed layer342 */343 @Deprecated344 protected OsmDataLayer createNewLayer() {345 return createNewLayer(Optional.empty());346 }347 348 329 protected Optional<ProjectionBounds> computeBbox(Bounds bounds) { 349 330 BoundingXYVisitor v = new BoundingXYVisitor(); … … 361 342 // the user explicitly wants a new layer, we don't have any layer at all 362 343 // or it is not clear which layer to merge to 363 final OsmDataLayer layer = createNewLayer( newLayerName);344 final OsmDataLayer layer = createNewLayer(Optional.ofNullable(newLayerName).filter(it -> !Utils.isStripEmpty(it))); 364 345 MainApplication.getLayerManager().addLayer(layer, zoomAfterDownload); 365 346 return layer; -
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r14460 r14624 489 489 GpxData d = new GpxData(); 490 490 d.addTrack(trk); 491 return new GpxLayer(d, ensureUniqueName(attrs, counts)); }) 491 return new GpxLayer(d, ensureUniqueName(attrs, counts)); 492 }) 492 493 .forEachOrdered(layer -> MainApplication.getLayerManager().addLayer(layer)); 493 494 } … … 509 510 */ 510 511 public synchronized int getTrackSegsCount() { 511 return privateTracks.stream(). collect(Collectors.summingInt(t -> t.getSegments().size()));512 return privateTracks.stream().mapToInt(t -> t.getSegments().size()).sum(); 512 513 } 513 514 -
trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
r14210 r14624 27 27 * @since 14205 (extracted from gui.layer.geoimage.ImageEntry) 28 28 */ 29 public class GpxImageEntry implements Comparable<GpxImageEntry> , Cloneable{29 public class GpxImageEntry implements Comparable<GpxImageEntry> { 30 30 private File file; 31 31 private Integer exifOrientation; … … 73 73 74 74 /** 75 * Constructs a new {@code GpxImageEntry} from an existing instance. 76 * @param other existing instance 77 * @since 14624 78 */ 79 public GpxImageEntry(GpxImageEntry other) { 80 file = other.file; 81 exifOrientation = other.exifOrientation; 82 exifCoor = other.exifCoor; 83 exifImgDir = other.exifImgDir; 84 exifTime = other.exifTime; 85 isNewGpsData = other.isNewGpsData; 86 exifGpsTime = other.exifGpsTime; 87 pos = other.pos; 88 speed = other.speed; 89 elevation = other.elevation; 90 gpsTime = other.gpsTime; 91 width = other.width; 92 height = other.height; 93 tmp = other.tmp; 94 } 95 96 /** 75 97 * Constructs a new {@code GpxImageEntry}. 76 98 * @param file Path to image file on disk … … 311 333 public void setExifImgDir(Double exifDir) { 312 334 this.exifImgDir = exifDir; 313 }314 315 @Override316 public GpxImageEntry clone() {317 try {318 return (GpxImageEntry) super.clone();319 } catch (CloneNotSupportedException e) {320 throw new IllegalStateException(e);321 }322 335 } 323 336 … … 370 383 */ 371 384 public void createTmp() { 372 tmp = clone();385 tmp = new GpxImageEntry(this); 373 386 tmp.tmp = null; 374 387 } -
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java
r14261 r14624 78 78 */ 79 79 public static ThreadPoolExecutor getNewThreadPoolExecutor(String nameFormat, int workers, int hostLimit) { 80 ThreadPoolExecutor executor =new ThreadPoolExecutor(80 return new ThreadPoolExecutor( 81 81 workers, // keep core pool the same size as max, as we use unbounded queue so there will 82 82 workers, // be never more threads than corePoolSize … … 86 86 Utils.newThreadFactory(nameFormat, Thread.NORM_PRIORITY) 87 87 ); 88 return executor;89 88 } 90 89 -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Proj4DirGridShiftFileSource.java
r13647 r14624 10 10 import java.util.Collections; 11 11 import java.util.List; 12 import java.util.stream.Collectors; 12 13 14 import org.openstreetmap.josm.spi.preferences.Config; 13 15 import org.openstreetmap.josm.tools.Logging; 14 16 import org.openstreetmap.josm.tools.Platform; … … 74 76 } 75 77 78 private static List<File> visit(String prefSuffix, String... defaults) { 79 return Config.getPref().getList("ntv2.proj4.grid.dir." + prefSuffix, Arrays.asList(defaults)) 80 .stream().map(File::new).collect(Collectors.toList()); 81 } 82 76 83 @Override 77 84 public List<File> visitUnixoid() { 78 return Arrays.asList(new File("/usr/local/share/proj"), new File("/usr/share/proj"));85 return visit("unix", "/usr/local/share/proj", "/usr/share/proj"); 79 86 } 80 87 81 88 @Override 82 89 public List<File> visitWindows() { 83 return Arrays.asList(new File("C:\\PROJ\\NAD"));90 return visit("windows", "C:\\PROJ\\NAD"); 84 91 } 85 92 -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r14468 r14624 230 230 continue; 231 231 } 232 if (!s.highway && endnodesHighway.contains(en) && !s.w.concernsArea()) { 233 map.put(en, s.w); 234 } else if (endnodes.contains(en) && !s.w.concernsArea()) { 232 if (((!s.highway && endnodesHighway.contains(en)) || endnodes.contains(en)) && !s.w.concernsArea()) { 235 233 map.put(en, s.w); 236 234 } -
trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java
r14153 r14624 358 358 for (PluginInformation pi4: toDeletePlugins) { 359 359 pls.remove(pi4.name); 360 new File(Preferences.main().getPluginsDirectory(), pi4.name+".jar").deleteOnExit();360 Utils.deleteFile(new File(Preferences.main().getPluginsDirectory(), pi4.name+".jar")); 361 361 } 362 362 Config.getPref().putList("plugins", pls); -
trunk/src/org/openstreetmap/josm/io/OnlineResource.java
r14121 r14624 41 41 */ 42 42 public final void checkOfflineAccess(String downloadString, String resourceString) { 43 if (NetworkManager.isOffline(this) && downloadString .substring(downloadString.indexOf("://"))44 .startsWith(resourceString.substring(resourceString.indexOf("://")) )) {43 if (NetworkManager.isOffline(this) && downloadString 44 .startsWith(resourceString.substring(resourceString.indexOf("://")), downloadString.indexOf("://"))) { 45 45 throw new OfflineAccessException(tr("Unable to access ''{0}'': {1} not available (offline mode)", downloadString, getLocName())); 46 46 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r14377 r14624 10 10 import java.util.Collections; 11 11 import java.util.HashSet; 12 import java.util.Locale;13 12 import java.util.Set; 14 13 import java.util.concurrent.Future; … … 318 317 for (String item : args.get("select").split(",")) { 319 318 if (!item.isEmpty()) { 320 if (CURRENT_SELECTION.equals (item.toLowerCase(Locale.ENGLISH))) {319 if (CURRENT_SELECTION.equalsIgnoreCase(item)) { 321 320 isKeepingCurrentSelection = true; 322 321 continue;
Note:
See TracChangeset
for help on using the changeset viewer.