Changeset 10181 in josm
- Timestamp:
- 2016-05-11T04:44:00+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r10131 r10181 287 287 case "download": 288 288 289 if (lastZoomTime > 0 && System.currentTimeMillis() - lastZoomTime > Main.pref.getLong("zoom.bounds.reset.time", 10 *1000)) {289 if (lastZoomTime > 0 && System.currentTimeMillis() - lastZoomTime > Main.pref.getLong("zoom.bounds.reset.time", 10L*1000L)) { 290 290 lastZoomTime = -1; 291 291 } -
trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
r9062 r10181 187 187 188 188 // 10 000 000 = 10 000 * 1000 = World * (km -> m) 189 zm.setText(Double.toString(Math.round(10000000 * Math.pow(2, (-1) * zoomLvl))));189 zm.setText(Double.toString(Math.round(10000000d * Math.pow(2d, (-1d) * zoomLvl)))); 190 190 } 191 191 } -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r9970 r10181 562 562 private static void execCommands(List<Command> cmds, List<Node> newNodes) { 563 563 Main.main.undoRedo.add(new SequenceCommand(/* for correct i18n of plural forms - see #9110 */ 564 trn("Dupe into {0} node", "Dupe into {0} nodes", newNodes.size() + 1 , newNodes.size() + 1), cmds));564 trn("Dupe into {0} node", "Dupe into {0} nodes", newNodes.size() + 1L, newNodes.size() + 1L), cmds)); 565 565 // select one of the new nodes 566 566 getCurrentDataSet().setSelected(newNodes.get(0)); -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10179 r10181 1142 1142 Point p2 = mv.getPoint(currentMouseEastNorth); 1143 1143 1144 double t = Math.atan2( p2.y-p1.y, p2.x-p1.x) + Math.PI;1144 double t = Math.atan2((double) p2.y - p1.y, (double) p2.x - p1.x) + Math.PI; 1145 1145 1146 1146 b.moveTo(p1.x, p1.y); … … 1483 1483 if (absoluteFix) { 1484 1484 b.moveTo(p2.x, p2.y); 1485 b.lineTo(2 *p1.x-p2.x, 2*p1.y-p2.y); // bi-directional line1485 b.lineTo(2f*p1.x-p2.x, 2f*p1.y-p2.y); // bi-directional line 1486 1486 } else { 1487 1487 b.moveTo(p2.x, p2.y); -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r10063 r10181 99 99 }; 100 100 101 private static final long MAX_AGE_DEFAULT_PREFERENCES = 60 * 60 * 24 * 50; // 50 days (in seconds)101 private static final long MAX_AGE_DEFAULT_PREFERENCES = 60L * 60L * 24L * 50L; // 50 days (in seconds) 102 102 103 103 /** -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r10134 r10181 26 26 import org.openstreetmap.josm.tools.HttpClient; 27 27 import org.openstreetmap.josm.tools.Utils; 28 29 import sun.net.www.protocol.http.HttpURLConnection; 28 30 29 31 /** … … 340 342 } 341 343 342 343 344 attributes = parseHeaders(urlConn); 344 345 345 346 for (int i = 0; i < 5; ++i) { 346 if (urlConn.getResponseCode() == 503) {347 Thread.sleep(5000 +(new Random()).nextInt(5000));347 if (urlConn.getResponseCode() == HttpURLConnection.HTTP_UNAVAILABLE) { 348 Thread.sleep(5000L+(new Random()).nextInt(5000)); 348 349 continue; 349 350 } … … 351 352 attributes.setResponseCode(urlConn.getResponseCode()); 352 353 byte[] raw; 353 if (urlConn.getResponseCode() == 200) {354 if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) { 354 355 raw = Utils.readBytesFromStream(urlConn.getContent()); 355 356 } else { -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r10060 r10181 174 174 if (cDms60.equals(sSeconds)) { 175 175 sSeconds = cDms00; 176 sMinutes = cDmsMinuteFormatter.format(tMinutes+1 );176 sMinutes = cDmsMinuteFormatter.format(tMinutes+1L); 177 177 } 178 178 if ("60".equals(sMinutes)) { -
trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java
r10001 r10181 25 25 // The question is how far we move for each bit being set. 26 26 // In the case of the top level, we move half of the world. 27 double xUnit = X_PARTS/2 ;28 double yUnit = Y_PARTS/2 ;29 long shift = (NR_LEVELS*2 )-2;27 double xUnit = X_PARTS/2d; 28 double yUnit = Y_PARTS/2d; 29 long shift = (NR_LEVELS*2L)-2L; 30 30 31 31 double x = 0; -
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r9864 r10181 119 119 // use well known scale set "GoogleCompatibile" from OGC WMTS spec to calculate number of tiles per zoom level 120 120 // this makes the zoom levels "glued" to standard TMS zoom levels 121 degreesPerTile[zoom] = (SCALE_DENOMINATOR_ZOOM_LEVEL_1 / Math.pow(2 , zoom - 1)) * crsScale;121 degreesPerTile[zoom] = (SCALE_DENOMINATOR_ZOOM_LEVEL_1 / Math.pow(2d, zoom - 1d)) * crsScale; 122 122 TileXY minTileIndex = eastNorthToTileXY(topLeft, zoom); 123 123 tileXMin[zoom] = minTileIndex.getXIndex(); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
r8616 r10181 221 221 int x = (p.x+lastP.x)/2; 222 222 int y = (p.y+lastP.y)/2; 223 path.moveTo( x-virtualNodeSize, y);224 path.lineTo( x+virtualNodeSize, y);225 path.moveTo(x, y-virtualNodeSize);226 path.lineTo(x, y+virtualNodeSize);223 path.moveTo((float) x-virtualNodeSize, y); 224 path.lineTo((float) x+virtualNodeSize, y); 225 path.moveTo(x, (float) y-virtualNodeSize); 226 path.lineTo(x, (float) y+virtualNodeSize); 227 227 } 228 228 lastP = p; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/LineClip.java
r9243 r10181 39 39 } 40 40 return cohenSutherland(p1.x, p1.y, p2.x, p2.y, clipBounds.x, clipBounds.y, 41 clipBounds.x + clipBounds.width, clipBounds.y + clipBounds.height); 41 (long) clipBounds.x + clipBounds.width, 42 (long) clipBounds.y + clipBounds.height); 42 43 } 43 44 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r10000 r10181 144 144 int dxNext = next.x - current.x; 145 145 int dyNext = next.y - current.y; 146 double lenNext = Math.sqrt( dxNext*dxNext +dyNext*dyNext);146 double lenNext = Math.sqrt((double) dxNext*dxNext + (double) dyNext*dyNext); 147 147 148 148 if (lenNext == 0) { … … 814 814 final double segmentLength = thisP.distance(lastP); 815 815 816 final double dx = thisP.x - lastP.x;817 final double dy = thisP.y - lastP.y;816 final double dx = (double) thisP.x - lastP.x; 817 final double dy = (double) thisP.y - lastP.y; 818 818 819 819 // pos is the position from the beginning of the current segment … … 1263 1263 1264 1264 if (lastPoint != null) { 1265 dx = p.x - lastPoint.x;1266 dy = p.y - lastPoint.y;1265 dx = (long) p.x - lastPoint.x; 1266 dy = (long) p.y - lastPoint.y; 1267 1267 double segmentLength = Math.sqrt(dx*dx + dy*dy); 1268 1268 if (segmentLength > 2*(rec.getWidth()+4)) { … … 1756 1756 // Can be optimized if it turns out to be slow. 1757 1757 for (int i = 1; i < poly.npoints; ++i) { 1758 dx = poly.xpoints[i] - poly.xpoints[i-1];1759 dy = poly.ypoints[i] - poly.ypoints[i-1];1758 dx = (long) poly.xpoints[i] - poly.xpoints[i-1]; 1759 dy = (long) poly.ypoints[i] - poly.ypoints[i-1]; 1760 1760 segLen = Math.sqrt(dx*dx + dy*dy); 1761 1761 if (totalLen > curLen + segLen) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r9243 r10181 432 432 final double sy = l * (p1.y - p2.y); 433 433 434 path.lineTo(p2.x + ( int) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (int) Math.round(sinPHI * sx + cosPHI * sy));435 path.moveTo(p2.x + ( int) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (int) Math.round(-sinPHI * sx + cosPHI * sy));434 path.lineTo(p2.x + (float) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (float) Math.round(sinPHI * sx + cosPHI * sy)); 435 path.moveTo(p2.x + (float) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (float) Math.round(-sinPHI * sx + cosPHI * sy)); 436 436 path.lineTo(p2.x, p2.y); 437 437 } -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r10001 r10181 249 249 if (zone == null || zone < 1 || zone > 60) 250 250 throw new ProjectionConfigurationException(tr("Expected integer value in range 1-60 for ''+zone=...'' parameter.")); 251 this.lon0 = 6 * zone - 183;251 this.lon0 = 6d * zone - 183d; 252 252 this.k0 = 0.9996; 253 253 this.x0 = 500000; -
trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
r10009 r10181 141 141 protected void drawSegment(Point p1, Point p2, Color color) { 142 142 143 double t = Math.atan2( p2.x - p1.x,p2.y - p1.y);143 double t = Math.atan2((double) p2.x - p1.x, (double) p2.y - p1.y); 144 144 double cosT = 5 * Math.cos(t); 145 145 double sinT = 5 * Math.sin(t); -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r10001 r10181 635 635 zoomTo(oldCenter.interpolate(finalNewCenter, (i+1) / frames)); 636 636 try { 637 Thread.sleep(1000 / fps);637 Thread.sleep(1000L / fps); 638 638 } catch (InterruptedException ex) { 639 639 Main.warn("InterruptedException in "+NavigatableComponent.class.getSimpleName()+" during smooth scrolling"); -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r10153 r10181 169 169 public void hookUpMapView() { 170 170 // calculate total memory needed for all layers 171 long memoryBytesRequired = 50 * 1024 * 1024; // assumed minimum JOSM memory footprint171 long memoryBytesRequired = 50L * 1024L * 1024L; // assumed minimum JOSM memory footprint 172 172 if (Main.map != null && Main.map.mapView != null) { 173 173 for (Layer layer: Main.map.mapView.getAllLayers()) { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r10176 r10181 925 925 lblTimezone.setText(tr("Timezone: {0}", timezone.formatTimezone())); 926 926 lblMinutes.setText(tr("Minutes: {0}", sldMinutes.getValue())); 927 lblSeconds.setText(tr("Seconds: {0}", Offset.milliseconds(100 * sldSeconds.getValue()).formatOffset()));927 lblSeconds.setText(tr("Seconds: {0}", Offset.milliseconds(100L * sldSeconds.getValue()).formatOffset())); 928 928 929 929 delta = Offset.milliseconds(100 * sldSeconds.getValue() -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r10175 r10181 419 419 || screen.y < oldA.y - delta || screen.y > oldA.y + delta)) { 420 420 g.setColor(trkPnt.customColoring); 421 double t = Math.atan2( screen.y - old.y,screen.x - old.x) + Math.PI;421 double t = Math.atan2((double) screen.y - old.y, (double) screen.x - old.x) + Math.PI; 422 422 g.drawLine(screen.x, screen.y, (int) (screen.x + 10 * Math.cos(t - PHI)), 423 423 (int) (screen.y + 10 * Math.sin(t - PHI))); -
trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java
r8510 r10181 68 68 setDescription(description); 69 69 if (fontPlus != 0) { 70 setFont(getFont().deriveFont(0, getFont().getSize()+fontPlus));70 setFont(getFont().deriveFont(0, (float) getFont().getSize()+fontPlus)); 71 71 } 72 72 refresh(); -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r9995 r10181 76 76 77 77 public static final long DEFAULT_MAXTIME = -1L; 78 public static final long DAYS = 24 *60*60; // factor to get caching time in days78 public static final long DAYS = 24L*60L*60L; // factor to get caching time in days 79 79 80 80 private final Map<String, String> httpHeaders = new ConcurrentHashMap<>(); -
trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
r8846 r10181 96 96 Main.info(tr("{0} not available (offline mode)", tr("Message notifier"))); 97 97 } else if (!isRunning() && interval > 0 && isUserEnoughIdentified()) { 98 task = EXECUTOR.scheduleAtFixedRate(WORKER, 0, interval * 60 , TimeUnit.SECONDS);98 task = EXECUTOR.scheduleAtFixedRate(WORKER, 0, interval * 60L, TimeUnit.SECONDS); 99 99 Main.info("Message notifier active (checks every "+interval+" minute"+(interval > 1 ? "s" : "")+')'); 100 100 } -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r10001 r10181 68 68 } 69 69 double uploadsPerMs = (double) progress / elapsed; 70 double uploadsLeft = listSize - progress;70 double uploadsLeft = (double) listSize - progress; 71 71 long msLeft = (long) (uploadsLeft / uploadsPerMs); 72 72 long minutesLeft = msLeft / MSECS_PER_MINUTE;
Note:
See TracChangeset
for help on using the changeset viewer.