Changeset 8393 in josm
- Timestamp:
- 2015-05-18T22:57:22+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r8384 r8393 232 232 // center. This method is ok as long as distances are short 233 233 // relative to the distance from the N or S poles. 234 if ( Double.doubleToRawLongBits(radius)== 0) {234 if (radius == 0) { 235 235 for (Node n : nodes) { 236 236 radius += distance(center, n.getEastNorth()); -
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r8384 r8393 363 363 b = xM - xB; 364 364 double norm = Math.sqrt(a*a + b*b); 365 if ( Double.doubleToRawLongBits(norm)== 0)365 if (norm == 0) 366 366 // Nodes have same coordinates ! 367 367 throw new InvalidSelection(); -
trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java
r8384 r8393 61 61 EastNorth en2 = Main.map.mapView.getProjection().latlon2eastNorth(bBox.getBottomRight()); 62 62 double s = Math.abs((en1.east() - en2.east()) * (en1.north() - en2.north())); 63 if (Double.doubleToRawLongBits(s) == 0) { 64 s = 1e8; 65 } 63 if (s == 0) s = 1e8; 66 64 found.put(s, r); 67 65 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r8390 r8393 1005 1005 // In practice this will probably only happen when a way has been duplicated 1006 1006 1007 if ( Double.doubleToRawLongBits(u)== 0)1007 if (u == 0) 1008 1008 return; 1009 1009 -
trunk/src/org/openstreetmap/josm/actions/mapmode/PlayHeadDragMode.java
r8384 r8393 60 60 dragging = true; 61 61 } 62 if ( Double.doubleToRawLongBits(p.distance(mousePos)) == 0) return;62 if (p.distance(mousePos) == 0) return; 63 63 playHeadMarker.drag(Main.map.mapView.getEastNorth(ev.getX(), ev.getY())); 64 64 mousePos = p; -
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r8384 r8393 295 295 double C = -A * rx - B * ry; 296 296 double RSsq = A * A + B * B; 297 if ( Double.doubleToRawLongBits(RSsq)== 0) {297 if (RSsq == 0) { 298 298 continue; 299 299 } -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r8390 r8393 948 948 public String getToolbarName() { 949 949 String res = name; 950 if ( Double.doubleToRawLongBits(pixelPerDegree)!= 0) {950 if (pixelPerDegree != 0) { 951 951 res += "#PPD="+pixelPerDegree; 952 952 } … … 956 956 public String getMenuName() { 957 957 String res = name; 958 if ( Double.doubleToRawLongBits(pixelPerDegree)!= 0) {958 if (pixelPerDegree != 0) { 959 959 res += " ("+pixelPerDegree+")"; 960 960 } -
trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
r8384 r8393 71 71 res.add(String.valueOf(dx)); 72 72 res.add(String.valueOf(dy)); 73 if ( Double.doubleToRawLongBits(centerX)!= 0 ||Double.doubleToRawLongBits(centerY)!= 0) {73 if (centerX != 0 || centerY != 0) { 74 74 res.add(String.valueOf(centerX)); 75 75 res.add(String.valueOf(centerY)); -
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r8384 r8393 274 274 if (o instanceof BBox) { 275 275 BBox b = (BBox)o; 276 return Utils.equalsEpsilon(b.xmax, xmax) && Utils.equalsEpsilon(b.ymax, ymax)277 && Utils.equalsEpsilon(b.xmin, xmin) && Utils.equalsEpsilon(b.ymin, ymin);276 return b.xmax == xmax && b.ymax == ymax 277 && b.xmin == xmin && b.ymin == ymin; 278 278 } else 279 279 return false; -
trunk/src/org/openstreetmap/josm/data/osm/NodePositionComparator.java
r8384 r8393 26 26 return -1; 27 27 double dLon = n1.getCoor().lon() - n2.getCoor().lon(); 28 if ( Double.doubleToRawLongBits(dLon)== 0)28 if (dLon == 0) 29 29 return 0; 30 30 return dLon > 0 ? 1 : -1; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r8384 r8393 142 142 double lenNext = Math.sqrt(dxNext*dxNext + dyNext*dyNext); 143 143 144 if ( Double.doubleToRawLongBits(lenNext)== 0) {144 if (lenNext == 0) { 145 145 lenNext = 1; // value does not matter, because dy_next and dx_next is 0 146 146 } … … 998 998 999 999 double fromAngle; 1000 if ( Double.doubleToRawLongBits(dx)== 0) {1000 if (dx == 0) { 1001 1001 fromAngle = Math.PI/2; 1002 1002 } else { … … 1315 1315 if (showHeadArrowOnly ? !it.hasNext() : showOrientation) { 1316 1316 final double segmentLength = p1.distance(p2); 1317 if ( Double.doubleToRawLongBits(segmentLength)!= 0) {1317 if (segmentLength != 0) { 1318 1318 final double l = (10. + line.getLineWidth()) / segmentLength; 1319 1319 … … 1328 1328 if (showOneway) { 1329 1329 final double segmentLength = p1.distance(p2); 1330 if ( Double.doubleToRawLongBits(segmentLength)!= 0) {1330 if (segmentLength != 0) { 1331 1331 final double nx = (p2.x - p1.x) / segmentLength; 1332 1332 final double ny = (p2.y - p1.y) / segmentLength; -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r8390 r8393 342 342 boolean isCentric = true; 343 343 for (Double param : towgs84Param) { 344 if ( Double.doubleToRawLongBits(param)!= 0) {344 if (param != 0) { 345 345 isCentric = false; 346 346 break; … … 351 351 boolean is3Param = true; 352 352 for (int i = 3; i<towgs84Param.size(); i++) { 353 if ( Double.doubleToRawLongBits(towgs84Param.get(i)) != 0) {353 if (towgs84Param.get(i) != 0) { 354 354 is3Param = false; 355 355 break; -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r8384 r8393 59 59 if (coor == null) 60 60 return null; 61 if ( Double.doubleToRawLongBits(precision)== 0)61 if (precision == 0) 62 62 return coor.getRoundedToOsmPrecision(); 63 63 return roundCoord(coor); … … 66 66 if (coor == null) 67 67 return null; 68 if ( Double.doubleToRawLongBits(precision)== 0)68 if (precision == 0) 69 69 return coor.getRoundedToOsmPrecision(); 70 70 return roundCoord(coor); -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r8387 r8393 296 296 @Override 297 297 public void setBoundingBox(Bounds bbox) { 298 if (bbox == null || ( Double.doubleToRawLongBits(bbox.getMinLat())== 0 &&Double.doubleToRawLongBits(bbox.getMinLon()) == 0299 && Double.doubleToRawLongBits(bbox.getMaxLat())== 0 &&Double.doubleToRawLongBits(bbox.getMaxLon()) == 0)) {298 if (bbox == null || (bbox.getMinLat() == 0 && bbox.getMinLon() == 0 299 && bbox.getMaxLat() == 0 && bbox.getMaxLon() == 0)) { 300 300 this.bbox = null; 301 301 iSelectionRectStart = null; -
trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
r8384 r8393 144 144 panel.add(new UrlLabel(url), GBC.eol().insets(2, 5, 10, 0)); 145 145 } 146 if ( Double.doubleToRawLongBits(dx)!= 0 ||Double.doubleToRawLongBits(dy)!= 0) {146 if (dx != 0 || dy != 0) { 147 147 panel.add(new JLabel(tr("Offset: ") + dx + ";" + dy), GBC.eol().insets(0, 5, 10, 0)); 148 148 } -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r8384 r8393 270 270 boolean oldValue = isVisible(); 271 271 this.visible = visible; 272 if (visible && Double.doubleToRawLongBits(opacity)== 0) {272 if (visible && opacity == 0) { 273 273 setOpacity(1); 274 274 } else if (oldValue != isVisible()) { … … 282 282 */ 283 283 public boolean isVisible() { 284 return visible && Double.doubleToRawLongBits(opacity)!= 0;284 return visible && opacity != 0; 285 285 } 286 286 -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r8390 r8393 419 419 int screenPixels = mv.getWidth()*mv.getHeight(); 420 420 double tilePixels = Math.abs((y2-y1)*(x2-x1)*tileSource.getTileSize()*tileSource.getTileSize()); 421 if (screenPixels == 0 || Double.doubleToRawLongBits(tilePixels)== 0) return 1;421 if (screenPixels == 0 || tilePixels == 0) return 1; 422 422 return screenPixels/tilePixels; 423 423 } … … 1261 1261 EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight()); 1262 1262 1263 if ( Double.doubleToRawLongBits(botRight.east())== 0 ||Double.doubleToRawLongBits(botRight.north()) == 0) {1263 if (botRight.east() == 0 || botRight.north() == 0) { 1264 1264 /*Main.debug("still initializing??");*/ 1265 1265 // probably still initializing -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r8384 r8393 907 907 // parse slider position into real timezone 908 908 double tz = Math.abs(sldTimezone.getValue()); 909 String zone = Double.doubleToRawLongBits(tz % 2)== 0909 String zone = tz % 2 == 0 910 910 ? (int)Math.floor(tz/2) + ":00" 911 911 : (int)Math.floor(tz/2) + ":30"; -
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r8390 r8393 149 149 return !(s.isEmpty() || "false".equals(s) || "no".equals(s) || "0".equals(s) || "0.0".equals(s)); 150 150 if (o instanceof Number) 151 return Float.floatToRawIntBits(((Number) o).floatValue()) != 0;151 return ((Number) o).floatValue() != 0; 152 152 if (o instanceof List) 153 153 return !((List) o).isEmpty(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
r8384 r8393 11 11 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer; 12 12 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.RelativeFloat; 13 import org.openstreetmap.josm.tools.Utils;14 13 15 14 public abstract class ElemStyle implements StyleKeys { … … 210 209 ElemStyle s = (ElemStyle) o; 211 210 return isModifier == s.isModifier && 212 Utils.equalsEpsilon(majorZIndex,s.majorZIndex)&&213 Utils.equalsEpsilon(zIndex,s.zIndex)&&214 Utils.equalsEpsilon(objectZIndex,s.objectZIndex);211 majorZIndex == s.majorZIndex && 212 zIndex == s.zIndex && 213 objectZIndex == s.objectZIndex; 215 214 } 216 215 -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r8384 r8393 335 335 Objects.equals(dashesLine, other.dashesLine) && 336 336 Objects.equals(dashesBackground, other.dashesBackground) && 337 Utils.equalsEpsilon(offset,other.offset)&&338 Utils.equalsEpsilon(realWidth,other.realWidth);337 offset == other.offset && 338 realWidth == other.realWidth; 339 339 } 340 340 … … 356 356 " realWidth=" + realWidth + " color=" + Utils.toString(color) + 357 357 " dashed=" + Arrays.toString(line.getDashArray()) + 358 ( Float.floatToRawIntBits(line.getDashPhase()) == 0 ? "" : " dashesOffses=" + line.getDashPhase()) +358 (line.getDashPhase() == 0 ? "" : " dashesOffses=" + line.getDashPhase()) + 359 359 " dashedColor=" + Utils.toString(dashesBackground) + 360 360 " linejoin=" + linejoinToString(line.getLineJoin()) + 361 361 " linecap=" + linecapToString(line.getEndCap()) + 362 ( Float.floatToRawIntBits(offset)== 0 ? "" : " offset=" + offset) +362 (offset == 0 ? "" : " offset=" + offset) + 363 363 '}'; 364 364 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/RepeatImageElemStyle.java
r8384 r8393 7 7 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer; 8 8 import org.openstreetmap.josm.tools.CheckParameterUtil; 9 import org.openstreetmap.josm.tools.Utils;10 9 11 10 public class RepeatImageElemStyle extends ElemStyle implements StyleKeys { … … 70 69 final RepeatImageElemStyle other = (RepeatImageElemStyle) obj; 71 70 if (!this.pattern.equals(other.pattern)) return false; 72 if ( !Utils.equalsEpsilon(this.offset,other.offset)) return false;73 if ( !Utils.equalsEpsilon(this.spacing,other.spacing)) return false;74 if ( !Utils.equalsEpsilon(this.phase,other.phase)) return false;71 if (this.offset != other.offset) return false; 72 if (this.spacing != other.spacing) return false; 73 if (this.phase != other.phase) return false; 75 74 if (this.align != other.align) return false; 76 75 return true; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r8390 r8393 177 177 float res = args[0]; 178 178 for (int i = 1; i < args.length; ++i) { 179 if ( Float.floatToRawIntBits(args[i])== 0) {179 if (args[i] == 0) { 180 180 return null; 181 181 } -
trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
r8384 r8393 277 277 if (playingUrl != command.url() || 278 278 stateChange != State.PAUSED || 279 Double.doubleToRawLongBits(offset)!= 0)279 offset != 0) 280 280 { 281 281 if (audioInputStream != null) { -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r8387 r8393 352 352 // Solve the equations 353 353 double det = a1 * b2 - a2 * b1; 354 if ( Double.doubleToRawLongBits(det)== 0)354 if (det == 0) 355 355 return null; // Lines are parallel 356 356 … … 388 388 389 389 //segment zero length 390 if ( Double.doubleToRawLongBits(ldx)== 0 &&Double.doubleToRawLongBits(ldy)== 0)390 if (ldx == 0 && ldy == 0) 391 391 return p1; 392 392 … … 828 828 b[i] = pt1.north() - pt2.north(); 829 829 double d = Math.sqrt(a[i]*a[i] + b[i]*b[i]); 830 if (Double.doubleToRawLongBits(d)== 0) return null;830 if(d == 0) return null; 831 831 a[i] /= d; 832 832 b[i] /= d; -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r8384 r8393 1180 1180 // convert rotatedAngle to an integer value from 0 to 360 1181 1181 Long originalAngle = Math.round(rotatedAngle % 360); 1182 if ( Double.doubleToRawLongBits(rotatedAngle)!= 0 && originalAngle == 0) {1182 if (rotatedAngle != 0 && originalAngle == 0) { 1183 1183 originalAngle = 360L; 1184 1184 } … … 1197 1197 // convert originalAngle to a value from 0 to 90 1198 1198 double angle = originalAngle % 90; 1199 if (originalAngle != 0 && Double.doubleToRawLongBits(angle)== 0) {1199 if (originalAngle != 0 && angle == 0) { 1200 1200 angle = 90.0; 1201 1201 }
Note:
See TracChangeset
for help on using the changeset viewer.