Changeset 10001 in josm
- Timestamp:
- 2016-03-17T01:50:12+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r9989 r10001 1345 1345 panel.add(ho, gbc); 1346 1346 panel.add(link, gbc); 1347 final String EXIT= tr("Exit JOSM");1348 final String CONTINUE= tr("Continue, try anyway");1347 final String exitStr = tr("Exit JOSM"); 1348 final String continueStr = tr("Continue, try anyway"); 1349 1349 int ret = JOptionPane.showOptionDialog(null, panel, tr("Error"), JOptionPane.YES_NO_OPTION, 1350 JOptionPane.ERROR_MESSAGE, null, new String[] { EXIT, CONTINUE}, EXIT);1350 JOptionPane.ERROR_MESSAGE, null, new String[] {exitStr, continueStr}, exitStr); 1351 1351 if (ret == 0) { 1352 1352 System.exit(0); -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r9623 r10001 267 267 /** 268 268 * Returns oriented angle (N1N2, N1N3) in range [0; 2*Math.PI[ 269 * @param N1 first node270 * @param N2 second node271 * @param N3 third node269 * @param n1 first node 270 * @param n2 second node 271 * @param n3 third node 272 272 * @return oriented angle (N1N2, N1N3) in range [0; 2*Math.PI[ 273 273 */ 274 private static double getAngle(Node N1, Node N2, Node N3) {275 EastNorth en1 = N1.getEastNorth();276 EastNorth en2 = N2.getEastNorth();277 EastNorth en3 = N3.getEastNorth();274 private static double getAngle(Node n1, Node n2, Node n3) { 275 EastNorth en1 = n1.getEastNorth(); 276 EastNorth en2 = n2.getEastNorth(); 277 EastNorth en3 = n3.getEastNorth(); 278 278 double angle = Math.atan2(en3.getY() - en1.getY(), en3.getX() - en1.getX()) - 279 279 Math.atan2(en2.getY() - en1.getY(), en2.getX() - en1.getX()); -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r9999 r10001 328 328 329 329 // orthogonalize 330 final Direction[] HORIZONTAL= {Direction.RIGHT, Direction.LEFT};331 final Direction[] VERTICAL= {Direction.UP, Direction.DOWN};332 final Direction[][] ORIENTATIONS = {HORIZONTAL, VERTICAL};333 for (Direction[] orientation : ORIENTATIONS) {330 final Direction[] horizontal = {Direction.RIGHT, Direction.LEFT}; 331 final Direction[] vertical = {Direction.UP, Direction.DOWN}; 332 final Direction[][] orientations = {horizontal, vertical}; 333 for (Direction[] orientation : orientations) { 334 334 final Set<Node> s = new HashSet<>(allNodes); 335 int s _size = s.size();336 for (int dummy = 0; dummy < s _size; ++dummy) {335 int size = s.size(); 336 for (int dummy = 0; dummy < size; ++dummy) { 337 337 if (s.isEmpty()) { 338 338 break; 339 339 } 340 final Node dummy _n= s.iterator().next(); // pick arbitrary element of s341 342 final Set<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummy _n343 cs.add(dummy _n); // walking only on horizontal / vertical segments340 final Node dummyN = s.iterator().next(); // pick arbitrary element of s 341 342 final Set<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummyN 343 cs.add(dummyN); // walking only on horizontal / vertical segments 344 344 345 345 boolean somethingHappened = true; … … 364 364 } 365 365 366 final Map<Node, Double> nC = (orientation == HORIZONTAL) ? nY : nX;366 final Map<Node, Double> nC = (orientation == horizontal) ? nY : nX; 367 367 368 368 double average = 0; … … 385 385 // both heading nodes collapsing to one point, we simply skip this segment string and 386 386 // don't touch the node coordinates. 387 if (orientation == VERTICAL&& headingNodes.size() == 2 && cs.containsAll(headingNodes)) {387 if (orientation == vertical && headingNodes.size() == 2 && cs.containsAll(headingNodes)) { 388 388 continue; 389 389 } … … 404 404 final double dy = tmp.north() - n.getEastNorth().north(); 405 405 if (headingNodes.contains(n)) { // The heading nodes should not have changed 406 final double EPSILON= 1E-6;407 if (Math.abs(dx) > Math.abs( EPSILON* tmp.east()) ||408 Math.abs(dy) > Math.abs( EPSILON* tmp.east()))406 final double epsilon = 1E-6; 407 if (Math.abs(dx) > Math.abs(epsilon * tmp.east()) || 408 Math.abs(dy) > Math.abs(epsilon * tmp.east())) 409 409 throw new AssertionError(); 410 410 } else { … … 572 572 private static int angleToDirectionChange(double a, double deltaMax) throws RejectedAngleException { 573 573 a = standard_angle_mPI_to_PI(a); 574 double d0 575 double d90 576 double d _m90 = Math.abs(a + Math.PI / 2);574 double d0 = Math.abs(a); 575 double d90 = Math.abs(a - Math.PI / 2); 576 double dm90 = Math.abs(a + Math.PI / 2); 577 577 int dirChange; 578 578 if (d0 < deltaMax) { … … 580 580 } else if (d90 < deltaMax) { 581 581 dirChange = 1; 582 } else if (d _m90 < deltaMax) {582 } else if (dm90 < deltaMax) { 583 583 dirChange = -1; 584 584 } else { -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r9999 r10001 605 605 } 606 606 607 int i_c = 0, i_r = 0; 607 int ic = 0; 608 int ir = 0; 608 609 List<RelationMember> relationMembers = r.getMembers(); 609 610 for (RelationMember rm: relationMembers) { … … 666 667 Boolean backwards = null; 667 668 int k = 1; 668 while (i _r - k >= 0 || i_r + k < relationMembers.size()) {669 if ((i _r - k >= 0) && relationMembers.get(i_r - k).isWay()) {670 Way w = relationMembers.get(i _r - k).getWay();669 while (ir - k >= 0 || ir + k < relationMembers.size()) { 670 if ((ir - k >= 0) && relationMembers.get(ir - k).isWay()) { 671 Way w = relationMembers.get(ir - k).getWay(); 671 672 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 672 673 backwards = Boolean.FALSE; … … 676 677 break; 677 678 } 678 if ((i _r + k < relationMembers.size()) && relationMembers.get(i_r + k).isWay()) {679 Way w = relationMembers.get(i _r + k).getWay();679 if ((ir + k < relationMembers.size()) && relationMembers.get(ir + k).isWay()) { 680 Way w = relationMembers.get(ir + k).getWay(); 680 681 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 681 682 backwards = Boolean.TRUE; … … 688 689 } 689 690 690 int j = i _c;691 int j = ic; 691 692 final List<Way> waysToAddBefore = newWays.subList(0, indexOfWayToKeep); 692 693 for (Way wayToAdd : waysToAddBefore) { … … 694 695 j++; 695 696 if (Boolean.TRUE.equals(backwards)) { 696 c.addMember(i _c + 1, em);697 c.addMember(ic + 1, em); 697 698 } else { 698 699 c.addMember(j - 1, em); … … 704 705 j++; 705 706 if (Boolean.TRUE.equals(backwards)) { 706 c.addMember(i _c, em);707 c.addMember(ic, em); 707 708 } else { 708 709 c.addMember(j, em); 709 710 } 710 711 } 711 i _c = j;712 ic = j; 712 713 } 713 714 } 714 i _c++;715 i _r++;715 ic++; 716 ir++; 716 717 } 717 718 -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeCompressedTask.java
r9665 r10001 30 30 /** 31 31 * Loads a given URL 32 * @param new _layer {@code true} if the data should be saved to a new layer32 * @param newLayer {@code true} if the data should be saved to a new layer 33 33 * @param url The URL as String 34 34 * @param progressMonitor progress monitor for user interaction 35 35 */ 36 36 @Override 37 public Future<?> loadUrl(boolean new _layer, final String url, ProgressMonitor progressMonitor) {38 downloadTask = new DownloadTask(new _layer, new OsmServerLocationReader(url), progressMonitor) {37 public Future<?> loadUrl(boolean newLayer, final String url, ProgressMonitor progressMonitor) { 38 downloadTask = new DownloadTask(newLayer, new OsmServerLocationReader(url), progressMonitor) { 39 39 @Override 40 40 protected DataSet parseDataSet() throws OsmTransferException { -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java
r9989 r10001 68 68 69 69 @Override 70 public Future<?> loadUrl(boolean new _layer, String url, ProgressMonitor progressMonitor) {70 public Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor) { 71 71 final Matcher matcher = Pattern.compile(OSM_WEBSITE_PATTERN).matcher(url); 72 72 if (matcher.matches()) { 73 73 url = OsmApi.getOsmApi().getBaseUrl() + "changeset/" + Long.parseLong(matcher.group(2)) + "/download"; 74 74 } 75 downloadTask = new DownloadTask(new _layer, new OsmServerLocationReader(url), progressMonitor);75 downloadTask = new DownloadTask(newLayer, new OsmServerLocationReader(url), progressMonitor); 76 76 // Extract .osc filename from URL to set the new layer name 77 77 extractOsmFilename("https?://.*/(.*\\.osc)", url); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmCompressedTask.java
r8285 r10001 39 39 /** 40 40 * Loads a given URL 41 * @param new _layer {@code true} if the data should be saved to a new layer41 * @param newLayer {@code true} if the data should be saved to a new layer 42 42 * @param url The URL as String 43 43 * @param progressMonitor progress monitor for user interaction 44 44 */ 45 45 @Override 46 public Future<?> loadUrl(boolean new _layer, final String url, ProgressMonitor progressMonitor) {47 downloadTask = new DownloadTask(new _layer, new OsmServerLocationReader(url), progressMonitor) {46 public Future<?> loadUrl(boolean newLayer, final String url, ProgressMonitor progressMonitor) { 47 downloadTask = new DownloadTask(newLayer, new OsmServerLocationReader(url), progressMonitor) { 48 48 @Override 49 49 protected DataSet parseDataSet() throws OsmTransferException { -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r9968 r10001 999 999 Iterator<Pair<Node, Node>> i = segs.iterator(); 1000 1000 Pair<Node, Node> seg = i.next(); 1001 EastNorth A = seg.a.getEastNorth();1002 EastNorth B = seg.b.getEastNorth();1001 EastNorth pA = seg.a.getEastNorth(); 1002 EastNorth pB = seg.b.getEastNorth(); 1003 1003 seg = i.next(); 1004 EastNorth C = seg.a.getEastNorth();1005 EastNorth D = seg.b.getEastNorth();1006 1007 double u = det( B.east() - A.east(), B.north() - A.north(), C.east() - D.east(), C.north() -D.north());1004 EastNorth pC = seg.a.getEastNorth(); 1005 EastNorth pD = seg.b.getEastNorth(); 1006 1007 double u = det(pB.east() - pA.east(), pB.north() - pA.north(), pC.east() - pD.east(), pC.north() - pD.north()); 1008 1008 1009 1009 // Check for parallel segments and do nothing if they are … … 1017 1017 // if the segment is scaled to lenght 1 1018 1018 1019 double q = det( B.north() - C.north(), B.east() - C.east(), D.north() - C.north(), D.east() -C.east()) / u;1019 double q = det(pB.north() - pC.north(), pB.east() - pC.east(), pD.north() - pC.north(), pD.east() - pC.east()) / u; 1020 1020 EastNorth intersection = new EastNorth( 1021 B.east() + q * (A.east() -B.east()),1022 B.north() + q * (A.north() -B.north()));1021 pB.east() + q * (pA.east() - pB.east()), 1022 pB.north() + q * (pA.north() - pB.north())); 1023 1023 1024 1024 … … 1031 1031 } 1032 1032 default: 1033 EastNorth P= n.getEastNorth();1033 EastNorth p = n.getEastNorth(); 1034 1034 seg = segs.iterator().next(); 1035 A = seg.a.getEastNorth();1036 B = seg.b.getEastNorth();1037 double a = P.distanceSq(B);1038 double b = P.distanceSq(A);1039 double c = A.distanceSq(B);1035 pA = seg.a.getEastNorth(); 1036 pB = seg.b.getEastNorth(); 1037 double a = p.distanceSq(pB); 1038 double b = p.distanceSq(pA); 1039 double c = pA.distanceSq(pB); 1040 1040 q = (a - b + c) / (2*c); 1041 n.setEastNorth(new EastNorth( B.east() + q * (A.east() - B.east()), B.north() + q * (A.north() -B.north())));1041 n.setEastNorth(new EastNorth(pB.east() + q * (pA.east() - pB.east()), pB.north() + q * (pA.north() - pB.north()))); 1042 1042 } 1043 1043 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r9989 r10001 573 573 if (ws != null) { 574 574 Node n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY())); 575 EastNorth A= ws.getFirstNode().getEastNorth();576 EastNorth B= ws.getSecondNode().getEastNorth();577 n.setEastNorth(Geometry.closestPointToSegment( A, B, n.getEastNorth()));575 EastNorth a = ws.getFirstNode().getEastNorth(); 576 EastNorth b = ws.getSecondNode().getEastNorth(); 577 n.setEastNorth(Geometry.closestPointToSegment(a, b, n.getEastNorth())); 578 578 Way wnew = new Way(ws.way); 579 579 wnew.addNode(ws.lowerIndex+1, n); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java
r8513 r10001 143 143 EastNorth prevB = pts[1].add(normals[0].scale(d)); 144 144 for (int i = 1; i < nodeCount - 1; i++) { 145 EastNorth A= pts[i].add(normals[i].scale(d));146 EastNorth B= pts[i + 1].add(normals[i].scale(d));147 if (Geometry.segmentsParallel( A, B, prevA, prevB)) {148 ppts[i] = A;145 EastNorth a = pts[i].add(normals[i].scale(d)); 146 EastNorth b = pts[i + 1].add(normals[i].scale(d)); 147 if (Geometry.segmentsParallel(a, b, prevA, prevB)) { 148 ppts[i] = a; 149 149 } else { 150 ppts[i] = Geometry.getLineLineIntersection( A, B, prevA, prevB);151 } 152 prevA = A;153 prevB = B;150 ppts[i] = Geometry.getLineLineIntersection(a, b, prevA, prevB); 151 } 152 prevA = a; 153 prevB = b; 154 154 } 155 155 if (isClosedPath()) { 156 EastNorth A= pts[0].add(normals[0].scale(d));157 EastNorth B= pts[1].add(normals[0].scale(d));158 if (Geometry.segmentsParallel( A, B, prevA, prevB)) {159 ppts[0] = A;156 EastNorth a = pts[0].add(normals[0].scale(d)); 157 EastNorth b = pts[1].add(normals[0].scale(d)); 158 if (Geometry.segmentsParallel(a, b, prevA, prevB)) { 159 ppts[0] = a; 160 160 } else { 161 ppts[0] = Geometry.getLineLineIntersection( A, B, prevA, prevB);161 ppts[0] = Geometry.getLineLineIntersection(a, b, prevA, prevB); 162 162 } 163 163 ppts[nodeCount - 1] = ppts[0]; -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r9989 r10001 260 260 JRadioButton add = new JRadioButton(tr("add to selection"), initialValues.mode == SearchMode.add); 261 261 JRadioButton remove = new JRadioButton(tr("remove from selection"), initialValues.mode == SearchMode.remove); 262 JRadioButton in _selection = new JRadioButton(tr("find in selection"), initialValues.mode == SearchMode.in_selection);262 JRadioButton inSelection = new JRadioButton(tr("find in selection"), initialValues.mode == SearchMode.in_selection); 263 263 ButtonGroup bg = new ButtonGroup(); 264 264 bg.add(replace); 265 265 bg.add(add); 266 266 bg.add(remove); 267 bg.add(in _selection);267 bg.add(inSelection); 268 268 269 269 final JCheckBox caseSensitive = new JCheckBox(tr("case sensitive"), initialValues.caseSensitive); … … 286 286 left.add(add, GBC.eol()); 287 287 left.add(remove, GBC.eol()); 288 left.add(in _selection, GBC.eop());288 left.add(inSelection, GBC.eop()); 289 289 left.add(caseSensitive, GBC.eol()); 290 290 if (Main.pref.getBoolean("expert", false)) { -
trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java
r8510 r10001 23 23 public static LatLon tile2LatLon(long quad) { 24 24 // The world is divided up into X_PARTS,Y_PARTS. 25 // The question is how far we move for each bit 26 // being set. In the case of the top level, we 27 // move half of the world. 28 double x_unit = X_PARTS/2; 29 double y_unit = Y_PARTS/2; 25 // The question is how far we move for each bit being set. 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; 30 29 long shift = (NR_LEVELS*2)-2; 31 30 … … 36 35 // remember x is the MSB 37 36 if ((bits & 0x2) != 0) { 38 x += x _unit;37 x += xUnit; 39 38 } 40 39 if ((bits & 0x1) != 0) { 41 y += y _unit;40 y += yUnit; 42 41 } 43 x _unit /= 2;44 y _unit /= 2;42 xUnit /= 2; 43 yUnit /= 2; 45 44 shift -= 2; 46 45 } … … 61 60 } 62 61 return tile; 63 }64 65 static long coorToTile(LatLon coor) {66 return quadTile(coor);67 62 } 68 63 … … 89 84 public static int index(int level, long quad) { 90 85 long mask = 0x00000003; 91 int total _shift = TILES_PER_LEVEL_SHIFT*(NR_LEVELS-level-1);92 return (int) (mask & (quad >> total _shift));86 int totalShift = TILES_PER_LEVEL_SHIFT*(NR_LEVELS-level-1); 87 return (int) (mask & (quad >> totalShift)); 93 88 } 94 89 -
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r9854 r10001 240 240 241 241 /** 242 * Makes a WayPoint at the projection of point P onto the track providing Pis less than242 * Makes a WayPoint at the projection of point p onto the track providing p is less than 243 243 * tolerance away from the track 244 244 * 245 * @param P: the point to determine the projection for245 * @param p : the point to determine the projection for 246 246 * @param tolerance : must be no further than this from the track 247 * @return the closest point on the track to P, which may be the first or last point if off the247 * @return the closest point on the track to p, which may be the first or last point if off the 248 248 * end of a segment, or may be null if nothing close enough 249 249 */ 250 public WayPoint nearestPointOnTrack(EastNorth P, double tolerance) {250 public WayPoint nearestPointOnTrack(EastNorth p, double tolerance) { 251 251 /* 252 252 * assume the coordinates of P are xp,yp, and those of a section of track between two … … 272 272 */ 273 273 274 double PNminsq = tolerance * tolerance;274 double pnminsq = tolerance * tolerance; 275 275 EastNorth bestEN = null; 276 276 double bestTime = 0.0; 277 double px = P.east();278 double py = P.north();277 double px = p.east(); 278 double py = p.north(); 279 279 double rx = 0.0, ry = 0.0, sx, sy, x, y; 280 280 if (tracks == null) … … 282 282 for (GpxTrack track : tracks) { 283 283 for (GpxTrackSegment seg : track.getSegments()) { 284 WayPoint R= null;284 WayPoint r = null; 285 285 for (WayPoint S : seg.getWayPoints()) { 286 EastNorth c= S.getEastNorth();287 if ( R== null) {288 R= S;289 rx = c.east();290 ry = c.north();286 EastNorth en = S.getEastNorth(); 287 if (r == null) { 288 r = S; 289 rx = en.east(); 290 ry = en.north(); 291 291 x = px - rx; 292 292 y = py - ry; 293 double PRsq = x * x + y * y;294 if ( PRsq < PNminsq) {295 PNminsq = PRsq;296 bestEN = c;297 bestTime = R.time;293 double pRsq = x * x + y * y; 294 if (pRsq < pnminsq) { 295 pnminsq = pRsq; 296 bestEN = en; 297 bestTime = r.time; 298 298 } 299 299 } else { 300 sx = c.east();301 sy = c.north();302 double A= sy - ry;303 double B= rx - sx;304 double C = -A * rx - B* ry;305 double RSsq = A * A + B * B;306 if ( RSsq == 0) {300 sx = en.east(); 301 sy = en.north(); 302 double a = sy - ry; 303 double b = rx - sx; 304 double c = -a * rx - b * ry; 305 double rssq = a * a + b * b; 306 if (rssq == 0) { 307 307 continue; 308 308 } 309 double PNsq = A * px + B * py + C;310 PNsq = PNsq * PNsq / RSsq;311 if ( PNsq < PNminsq) {309 double pnsq = a * px + b * py + c; 310 pnsq = pnsq * pnsq / rssq; 311 if (pnsq < pnminsq) { 312 312 x = px - rx; 313 313 y = py - ry; 314 double PRsq = x * x + y * y;314 double prsq = x * x + y * y; 315 315 x = px - sx; 316 316 y = py - sy; 317 double PSsq = x * x + y * y;318 if ( PRsq - PNsq <= RSsq && PSsq - PNsq <= RSsq) {319 double RNoverRS = Math.sqrt((PRsq - PNsq) / RSsq);320 double nx = rx - RNoverRS * B;321 double ny = ry + RNoverRS * A;317 double pssq = x * x + y * y; 318 if (prsq - pnsq <= rssq && pssq - pnsq <= rssq) { 319 double rnoverRS = Math.sqrt((prsq - pnsq) / rssq); 320 double nx = rx - rnoverRS * b; 321 double ny = ry + rnoverRS * a; 322 322 bestEN = new EastNorth(nx, ny); 323 bestTime = R.time + RNoverRS * (S.time - R.time);324 PNminsq = PNsq;323 bestTime = r.time + rnoverRS * (S.time - r.time); 324 pnminsq = pnsq; 325 325 } 326 326 } 327 R= S;327 r = S; 328 328 rx = sx; 329 329 ry = sy; 330 330 } 331 331 } 332 if ( R!= null) {333 EastNorth c = R.getEastNorth();332 if (r != null) { 333 EastNorth c = r.getEastNorth(); 334 334 /* if there is only one point in the seg, it will do this twice, but no matter */ 335 335 rx = c.east(); … … 337 337 x = px - rx; 338 338 y = py - ry; 339 double PRsq = x * x + y * y;340 if ( PRsq < PNminsq) {341 PNminsq = PRsq;339 double prsq = x * x + y * y; 340 if (prsq < pnminsq) { 341 pnminsq = prsq; 342 342 bestEN = c; 343 bestTime = R.time;343 bestTime = r.time; 344 344 } 345 345 } -
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r9976 r10001 52 52 } 53 53 54 public BBox(double a _x, double a_y, double b_x, double b_y) {55 56 if (a _x > b_x) {57 xmax = a _x;58 xmin = b _x;54 public BBox(double ax, double ay, double bx, double by) { 55 56 if (ax > bx) { 57 xmax = ax; 58 xmin = bx; 59 59 } else { 60 xmax = b _x;61 xmin = a _x;62 } 63 64 if (a _y > b_y) {65 ymax = a _y;66 ymin = b _y;60 xmax = bx; 61 xmin = ax; 62 } 63 64 if (ay > by) { 65 ymax = ay; 66 ymin = by; 67 67 } else { 68 ymax = b _y;69 ymin = a _y;68 ymax = by; 69 ymin = ay; 70 70 } 71 71 -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r9854 r10001 98 98 } 99 99 100 QBLevel(QBLevel<T> parent, int parent _index, final QuadBuckets<T> buckets) {100 QBLevel(QBLevel<T> parent, int parentIndex, final QuadBuckets<T> buckets) { 101 101 this.parent = parent; 102 102 this.level = parent.level + 1; 103 this.index = parent _index;103 this.index = parentIndex; 104 104 this.buckets = buckets; 105 105 … … 111 111 mult = 1 << 30; 112 112 } 113 long this_quadpart = mult * (parent_index << shift);114 this.quad = parent.quad | this_quadpart;113 long quadpart = mult * (parentIndex << shift); 114 this.quad = parent.quad | quadpart; 115 115 this.bbox = calculateBBox(); // calculateBBox reference quad 116 116 } 117 117 118 118 private BBox calculateBBox() { 119 LatLon bottom _left = this.coor();120 double lat = bottom _left.lat() + parent.height() / 2;121 double lon = bottom _left.lon() + parent.width() / 2;122 return new BBox(bottom _left.lon(), bottom_left.lat(), lon, lat);119 LatLon bottomLeft = this.coor(); 120 double lat = bottomLeft.lat() + parent.height() / 2; 121 double lon = bottomLeft.lon() + parent.width() / 2; 122 return new BBox(bottomLeft.lon(), bottomLeft.lat(), lon, lat); 123 123 } 124 124 … … 181 181 } 182 182 183 boolean matches(final T o, final BBox search _bbox) {183 boolean matches(final T o, final BBox searchBbox) { 184 184 if (o instanceof Node) { 185 185 final LatLon latLon = ((Node) o).getCoor(); 186 186 // node without coords -> bbox[0,0,0,0] 187 return search _bbox.bounds(latLon != null ? latLon : LatLon.ZERO);188 } 189 return o.getBBox().intersects(search _bbox);190 } 191 192 private void search_contents(BBox search _bbox, List<T> result) {187 return searchBbox.bounds(latLon != null ? latLon : LatLon.ZERO); 188 } 189 return o.getBBox().intersects(searchBbox); 190 } 191 192 private void search_contents(BBox searchBbox, List<T> result) { 193 193 /* 194 194 * It is possible that this was created in a split … … 199 199 200 200 for (T o : content) { 201 if (matches(o, search _bbox)) {201 if (matches(o, searchBbox)) { 202 202 result.add(o); 203 203 } … … 299 299 } 300 300 301 private void search(BBox search _bbox, List<T> result) {302 if (!this.bbox().intersects(search _bbox))301 private void search(BBox searchBbox, List<T> result) { 302 if (!this.bbox().intersects(searchBbox)) 303 303 return; 304 else if (bbox().bounds(search _bbox)) {304 else if (bbox().bounds(searchBbox)) { 305 305 buckets.searchCache = this; 306 306 } 307 307 308 308 if (this.hasContent()) { 309 search_contents(search _bbox, result);309 search_contents(searchBbox, result); 310 310 } 311 311 … … 313 313 314 314 if (nw != null) { 315 nw.search(search _bbox, result);315 nw.search(searchBbox, result); 316 316 } 317 317 if (ne != null) { 318 ne.search(search _bbox, result);318 ne.search(searchBbox, result); 319 319 } 320 320 if (se != null) { 321 se.search(search _bbox, result);321 se.search(searchBbox, result); 322 322 } 323 323 if (sw != null) { 324 sw.search(search _bbox, result);324 sw.search(searchBbox, result); 325 325 } 326 326 } … … 330 330 } 331 331 332 int index_of(QBLevel<T> find _this) {332 int index_of(QBLevel<T> findThis) { 333 333 QBLevel<T>[] children = getChildren(); 334 334 for (int i = 0; i < QuadTiling.TILES_PER_LEVEL; i++) { 335 if (children[i] == find _this)335 if (children[i] == findThis) 336 336 return i; 337 337 } -
trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
r9790 r10001 96 96 @Override 97 97 public LatLon eastNorth2latlon(EastNorth en) { 98 double[] latlon _rad = proj.invproject((en.east() * toMeter - x0) / ellps.a / k0, (en.north() * toMeter - y0) / ellps.a / k0);99 LatLon ll = new LatLon(Math.toDegrees(latlon _rad[0]), LatLon.normalizeLon(Math.toDegrees(latlon_rad[1]) + lon0 + pm));98 double[] latlonRad = proj.invproject((en.east() * toMeter - x0) / ellps.a / k0, (en.north() * toMeter - y0) / ellps.a / k0); 99 LatLon ll = new LatLon(Math.toDegrees(latlonRad[0]), LatLon.normalizeLon(Math.toDegrees(latlonRad[1]) + lon0 + pm)); 100 100 return datum.toWGS84(ll); 101 101 } -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r10000 r10001 615 615 s = s.substring(m.end()); 616 616 } 617 final String FLOAT= "(\\d+(\\.\\d*)?)";617 final String floatPattern = "(\\d+(\\.\\d*)?)"; 618 618 boolean dms = false; 619 619 double deg = 0.0, min = 0.0, sec = 0.0; 620 620 // degrees 621 m = Pattern.compile("^"+ FLOAT+"d").matcher(s);621 m = Pattern.compile("^"+floatPattern+"d").matcher(s); 622 622 if (m.find()) { 623 623 s = s.substring(m.end()); … … 626 626 } 627 627 // minutes 628 m = Pattern.compile("^"+ FLOAT+"'").matcher(s);628 m = Pattern.compile("^"+floatPattern+"'").matcher(s); 629 629 if (m.find()) { 630 630 s = s.substring(m.end()); … … 633 633 } 634 634 // seconds 635 m = Pattern.compile("^"+ FLOAT+"\"").matcher(s);635 m = Pattern.compile("^"+floatPattern+"\"").matcher(s); 636 636 if (m.find()) { 637 637 s = s.substring(m.end()); … … 643 643 value = deg + (min/60.0) + (sec/3600.0); 644 644 } else { 645 m = Pattern.compile("^"+ FLOAT).matcher(s);645 m = Pattern.compile("^"+floatPattern).matcher(s); 646 646 if (m.find()) { 647 647 s = s.substring(m.end()); … … 780 780 } 781 781 782 private static EastNorth getPointAlong(int i, int N, ProjectionBounds r) {783 double dEast = (r.maxEast - r.minEast) / N;784 double dNorth = (r.maxNorth - r.minNorth) / N;785 if (i < N) {782 private static EastNorth getPointAlong(int i, int n, ProjectionBounds r) { 783 double dEast = (r.maxEast - r.minEast) / n; 784 double dNorth = (r.maxNorth - r.minNorth) / n; 785 if (i < n) { 786 786 return new EastNorth(r.minEast + i * dEast, r.minNorth); 787 } else if (i < 2* N) {788 i -= N;787 } else if (i < 2*n) { 788 i -= n; 789 789 return new EastNorth(r.maxEast, r.minNorth + i * dNorth); 790 } else if (i < 3* N) {791 i -= 2* N;790 } else if (i < 3*n) { 791 i -= 2*n; 792 792 return new EastNorth(r.maxEast - i * dEast, r.maxNorth); 793 } else if (i < 4* N) {794 i -= 3* N;793 } else if (i < 4*n) { 794 i -= 3*n; 795 795 return new EastNorth(r.minEast, r.maxNorth - i * dNorth); 796 796 } else { … … 824 824 @Override 825 825 public Bounds getLatLonBoundsBox(ProjectionBounds r) { 826 final int N= 10;826 final int n = 10; 827 827 Bounds result = new Bounds(eastNorth2latlon(r.getMin())); 828 828 result.extend(eastNorth2latlon(r.getMax())); 829 829 LatLon llPrev = null; 830 for (int i = 0; i < 4* N; i++) {831 LatLon llNow = eastNorth2latlon(getPointAlong(i, N, r));830 for (int i = 0; i < 4*n; i++) { 831 LatLon llNow = eastNorth2latlon(getPointAlong(i, n, r)); 832 832 result.extend(llNow); 833 833 // check if segment crosses 180th meridian and if so, make sure -
trunk/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
r9565 r10001 353 353 double lambda = Math.toRadians(coord.lon()); 354 354 355 double Rn = a / Math.sqrt(1 - e2 * Math.pow(Math.sin(phi), 2));355 double rn = a / Math.sqrt(1 - e2 * Math.pow(Math.sin(phi), 2)); 356 356 double[] xyz = new double[3]; 357 xyz[0] = Rn * Math.cos(phi) * Math.cos(lambda);358 xyz[1] = Rn * Math.cos(phi) * Math.sin(lambda);359 xyz[2] = Rn * (1 - e2) * Math.sin(phi);357 xyz[0] = rn * Math.cos(phi) * Math.cos(lambda); 358 xyz[1] = rn * Math.cos(phi) * Math.sin(lambda); 359 xyz[2] = rn * (1 - e2) * Math.sin(phi); 360 360 361 361 return xyz; -
trunk/src/org/openstreetmap/josm/data/projection/proj/AlbersEqualArea.java
r9998 r10001 167 167 */ 168 168 public double phi1(final double qs) { 169 final double tone _es = 1 - e2;169 final double toneEs = 1 - e2; 170 170 double phi = Math.asin(0.5 * qs); 171 171 if (e < EPSILON) { … … 178 178 final double com = 1.0 - con*con; 179 179 final double dphi = 0.5 * com*com / cospi * 180 (qs/tone _es - sinpi / com + 0.5/e * Math.log((1. - con) / (1. + con)));180 (qs/toneEs - sinpi / com + 0.5/e * Math.log((1. - con) / (1. + con))); 181 181 phi += dphi; 182 182 if (Math.abs(dphi) <= ITERATION_TOLERANCE) { … … 194 194 */ 195 195 private double qsfn(final double sinphi) { 196 final double one _es = 1 - e2;196 final double oneEs = 1 - e2; 197 197 if (e >= EPSILON) { 198 198 final double con = e * sinphi; 199 return one _es * (sinphi / (1. - con*con) -199 return oneEs * (sinphi / (1. - con*con) - 200 200 (0.5/e) * Math.log((1.-con) / (1.+con))); 201 201 } else { -
trunk/src/org/openstreetmap/josm/data/projection/proj/DoubleStereographic.java
r9974 r10001 58 58 } 59 59 60 private void initialize(double lat _0) {61 double phi0 = toRadians(lat _0);60 private void initialize(double lat0) { 61 double phi0 = toRadians(lat0); 62 62 double e2 = ellps.e2; 63 63 r = sqrt(1-e2) / (1 - e2*pow(sin(phi0), 2)); 64 64 n = sqrt(1 + ellps.eb2 * pow(cos(phi0), 4)); 65 double S1 = (1 + sin(phi0)) / (1 - sin(phi0));66 double S2 = (1 - e * sin(phi0)) / (1 + e * sin(phi0));67 double w1 = pow( S1 * pow(S2, e), n);65 double s1 = (1 + sin(phi0)) / (1 - sin(phi0)); 66 double s2 = (1 - e * sin(phi0)) / (1 + e * sin(phi0)); 67 double w1 = pow(s1 * pow(s2, e), n); 68 68 double sinchi00 = (w1 - 1) / (w1 + 1); 69 69 c = (n + sin(phi0)) * (1 - sinchi00) / ((n - sin(phi0)) * (1 + sinchi00)); … … 74 74 @Override 75 75 public double[] project(double phi, double lambda) { 76 double Lambda = n * lambda;77 double Sa = (1 + sin(phi)) / (1 - sin(phi));78 double Sb = (1 - e * sin(phi)) / (1 + e * sin(phi));79 double w = c * pow( Sa * pow(Sb, e), n);76 double nLambda = n * lambda; 77 double sa = (1 + sin(phi)) / (1 - sin(phi)); 78 double sb = (1 - e * sin(phi)) / (1 + e * sin(phi)); 79 double w = c * pow(sa * pow(sb, e), n); 80 80 double chi = asin((w - 1) / (w + 1)); 81 double B = 1 + sin(chi) * sin(chi0) + cos(chi) * cos(chi0) * cos(Lambda);82 double x = 2 * r * cos(chi) * sin( Lambda) / B;83 double y = 2 * r * (sin(chi) * cos(chi0) - cos(chi) * sin(chi0) * cos( Lambda)) / B;81 double b = 1 + sin(chi) * sin(chi0) + cos(chi) * cos(chi0) * cos(nLambda); 82 double x = 2 * r * cos(chi) * sin(nLambda) / b; 83 double y = 2 * r * (sin(chi) * cos(chi0) - cos(chi) * sin(chi0) * cos(nLambda)) / b; 84 84 return new double[] {x, y}; 85 85 } … … 93 93 double j = atan(x/(g - y)) - i; 94 94 double chi = chi0 + 2 * atan((y - x * tan(j/2)) / (2 * r)); 95 double Lambda = j + 2*i; 96 double lambda = Lambda / n; 95 double lambda = (j + 2*i) / n; 97 96 double psi = 0.5 * log((1 + sin(chi)) / (c*(1 - sin(chi)))) / n; 98 97 double phiprev = -1000; -
trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java
r9600 r10001 91 91 * Initialize for LCC with 2 standard parallels. 92 92 * 93 * @param lat _0 latitude of false origin (in degrees)94 * @param lat _1 latitude of first standard parallel (in degrees)95 * @param lat _2 latitude of second standard parallel (in degrees)93 * @param lat0 latitude of false origin (in degrees) 94 * @param lat1 latitude of first standard parallel (in degrees) 95 * @param lat2 latitude of second standard parallel (in degrees) 96 96 */ 97 private void initialize2SP(double lat _0, double lat_1, double lat_2) {98 this.params = new Parameters2SP(lat _0, lat_1, lat_2);97 private void initialize2SP(double lat0, double lat1, double lat2) { 98 this.params = new Parameters2SP(lat0, lat1, lat2); 99 99 100 final double m1 = m(toRadians(lat _1));101 final double m2 = m(toRadians(lat _2));100 final double m1 = m(toRadians(lat1)); 101 final double m2 = m(toRadians(lat2)); 102 102 103 final double t1 = t(toRadians(lat _1));104 final double t2 = t(toRadians(lat _2));105 final double tf = t(toRadians(lat _0));103 final double t1 = t(toRadians(lat1)); 104 final double t2 = t(toRadians(lat2)); 105 final double tf = t(toRadians(lat0)); 106 106 107 107 n = (log(m1) - log(m2)) / (log(t1) - log(t2)); … … 113 113 * Initialize for LCC with 1 standard parallel. 114 114 * 115 * @param lat _0 latitude of natural origin (in degrees)115 * @param lat0 latitude of natural origin (in degrees) 116 116 */ 117 private void initialize1SP(double lat _0) {118 this.params = new Parameters1SP(lat _0);119 final double lat _0_rad = toRadians(lat_0);117 private void initialize1SP(double lat0) { 118 this.params = new Parameters1SP(lat0); 119 final double lat0rad = toRadians(lat0); 120 120 121 final double m0 = m(lat _0_rad);122 final double t0 = t(lat _0_rad);121 final double m0 = m(lat0rad); 122 final double t0 = t(lat0rad); 123 123 124 n = sin(lat _0_rad);124 n = sin(lat0rad); 125 125 f = m0 / (n * pow(t0, n)); 126 126 r0 = f * pow(t0, n); … … 129 129 /** 130 130 * auxiliary function t 131 * @param lat _rad latitude in radians131 * @param latRad latitude in radians 132 132 * @return result 133 133 */ 134 protected double t(double lat _rad) {135 return tan(PI/4 - lat _rad / 2.0)136 / pow((1.0 - e * sin(lat _rad)) / (1.0 + e * sin(lat_rad)), e/2);134 protected double t(double latRad) { 135 return tan(PI/4 - latRad / 2.0) 136 / pow((1.0 - e * sin(latRad)) / (1.0 + e * sin(latRad)), e/2); 137 137 } 138 138 139 139 /** 140 140 * auxiliary function m 141 * @param lat _rad latitude in radians141 * @param latRad latitude in radians 142 142 * @return result 143 143 */ 144 protected double m(double lat _rad) {145 return cos(lat _rad) / (sqrt(1 - e * e * pow(sin(lat_rad), 2)));144 protected double m(double latRad) { 145 return cos(latRad) / (sqrt(1 - e * e * pow(sin(latRad), 2))); 146 146 } 147 147 -
trunk/src/org/openstreetmap/josm/data/projection/proj/LonLat.java
r9628 r10001 30 30 31 31 @Override 32 public double[] project(double lat _rad, double lon_rad) {33 return new double[] {Math.toDegrees(lon _rad) / a, Math.toDegrees(lat_rad) / a};32 public double[] project(double latRad, double lonRad) { 33 return new double[] {Math.toDegrees(lonRad) / a, Math.toDegrees(latRad) / a}; 34 34 } 35 35 -
trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java
r10000 r10001 379 379 double temp = 1.0 / q; 380 380 double s = 0.5 * (q - temp); 381 double V= Math.sin(b * x);382 double U = (s * singamma0 - V* cosgamma0) / (0.5 * (q + temp));383 if (Math.abs(Math.abs( U) - 1.0) < EPSILON) {381 double v2 = Math.sin(b * x); 382 double u2 = (s * singamma0 - v2 * cosgamma0) / (0.5 * (q + temp)); 383 if (Math.abs(Math.abs(u2) - 1.0) < EPSILON) { 384 384 v = 0; // this is actually an error and should be reported to the caller somehow 385 385 } else { 386 v = 0.5 * arb * Math.log((1.0 - U) / (1.0 + U));386 v = 0.5 * arb * Math.log((1.0 - u2) / (1.0 + u2)); 387 387 } 388 388 temp = Math.cos(b * x); … … 390 390 u = ab * x; 391 391 } else { 392 u = arb * Math.atan2(s * cosgamma0 + V* singamma0, temp);392 u = arb * Math.atan2(s * cosgamma0 + v2 * singamma0, temp); 393 393 } 394 394 } else { -
trunk/src/org/openstreetmap/josm/data/projection/proj/PolarStereographic.java
r9998 r10001 171 171 @Override 172 172 public Bounds getAlgorithmBounds() { 173 final double CUT= 60;173 final double cut = 60; 174 174 if (southPole) { 175 return new Bounds(-90, -180, CUT, 180, false);175 return new Bounds(-90, -180, cut, 180, false); 176 176 } else { 177 return new Bounds(- CUT, -180, 90, 180, false);177 return new Bounds(-cut, -180, 90, 180, false); 178 178 } 179 179 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/Proj.java
r9628 r10001 50 50 * Convert lat/lon to east/north. 51 51 * 52 * @param lat _rad the latitude in radians53 * @param lon _rad the longitude in radians52 * @param latRad the latitude in radians 53 * @param lonRad the longitude in radians 54 54 * @return array of length 2, containing east and north value in meters, 55 55 * divided by the semi major axis of the ellipsoid. 56 56 */ 57 double[] project(double lat _rad, double lon_rad);57 double[] project(double latRad, double lonRad); 58 58 59 59 /** -
trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java
r9628 r10001 56 56 } 57 57 58 private void initialize(double lat _0) {59 phi0 = toRadians(lat _0);58 private void initialize(double lat0) { 59 phi0 = toRadians(lat0); 60 60 kR = sqrt(1 - ellps.e2) / (1 - (ellps.e2 * pow(sin(phi0), 2))); 61 61 alpha = sqrt(1 + (ellps.eb2 * pow(cos(phi0), 4))); … … 78 78 @Override 79 79 public double[] project(double phi, double lambda) { 80 double S= alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 280 double s = alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 2 81 81 * log((1 + ellps.e * sin(phi)) / (1 - ellps.e * sin(phi))) + k; 82 double b = 2 * (atan(exp( S)) - PI / 4);82 double b = 2 * (atan(exp(s)) - PI / 4); 83 83 double l = alpha * lambda; 84 84 -
trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
r9070 r10001 119 119 int i; // iterates through s 120 120 int j; // iterates through t 121 char s _i; // ith character of s122 char t _j; // jth character of t121 char si; // ith character of s 122 char tj; // jth character of t 123 123 int cost; // cost 124 124 … … 143 143 for (i = 1; i <= n; i++) { 144 144 145 s _i = s.charAt(i - 1);145 si = s.charAt(i - 1); 146 146 147 147 // Step 4 148 148 for (j = 1; j <= m; j++) { 149 149 150 t _j = t.charAt(j - 1);150 tj = t.charAt(j - 1); 151 151 152 152 // Step 5 153 if (s _i == t_j) {153 if (si == tj) { 154 154 cost = 0; 155 155 } else { -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r8836 r10001 389 389 nearbyNodeCache = null; 390 390 List<LatLon> bounds = this.getBounds(dist); 391 List<Node> found _nodes = endnodesHighway.search(new BBox(bounds.get(0), bounds.get(1)));392 found _nodes.addAll(endnodes.search(new BBox(bounds.get(0), bounds.get(1))));393 394 for (Node n : found _nodes) {391 List<Node> foundNodes = endnodesHighway.search(new BBox(bounds.get(0), bounds.get(1))); 392 foundNodes.addAll(endnodes.search(new BBox(bounds.get(0), bounds.get(1)))); 393 394 for (Node n : foundNodes) { 395 395 if (!nearby(n, dist) || !n.getCoor().isIn(dsArea)) { 396 396 continue; -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r10000 r10001 418 418 name = tr("relation"); 419 419 } 420 String admin _level = relation.get("admin_level");421 if (admin _level != null) {422 name += '['+admin _level+']';420 String adminLevel = relation.get("admin_level"); 421 if (adminLevel != null) { 422 name += '['+adminLevel+']'; 423 423 } 424 424 -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r9983 r10001 320 320 321 321 for (int i = 0; i < bTexts.length; i++) { 322 final int final _i= i;322 final int finalI = i; 323 323 Action action = new AbstractAction(bTexts[i]) { 324 324 @Override 325 325 public void actionPerformed(ActionEvent evt) { 326 buttonAction(final _i, evt);326 buttonAction(finalI, evt); 327 327 } 328 328 }; -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r9976 r10001 553 553 LatLon ll2 = getLatLon(width / 2 + 50, height / 2); 554 554 if (ll1.isValid() && ll2.isValid() && b.contains(ll1) && b.contains(ll2)) { 555 double d _m = ll1.greatCircleDistance(ll2);556 double d _en = 100 * scale;557 double scaleMin = 0.01 * d _en / d_m / 100;555 double dm = ll1.greatCircleDistance(ll2); 556 double den = 100 * scale; 557 double scaleMin = 0.01 * den / dm / 100; 558 558 if (!Double.isInfinite(scaleMin) && newScale < scaleMin) { 559 559 newScale = scaleMin; … … 1026 1026 } 1027 1027 1028 Point2D A = getPoint2D(lastN);1029 Point2D B = getPoint2D(n);1030 double c = A.distanceSq(B);1031 double a = p.distanceSq( B);1032 double b = p.distanceSq( A);1028 Point2D pA = getPoint2D(lastN); 1029 Point2D pB = getPoint2D(n); 1030 double c = pA.distanceSq(pB); 1031 double a = p.distanceSq(pB); 1032 double b = p.distanceSq(pA); 1033 1033 1034 1034 /* perpendicular distance squared … … 1142 1142 * @param p the point for which to search the nearest segment. 1143 1143 * @param predicate the returned object has to fulfill certain properties. 1144 * @param use _selected whether selected way segments should be preferred.1144 * @param useSelected whether selected way segments should be preferred. 1145 1145 * @param preferredRefs - prefer segments related to these primitives, may be null 1146 1146 * … … 1153 1153 */ 1154 1154 public final WaySegment getNearestWaySegment(Point p, Predicate<OsmPrimitive> predicate, 1155 boolean use _selected, Collection<OsmPrimitive> preferredRefs) {1155 boolean useSelected, Collection<OsmPrimitive> preferredRefs) { 1156 1156 WaySegment wayseg = null, ntsel = null, ntref = null; 1157 1157 if (preferredRefs != null && preferredRefs.isEmpty()) preferredRefs = null; … … 1185 1185 } 1186 1186 } 1187 if (ntsel != null && use _selected)1187 if (ntsel != null && useSelected) 1188 1188 return ntsel; 1189 1189 if (ntref != null) … … 1352 1352 * @param p The point on screen. 1353 1353 * @param predicate the returned object has to fulfill certain properties. 1354 * @param use _selected whether to prefer primitives that are currently selected or referred by selected primitives1354 * @param useSelected whether to prefer primitives that are currently selected or referred by selected primitives 1355 1355 * 1356 1356 * @return A primitive within snap-distance to point p, … … 1359 1359 * @see #getNearestWay(Point, Predicate) 1360 1360 */ 1361 public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean use _selected) {1361 public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean useSelected) { 1362 1362 Collection<OsmPrimitive> sel; 1363 1363 DataSet ds = getCurrentDataSet(); 1364 if (use _selected && ds != null) {1364 if (useSelected && ds != null) { 1365 1365 sel = ds.getSelected(); 1366 1366 } else { 1367 1367 sel = null; 1368 1368 } 1369 OsmPrimitive osm = getNearestNode(p, predicate, use _selected, sel);1370 1371 if (isPrecedenceNode((Node) osm, p, use _selected)) return osm;1369 OsmPrimitive osm = getNearestNode(p, predicate, useSelected, sel); 1370 1371 if (isPrecedenceNode((Node) osm, p, useSelected)) return osm; 1372 1372 WaySegment ws; 1373 if (use _selected) {1374 ws = getNearestWaySegment(p, predicate, use _selected, sel);1373 if (useSelected) { 1374 ws = getNearestWaySegment(p, predicate, useSelected, sel); 1375 1375 } else { 1376 ws = getNearestWaySegment(p, predicate, use _selected);1376 ws = getNearestWaySegment(p, predicate, useSelected); 1377 1377 } 1378 1378 if (ws == null) return osm; 1379 1379 1380 if ((ws.way.isSelected() && use _selected) || osm == null) {1380 if ((ws.way.isSelected() && useSelected) || osm == null) { 1381 1381 // either (no _selected_ nearest node found, if desired) or no nearest node was found 1382 1382 osm = ws.way; -
trunk/src/org/openstreetmap/josm/gui/NotificationManager.java
r9078 r10001 108 108 currentNotificationPanel.validate(); 109 109 110 int MARGIN= 5;110 int margin = 5; 111 111 int x, y; 112 112 JFrame parentWindow = (JFrame) Main.parent; … … 115 115 MapView mv = Main.map.mapView; 116 116 Point mapViewPos = SwingUtilities.convertPoint(mv.getParent(), mv.getX(), mv.getY(), Main.parent); 117 x = mapViewPos.x + MARGIN;118 y = mapViewPos.y + mv.getHeight() - Main.map.statusLine.getHeight() - size.height - MARGIN;117 x = mapViewPos.x + margin; 118 y = mapViewPos.y + mv.getHeight() - Main.map.statusLine.getHeight() - size.height - margin; 119 119 } else { 120 x = MARGIN;121 y = parentWindow.getHeight() - Main.toolbar.control.getSize().height - size.height - MARGIN;120 x = margin; 121 y = parentWindow.getHeight() - Main.toolbar.control.getSize().height - size.height - margin; 122 122 } 123 123 parentWindow.getLayeredPane().add(currentNotificationPanel, JLayeredPane.POPUP_LAYER, 0); -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r9983 r10001 240 240 return; 241 241 242 Point p _max = new Point(Math.max(aEnd.x, aStart.x), Math.max(aEnd.y, aStart.y));243 Point p _min = new Point(Math.min(aEnd.x, aStart.x), Math.min(aEnd.y, aStart.y));244 245 iSelectionRectStart = getPosition(p _min);246 iSelectionRectEnd = getPosition(p _max);242 Point pMax = new Point(Math.max(aEnd.x, aStart.x), Math.max(aEnd.y, aStart.y)); 243 Point pMin = new Point(Math.min(aEnd.x, aStart.x), Math.min(aEnd.y, aStart.y)); 244 245 iSelectionRectStart = getPosition(pMin); 246 iSelectionRectEnd = getPosition(pMax); 247 247 248 248 Bounds b = new Bounds( -
trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
r9078 r10001 154 154 155 155 // calc the screen coordinates for the new selection rectangle 156 MapMarkerDot xmin_ymin = new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon());157 MapMarkerDot xmax_ymax = new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon());158 159 156 List<MapMarker> marker = new ArrayList<>(2); 160 marker.add( xmin_ymin);161 marker.add( xmax_ymax);157 marker.add(new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon())); 158 marker.add(new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon())); 162 159 mapViewer.setBoundingBox(bbox); 163 160 mapViewer.setMapMarkerList(marker); … … 704 701 int zoomDiff = MAX_ZOOM - zoom; 705 702 Point tlc = getTopLeftCoordinates(); 706 int x _min = (min.x >> zoomDiff) - tlc.x;707 int y _min = (min.y >> zoomDiff) - tlc.y;708 int x _max = (max.x >> zoomDiff) - tlc.x;709 int y _max = (max.y >> zoomDiff) - tlc.y;710 711 int w = x _max - x_min;712 int h = y _max - y_min;703 int xMin = (min.x >> zoomDiff) - tlc.x; 704 int yMin = (min.y >> zoomDiff) - tlc.y; 705 int xMax = (max.x >> zoomDiff) - tlc.x; 706 int yMax = (max.y >> zoomDiff) - tlc.y; 707 708 int w = xMax - xMin; 709 int h = yMax - yMin; 713 710 g.setColor(new Color(0.9f, 0.7f, 0.7f, 0.6f)); 714 g.fillRect(x _min, y_min, w, h);711 g.fillRect(xMin, yMin, w, h); 715 712 716 713 g.setColor(Color.BLACK); 717 g.drawRect(x _min, y_min, w, h);714 g.drawRect(xMin, yMin, w, h); 718 715 } catch (Exception e) { 719 716 Main.error(e); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
r10000 r10001 418 418 abstract static class CopyAction extends AbstractAction implements ListSelectionListener { 419 419 420 protected CopyAction(String icon _name, String action_name, String short_description) {421 ImageIcon icon = ImageProvider.get("dialogs/conflict", icon _name);420 protected CopyAction(String iconName, String actionName, String shortDescription) { 421 ImageIcon icon = ImageProvider.get("dialogs/conflict", iconName); 422 422 putValue(Action.SMALL_ICON, icon); 423 423 if (icon == null) { 424 putValue(Action.NAME, action _name);424 putValue(Action.NAME, actionName); 425 425 } 426 putValue(Action.SHORT_DESCRIPTION, short _description);426 putValue(Action.SHORT_DESCRIPTION, shortDescription); 427 427 setEnabled(false); 428 428 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r9078 r10001 107 107 public void reconstruct(Action action, ToggleDialog triggeredBy) { 108 108 109 final int N= allDialogs.size();109 final int n = allDialogs.size(); 110 110 111 111 /** … … 126 126 * in the last panel anyway. 127 127 */ 128 JPanel p = panels.get( N-1); // current Panel (start with last one)128 JPanel p = panels.get(n-1); // current Panel (start with last one) 129 129 int k = -1; // indicates that current Panel index is N-1, but no default-view-Dialog has been added to this Panel yet. 130 for (int i = N-1; i >= 0; --i) {130 for (int i = n-1; i >= 0; --i) { 131 131 final ToggleDialog dlg = allDialogs.get(i); 132 132 if (dlg.isDialogInDefaultView()) { 133 133 if (k == -1) { 134 k = N-1;134 k = n-1; 135 135 } else { 136 136 --k; … … 146 146 147 147 if (k == -1) { 148 k = N-1;149 } 150 final int numPanels = N- k;148 k = n-1; 149 } 150 final int numPanels = n - k; 151 151 152 152 /** … … 154 154 */ 155 155 if (action == Action.ELEMENT_SHRINKS) { 156 for (int i = 0; i < N; ++i) {156 for (int i = 0; i < n; ++i) { 157 157 final ToggleDialog dlg = allDialogs.get(i); 158 158 if (dlg.isDialogInDefaultView()) { … … 191 191 192 192 /** total Height */ 193 final int H= mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height;193 final int h = mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height; 194 194 195 195 /** space, that is available for dialogs in default view (after the reconfiguration) */ 196 final int s2 = H- (numPanels - 1) * DIVIDER_SIZE - sumC;197 198 final int hp _trig = triggeredBy.getPreferredHeight();199 if (hp _trig <= 0) throw new IllegalStateException(); // Must be positive196 final int s2 = h - (numPanels - 1) * DIVIDER_SIZE - sumC; 197 198 final int hpTrig = triggeredBy.getPreferredHeight(); 199 if (hpTrig <= 0) throw new IllegalStateException(); // Must be positive 200 200 201 201 /** The new dialog gets a fair share */ 202 final int hn _trig = hp_trig * s2 / (hp_trig + sumP);203 triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hn _trig));202 final int hnTrig = hpTrig * s2 / (hpTrig + sumP); 203 triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hnTrig)); 204 204 205 205 /** This is remainig for the other default view dialogs */ 206 final int R = s2 - hn_trig;206 final int r = s2 - hnTrig; 207 207 208 208 /** 209 209 * Take space only from dialogs that are relatively large 210 210 */ 211 int D_m = 0; // additional space needed by the small dialogs212 int D_p = 0; // available space from the large dialogs213 for (int i = 0; i < N; ++i) {211 int dm = 0; // additional space needed by the small dialogs 212 int dp = 0; // available space from the large dialogs 213 for (int i = 0; i < n; ++i) { 214 214 final ToggleDialog dlg = allDialogs.get(i); 215 215 if (dlg.isDialogInDefaultView() && dlg != triggeredBy) { 216 216 final int ha = dlg.getSize().height; // current 217 final int h0 = ha * R/ sumA; // proportional shrinking218 final int he = dlg.getPreferredHeight() * s2 / (sumP + hp _trig); // fair share217 final int h0 = ha * r / sumA; // proportional shrinking 218 final int he = dlg.getPreferredHeight() * s2 / (sumP + hpTrig); // fair share 219 219 if (h0 < he) { // dialog is relatively small 220 220 int hn = Math.min(ha, he); // shrink less, but do not grow 221 D_m += hn - h0;221 dm += hn - h0; 222 222 } else { // dialog is relatively large 223 D_p += h0 - he;223 dp += h0 - he; 224 224 } 225 225 } 226 226 } 227 227 /** adjust, without changing the sum */ 228 for (int i = 0; i < N; ++i) {228 for (int i = 0; i < n; ++i) { 229 229 final ToggleDialog dlg = allDialogs.get(i); 230 230 if (dlg.isDialogInDefaultView() && dlg != triggeredBy) { 231 231 final int ha = dlg.getHeight(); 232 final int h0 = ha * R/ sumA;233 final int he = dlg.getPreferredHeight() * s2 / (sumP + hp _trig);232 final int h0 = ha * r / sumA; 233 final int he = dlg.getPreferredHeight() * s2 / (sumP + hpTrig); 234 234 if (h0 < he) { 235 235 int hn = Math.min(ha, he); … … 238 238 int d; 239 239 try { 240 d = (h0-he) * D_m / D_p;240 d = (h0-he) * dm / dp; 241 241 } catch (ArithmeticException e) { /* D_p may be zero - nothing wrong with that. */ 242 242 d = 0; … … 253 253 final List<Node> ch = new ArrayList<>(); 254 254 255 for (int i = k; i <= N-1; ++i) {255 for (int i = k; i <= n-1; ++i) { 256 256 if (i != k) { 257 257 ch.add(new Divider()); … … 279 279 * Hide the Panel, if there is nothing to show 280 280 */ 281 if (numPanels == 1 && panels.get( N-1).getComponents().length == 0) {281 if (numPanels == 1 && panels.get(n-1).getComponents().length == 0) { 282 282 parent.setDividerSize(0); 283 283 this.setVisible(false); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
r9970 r10001 212 212 } 213 213 214 private Direction determineDirection(int ref _i, Direction ref_direction, int k) {215 return determineDirection(ref _i, ref_direction, k, false);214 private Direction determineDirection(int refI, Direction refDirection, int k) { 215 return determineDirection(refI, refDirection, k, false); 216 216 } 217 217 … … 225 225 * Let the relation be a route of oneway streets, and someone travels them in the given order. 226 226 * Direction is FORWARD if it is legal and BACKWARD if it is illegal to do so for the given way. 227 * @param ref _iway key228 * @param ref _direction direction of ref_i227 * @param refI way key 228 * @param refDirection direction of ref_i 229 229 * @param k successor of ref_i 230 230 * @param reversed if {@code true} determine reverse direction 231 231 * @return direction of way {@code k} 232 232 */ 233 private Direction determineDirection(int ref _i, final Direction ref_direction, int k, boolean reversed) {234 if (ref _i < 0 || k < 0 || ref_i>= members.size() || k >= members.size())233 private Direction determineDirection(int refI, final Direction refDirection, int k, boolean reversed) { 234 if (refI < 0 || k < 0 || refI >= members.size() || k >= members.size()) 235 235 return NONE; 236 if (ref _direction == NONE)236 if (refDirection == NONE) 237 237 return NONE; 238 238 239 final RelationMember m _ref = members.get(ref_i);239 final RelationMember mRef = members.get(refI); 240 240 final RelationMember m = members.get(k); 241 Way way _ref = null;241 Way wayRef = null; 242 242 Way way = null; 243 243 244 if (m _ref.isWay()) {245 way _ref = m_ref.getWay();244 if (mRef.isWay()) { 245 wayRef = mRef.getWay(); 246 246 } 247 247 if (m.isWay()) { … … 249 249 } 250 250 251 if (way _ref == null || way == null)251 if (wayRef == null || way == null) 252 252 return NONE; 253 253 … … 255 255 List<Node> refNodes = new ArrayList<>(); 256 256 257 switch (ref _direction) {257 switch (refDirection) { 258 258 case FORWARD: 259 refNodes.add(way _ref.lastNode());259 refNodes.add(wayRef.lastNode()); 260 260 break; 261 261 case BACKWARD: 262 refNodes.add(way _ref.firstNode());262 refNodes.add(wayRef.firstNode()); 263 263 break; 264 264 case ROUNDABOUT_LEFT: 265 265 case ROUNDABOUT_RIGHT: 266 refNodes = way _ref.getNodes();266 refNodes = wayRef.getNodes(); 267 267 break; 268 268 } -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r9971 r10001 1013 1013 1014 1014 // How many pixels into the 'source' rectangle are we drawing? 1015 int screen _x_offset = target.x - source.x;1016 int screen _y_offset = target.y - source.y;1015 int screenXoffset = target.x - source.x; 1016 int screenYoffset = target.y - source.y; 1017 1017 // And how many pixels into the image itself does that correlate to? 1018 int img _x_offset = (int) (screen_x_offset * imageXScaling + 0.5);1019 int img _y_offset = (int) (screen_y_offset * imageYScaling + 0.5);1018 int imgXoffset = (int) (screenXoffset * imageXScaling + 0.5); 1019 int imgYoffset = (int) (screenYoffset * imageYScaling + 0.5); 1020 1020 // Now calculate the other corner of the image that we need 1021 1021 // by scaling the 'target' rectangle's dimensions. 1022 int img _x_end = img_x_offset + (int) (target.getWidth() * imageXScaling + 0.5);1023 int img _y_end = img_y_offset + (int) (target.getHeight() * imageYScaling + 0.5);1022 int imgXend = imgXoffset + (int) (target.getWidth() * imageXScaling + 0.5); 1023 int imgYend = imgYoffset + (int) (target.getHeight() * imageYScaling + 0.5); 1024 1024 1025 1025 if (Main.isDebugEnabled()) { … … 1029 1029 target.x, target.y, 1030 1030 target.x + target.width, target.y + target.height, 1031 img _x_offset, img_y_offset,1032 img _x_end, img_y_end,1031 imgXoffset, imgYoffset, 1032 imgXend, imgYend, 1033 1033 this); 1034 1034 if (PROP_FADE_AMOUNT.get() != 0) { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r9997 r10001 840 840 return tr("No gpx selected"); 841 841 842 final long offset _ms = ((long) (timezone.getHours() * 3600 * 1000)) + delta.getMilliseconds(); // in milliseconds843 lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, offset _ms);842 final long offsetMs = ((long) (timezone.getHours() * 3600 * 1000)) + delta.getMilliseconds(); // in milliseconds 843 lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, offsetMs); 844 844 845 845 return trn("<html>Matched <b>{0}</b> of <b>{1}</b> photo to GPX track.</html>", -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r9543 r10001 91 91 Shortcut scPrev = Shortcut.registerShortcut( 92 92 "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.DIRECT); 93 final String APREVIOUS= "Previous Image";93 final String previousImage = "Previous Image"; 94 94 Main.registerActionShortcut(prevAction, scPrev); 95 btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), APREVIOUS);96 btnPrevious.getActionMap().put( APREVIOUS, prevAction);95 btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), previousImage); 96 btnPrevious.getActionMap().put(previousImage, prevAction); 97 97 btnPrevious.setEnabled(false); 98 98 99 final String DELETE_TEXT= tr("Remove photo from layer");100 ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), DELETE_TEXT);99 final String removePhoto = tr("Remove photo from layer"); 100 ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), removePhoto); 101 101 JButton btnDelete = new JButton(delAction); 102 102 btnDelete.setPreferredSize(buttonDim); … … 104 104 "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo from layer")), KeyEvent.VK_DELETE, Shortcut.SHIFT); 105 105 Main.registerActionShortcut(delAction, scDelete); 106 btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), DELETE_TEXT);107 btnDelete.getActionMap().put( DELETE_TEXT, delAction);106 btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), removePhoto); 107 btnDelete.getActionMap().put(removePhoto, delAction); 108 108 109 109 ImageAction delFromDiskAction = new ImageAction(COMMAND_REMOVE_FROM_DISK, … … 113 113 Shortcut scDeleteFromDisk = Shortcut.registerShortcut( 114 114 "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete File from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT); 115 final String ADELFROMDISK= "Delete image file from disk";115 final String deleteImage = "Delete image file from disk"; 116 116 Main.registerActionShortcut(delFromDiskAction, scDeleteFromDisk); 117 btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), ADELFROMDISK);118 btnDeleteFromDisk.getActionMap().put( ADELFROMDISK, delFromDiskAction);117 btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), deleteImage); 118 btnDeleteFromDisk.getActionMap().put(deleteImage, delFromDiskAction); 119 119 120 120 ImageAction copyPathAction = new ImageAction(COMMAND_COPY_PATH, ImageProvider.get("copy"), tr("Copy image path")); … … 123 123 Shortcut scCopyPath = Shortcut.registerShortcut( 124 124 "geoimage:copypath", tr("Geoimage: {0}", tr("Copy image path")), KeyEvent.VK_C, Shortcut.ALT_CTRL_SHIFT); 125 final String ACOPYPATH= "Copy image path";125 final String copyImage = "Copy image path"; 126 126 Main.registerActionShortcut(copyPathAction, scCopyPath); 127 btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), ACOPYPATH);128 btnCopyPath.getActionMap().put( ACOPYPATH, copyPathAction);127 btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), copyImage); 128 btnCopyPath.getActionMap().put(copyImage, copyPathAction); 129 129 130 130 ImageAction nextAction = new ImageAction(COMMAND_NEXT, ImageProvider.get("dialogs", "next"), tr("Next")); … … 133 133 Shortcut scNext = Shortcut.registerShortcut( 134 134 "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.DIRECT); 135 final String ANEXT= "Next Image";135 final String nextImage = "Next Image"; 136 136 Main.registerActionShortcut(nextAction, scNext); 137 btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), ANEXT);138 btnNext.getActionMap().put( ANEXT, nextAction);137 btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), nextImage); 138 btnNext.getActionMap().put(nextImage, nextAction); 139 139 btnNext.setEnabled(false); 140 140 -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java
r9817 r10001 93 93 * and then stop because it has more than 50k nodes. 94 94 */ 95 final double buffer _dist = panel.getDistance();96 final double max _area = panel.getArea() / 10000.0 / scale;97 final double buffer _y = buffer_dist / 100000.0;98 final double buffer _x = buffer_y/ scale;95 final double bufferDist = panel.getDistance(); 96 final double maxArea = panel.getArea() / 10000.0 / scale; 97 final double bufferY = bufferDist / 100000.0; 98 final double bufferX = bufferY / scale; 99 99 final int totalTicks = latcnt; 100 100 // guess if a progress bar might be useful. 101 final boolean displayProgress = totalTicks > 2000 && buffer _y< 0.01;101 final boolean displayProgress = totalTicks > 2000 && bufferY < 0.01; 102 102 103 103 class CalculateDownloadArea extends PleaseWaitRunnable { … … 126 126 return; 127 127 } 128 confirmAndDownloadAreas(a, max _area, panel.isDownloadOsmData(), panel.isDownloadGpxData(),128 confirmAndDownloadAreas(a, maxArea, panel.isDownloadOsmData(), panel.isDownloadGpxData(), 129 129 tr("Download from OSM along this track"), progressMonitor); 130 130 } … … 147 147 tick(); 148 148 LatLon c = p.getCoor(); 149 if (previous == null || c.greatCircleDistance(previous) > buffer _dist) {149 if (previous == null || c.greatCircleDistance(previous) > bufferDist) { 150 150 // we add a buffer around the point. 151 r.setRect(c.lon() - buffer _x, c.lat() - buffer_y, 2 * buffer_x, 2 * buffer_y);151 r.setRect(c.lon() - bufferX, c.lat() - bufferY, 2 * bufferX, 2 * bufferY); 152 152 a.add(new Area(r)); 153 153 return c; -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r9248 r10001 94 94 /* calculate time differences in waypoints */ 95 95 double time = wpt.time; 96 boolean wpt _has_link = wpt.attr.containsKey(GpxConstants.META_LINKS);97 if (firstTime < 0 && wpt _has_link) {96 boolean wptHasLink = wpt.attr.containsKey(GpxConstants.META_LINKS); 97 if (firstTime < 0 && wptHasLink) { 98 98 firstTime = time; 99 99 for (GpxLink oneLink : wpt.<GpxLink>getCollection(GpxConstants.META_LINKS)) { … … 102 102 } 103 103 } 104 if (wpt _has_link) {104 if (wptHasLink) { 105 105 for (GpxLink oneLink : wpt.<GpxLink>getCollection(GpxConstants.META_LINKS)) { 106 106 String uri = oneLink.uri; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/CSSColors.java
r7509 r10001 9 9 private static final Map<String, Color> CSS_COLORS = new HashMap<>(); 10 10 static { 11 Object[][] CSSCOLORS_INIT =new Object[][] {11 for (Object[] pair : new Object[][] { 12 12 {"aliceblue", 0xf0f8ff}, 13 13 {"antiquewhite", 0xfaebd7}, … … 157 157 {"yellow", 0xffff00}, 158 158 {"yellowgreen", 0x9acd32} 159 }; 160 for (Object[] pair : CSSCOLORS_INIT) { 159 }) { 161 160 CSS_COLORS.put((String) pair[0], new Color((Integer) pair[1])); 162 161 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r9983 r10001 149 149 } 150 150 151 float test _float;151 float testFloat; 152 152 try { 153 test _float = Float.parseFloat(testString);153 testFloat = Float.parseFloat(testString); 154 154 } catch (NumberFormatException e) { 155 155 return false; 156 156 } 157 float prototype _float = Float.parseFloat(prototypeString);157 float prototypeFloat = Float.parseFloat(prototypeString); 158 158 159 159 switch (this) { 160 160 case GREATER_OR_EQUAL: 161 return test _float >= prototype_float;161 return testFloat >= prototypeFloat; 162 162 case GREATER: 163 return test _float > prototype_float;163 return testFloat > prototypeFloat; 164 164 case LESS_OR_EQUAL: 165 return test _float <= prototype_float;165 return testFloat <= prototypeFloat; 166 166 case LESS: 167 return test _float < prototype_float;167 return testFloat < prototypeFloat; 168 168 default: 169 169 throw new AssertionError(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
r9371 r10001 56 56 public final float defaultMajorZIndex; 57 57 58 LineType(String prefix, float default _major_z_index) {58 LineType(String prefix, float defaultMajorZindex) { 59 59 this.prefix = prefix; 60 this.defaultMajorZIndex = default _major_z_index;61 } 62 } 63 64 protected LineElement(Cascade c, float default _major_z_index, BasicStroke line, Color color, BasicStroke dashesLine,60 this.defaultMajorZIndex = defaultMajorZindex; 61 } 62 } 63 64 protected LineElement(Cascade c, float defaultMajorZindex, BasicStroke line, Color color, BasicStroke dashesLine, 65 65 Color dashesBackground, float offset, float realWidth, boolean wayDirectionArrows) { 66 super(c, default _major_z_index);66 super(c, defaultMajorZindex); 67 67 this.line = line; 68 68 this.color = color; … … 104 104 private static LineElement createImpl(Environment env, LineType type) { 105 105 Cascade c = env.mc.getCascade(env.layer); 106 Cascade c _def = env.mc.getCascade("default");106 Cascade cDef = env.mc.getCascade("default"); 107 107 Float width; 108 108 switch (type) { 109 109 case NORMAL: 110 width = getWidth(c, WIDTH, getWidth(c _def, WIDTH, null));110 width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null)); 111 111 break; 112 112 case CASING: 113 113 Float casingWidth = c.get(type.prefix + WIDTH, null, Float.class, true); 114 114 if (casingWidth == null) { 115 RelativeFloat rel _casingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);116 if (rel _casingWidth != null) {117 casingWidth = rel _casingWidth.val / 2;115 RelativeFloat relCasingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true); 116 if (relCasingWidth != null) { 117 casingWidth = relCasingWidth.val / 2; 118 118 } 119 119 } 120 120 if (casingWidth == null) 121 121 return null; 122 width = getWidth(c, WIDTH, getWidth(c _def, WIDTH, null));122 width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null)); 123 123 if (width == null) { 124 124 width = 0f; … … 162 162 case LEFT_CASING: 163 163 case RIGHT_CASING: 164 Float baseWidthOnDefault = getWidth(c _def, WIDTH, null);164 Float baseWidthOnDefault = getWidth(cDef, WIDTH, null); 165 165 Float baseWidth = getWidth(c, WIDTH, baseWidthOnDefault); 166 166 if (baseWidth == null || baseWidth < 2f) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r9371 r10001 93 93 BoxTextElement.SIMPLE_NODE_TEXT_ELEMSTYLE); 94 94 95 protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float default _major_z_index, RotationAngle rotationAngle) {96 super(c, default _major_z_index);95 protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle) { 96 super(c, defaultMajorZindex); 97 97 this.mapImage = mapImage; 98 98 this.symbol = symbol; … … 104 104 } 105 105 106 private static NodeElement create(Environment env, float default _major_z_index, boolean allowDefault) {106 private static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) { 107 107 Cascade c = env.mc.getCascade(env.layer); 108 108 … … 138 138 if (!allowDefault && symbol == null && mapImage == null) return null; 139 139 140 return new NodeElement(c, mapImage, symbol, default _major_z_index, rotationAngle);140 return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle); 141 141 } 142 142 … … 148 148 return null; 149 149 150 Cascade c _def = env.mc.getCascade("default");151 152 Float widthOnDefault = c _def.get(keys[ICON_WIDTH_IDX], null, Float.class);150 Cascade cDef = env.mc.getCascade("default"); 151 152 Float widthOnDefault = cDef.get(keys[ICON_WIDTH_IDX], null, Float.class); 153 153 if (widthOnDefault != null && widthOnDefault <= 0) { 154 154 widthOnDefault = null; … … 156 156 Float widthF = getWidth(c, keys[ICON_WIDTH_IDX], widthOnDefault); 157 157 158 Float heightOnDefault = c _def.get(keys[ICON_HEIGHT_IDX], null, Float.class);158 Float heightOnDefault = cDef.get(keys[ICON_HEIGHT_IDX], null, Float.class); 159 159 if (heightOnDefault != null && heightOnDefault <= 0) { 160 160 heightOnDefault = null; … … 189 189 private static Symbol createSymbol(Environment env) { 190 190 Cascade c = env.mc.getCascade(env.layer); 191 Cascade c _def = env.mc.getCascade("default");191 Cascade cDef = env.mc.getCascade("default"); 192 192 193 193 SymbolShape shape; … … 216 216 return null; 217 217 218 Float sizeOnDefault = c _def.get("symbol-size", null, Float.class);218 Float sizeOnDefault = cDef.get("symbol-size", null, Float.class); 219 219 if (sizeOnDefault != null && sizeOnDefault <= 0) { 220 220 sizeOnDefault = null; … … 229 229 return null; 230 230 231 Float strokeWidthOnDefault = getWidth(c _def, "symbol-stroke-width", null);231 Float strokeWidthOnDefault = getWidth(cDef, "symbol-stroke-width", null); 232 232 Float strokeWidth = getWidth(c, "symbol-stroke-width", strokeWidthOnDefault); 233 233 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
r9371 r10001 35 35 public boolean defaultSelectedHandling; 36 36 37 public StyleElement(float major _z_index, float z_index, float object_z_index, boolean isModifier, boolean defaultSelectedHandling) {38 this.majorZIndex = major _z_index;39 this.zIndex = z _index;40 this.objectZIndex = object _z_index;37 public StyleElement(float majorZindex, float zIndex, float objectZindex, boolean isModifier, boolean defaultSelectedHandling) { 38 this.majorZIndex = majorZindex; 39 this.zIndex = zIndex; 40 this.objectZIndex = objectZindex; 41 41 this.isModifier = isModifier; 42 42 this.defaultSelectedHandling = defaultSelectedHandling; 43 43 } 44 44 45 protected StyleElement(Cascade c, float default _major_z_index) {46 majorZIndex = c.get(MAJOR_Z_INDEX, default _major_z_index, Float.class);45 protected StyleElement(Cascade c, float defaultMajorZindex) { 46 majorZIndex = c.get(MAJOR_Z_INDEX, defaultMajorZindex, Float.class); 47 47 zIndex = c.get(Z_INDEX, 0f, Float.class); 48 48 objectZIndex = c.get(OBJECT_Z_INDEX, 0f, Float.class); … … 86 86 return (float) MapPaintSettings.INSTANCE.getDefaultSegmentWidth(); 87 87 if (relativeTo != null) { 88 RelativeFloat width _rel = c.get(key, null, RelativeFloat.class, true);89 if (width _rel != null)90 return relativeTo + width _rel.val;88 RelativeFloat widthRel = c.get(key, null, RelativeFloat.class, true); 89 if (widthRel != null) 90 return relativeTo + widthRel.val; 91 91 } 92 92 } -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r9686 r10001 96 96 // fill model with colors: 97 97 Map<String, String> colorKeyList = new TreeMap<>(); 98 Map<String, String> colorKeyList _mappaint = new TreeMap<>();99 Map<String, String> colorKeyList _layer = new TreeMap<>();98 Map<String, String> colorKeyListMappaint = new TreeMap<>(); 99 Map<String, String> colorKeyListLayer = new TreeMap<>(); 100 100 for (String key : colorMap.keySet()) { 101 101 if (key.startsWith("layer ")) { 102 colorKeyList _layer.put(getName(key), key);102 colorKeyListLayer.put(getName(key), key); 103 103 } else if (key.startsWith("mappaint.")) { 104 104 // use getName(key)+key, as getName() may be ambiguous 105 colorKeyList _mappaint.put(getName(key)+key, key);105 colorKeyListMappaint.put(getName(key)+key, key); 106 106 } else { 107 107 colorKeyList.put(getName(key), key); … … 109 109 } 110 110 addColorRows(colorMap, colorKeyList); 111 addColorRows(colorMap, colorKeyList _mappaint);112 addColorRows(colorMap, colorKeyList _layer);111 addColorRows(colorMap, colorKeyListMappaint); 112 addColorRows(colorMap, colorKeyListLayer); 113 113 if (this.colors != null) { 114 114 this.colors.repaint(); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r9840 r10001 78 78 if (Main.isPlatformOsx()) { 79 79 try { 80 Class<?> Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");81 Object Oquaqua = Cquaqua.getConstructor((Class[]) null).newInstance((Object[]) null);80 Class<?> cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel"); 81 Object oquaqua = cquaqua.getConstructor((Class[]) null).newInstance((Object[]) null); 82 82 // no exception? Then Go! 83 83 lafCombo.addItem( 84 new UIManager.LookAndFeelInfo(((LookAndFeel) Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")84 new UIManager.LookAndFeelInfo(((LookAndFeel) oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel") 85 85 ); 86 86 } catch (Exception ex) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java
r9936 r10001 103 103 } 104 104 105 protected static String getLocaleText(String text, String text _context, String defaultText) {105 protected static String getLocaleText(String text, String textContext, String defaultText) { 106 106 if (text == null) { 107 107 return defaultText; 108 } else if (text _context != null) {109 return trc(text _context, fixPresetString(text));108 } else if (textContext != null) { 109 return trc(textContext, fixPresetString(text)); 110 110 } else { 111 111 return tr(fixPresetString(text)); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java
r9665 r10001 52 52 } 53 53 54 public void setMember_expression(String member _expression) throws SAXException {54 public void setMember_expression(String memberExpression) throws SAXException { 55 55 try { 56 56 final SearchAction.SearchSetting searchSetting = new SearchAction.SearchSetting(); 57 searchSetting.text = member _expression;57 searchSetting.text = memberExpression; 58 58 searchSetting.caseSensitive = true; 59 59 searchSetting.regexSearch = true; -
trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
r9590 r10001 99 99 public void setFileFilter(final FileFilter cff) { 100 100 FilenameFilter filter = new FilenameFilter() { 101 public boolean accept(File Directory, String fileName) { 102 return cff.accept(new File(Directory.getAbsolutePath() + fileName)); 101 @Override 102 public boolean accept(File directory, String fileName) { 103 return cff.accept(new File(directory.getAbsolutePath() + fileName)); 103 104 } 104 105 }; -
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r9740 r10001 173 173 try (BufferedReader rd = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) { 174 174 StringBuilder sb = new StringBuilder(1024); 175 int loopstart _char = rd.read();175 int loopstartChar = rd.read(); 176 176 ps = new NMEAParserState(); 177 if (loopstart _char == -1)177 if (loopstartChar == -1) 178 178 //TODO tell user about the problem? 179 179 return; 180 sb.append((char) loopstart _char);180 sb.append((char) loopstartChar); 181 181 ps.pDate = "010100"; // TODO date problem 182 182 while (true) { -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r8855 r10001 119 119 120 120 // -- min_lon and min_lat 121 String min _lon= atts.getValue("min_lon");122 String min _lat= atts.getValue("min_lat");123 String max _lon= atts.getValue("max_lon");124 String max _lat= atts.getValue("max_lat");125 if (min _lon != null && min_lat != null && max_lon != null && max_lat!= null) {121 String minLonStr = atts.getValue("min_lon"); 122 String minLatStr = atts.getValue("min_lat"); 123 String maxLonStr = atts.getValue("max_lon"); 124 String maxLatStr = atts.getValue("max_lat"); 125 if (minLonStr != null && minLatStr != null && maxLonStr != null && maxLatStr != null) { 126 126 double minLon = 0; 127 127 try { 128 minLon = Double.parseDouble(min _lon);129 } catch (NumberFormatException e) { 130 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lon", min _lon));128 minLon = Double.parseDouble(minLonStr); 129 } catch (NumberFormatException e) { 130 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lon", minLonStr)); 131 131 } 132 132 double minLat = 0; 133 133 try { 134 minLat = Double.parseDouble(min _lat);135 } catch (NumberFormatException e) { 136 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lat", min _lat));134 minLat = Double.parseDouble(minLatStr); 135 } catch (NumberFormatException e) { 136 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lat", minLatStr)); 137 137 } 138 138 current.setMin(new LatLon(minLat, minLon)); … … 142 142 double maxLon = 0; 143 143 try { 144 maxLon = Double.parseDouble(max _lon);145 } catch (NumberFormatException e) { 146 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lon", max _lon));144 maxLon = Double.parseDouble(maxLonStr); 145 } catch (NumberFormatException e) { 146 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lon", maxLonStr)); 147 147 } 148 148 double maxLat = 0; 149 149 try { 150 maxLat = Double.parseDouble(max _lat);151 } catch (NumberFormatException e) { 152 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lat", max _lat));150 maxLat = Double.parseDouble(maxLatStr); 151 } catch (NumberFormatException e) { 152 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lat", maxLatStr)); 153 153 } 154 154 current.setMax(new LatLon(maxLon, maxLat)); -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r9528 r10001 61 61 private long uploadStartTime; 62 62 63 public String timeLeft(int progress, int list _size) {63 public String timeLeft(int progress, int listSize) { 64 64 long now = System.currentTimeMillis(); 65 65 long elapsed = now - uploadStartTime; … … 67 67 elapsed = 1; 68 68 } 69 double uploads _per_ms = (double) progress / elapsed;70 double uploads _left = list_size - progress;71 long ms _left = (long) (uploads_left / uploads_per_ms);72 long minutes _left = ms_left / MSECS_PER_MINUTE;73 long seconds _left = (ms_left / MSECS_PER_SECOND) % SECONDS_PER_MINUTE;74 StringBuilder time _left_str = new StringBuilder().append(minutes_left).append(':');75 if (seconds _left < 10) {76 time _left_str.append('0');77 } 78 return time _left_str.append(seconds_left).toString();69 double uploadsPerMs = (double) progress / elapsed; 70 double uploadsLeft = listSize - progress; 71 long msLeft = (long) (uploadsLeft / uploadsPerMs); 72 long minutesLeft = msLeft / MSECS_PER_MINUTE; 73 long secondsLeft = (msLeft / MSECS_PER_SECOND) % SECONDS_PER_MINUTE; 74 StringBuilder timeLeftStr = new StringBuilder().append(minutesLeft).append(':'); 75 if (secondsLeft < 10) { 76 timeLeftStr.append('0'); 77 } 78 return timeLeftStr.append(secondsLeft).toString(); 79 79 } 80 80 … … 94 94 for (OsmPrimitive osm : primitives) { 95 95 int progress = progressMonitor.getTicks(); 96 String time _left_str = timeLeft(progress, primitives.size());96 String timeLeftStr = timeLeft(progress, primitives.size()); 97 97 String msg = ""; 98 98 switch(OsmPrimitiveType.from(osm)) { … … 106 106 progress, 107 107 primitives.size(), 108 time _left_str,108 timeLeftStr, 109 109 osm.getName() == null ? osm.getId() : osm.getName(), 110 110 osm.getId())); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r10000 r10001 177 177 178 178 Map<String, String> headers = new HashMap<>(); 179 int k = 0, MAX_HEADERS = 20; 180 while (k < MAX_HEADERS) { 179 int k = 0; 180 int maxHeaders = 20; 181 while (k < maxHeaders) { 181 182 get = in.readLine(); 182 183 if (get == null) break; -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r9972 r10001 80 80 protected static final Collection<DeprecatedPlugin> DEPRECATED_PLUGINS; 81 81 static { 82 String IN_CORE= tr("integrated into main program");82 String inCore = tr("integrated into main program"); 83 83 84 84 DEPRECATED_PLUGINS = Arrays.asList(new DeprecatedPlugin[] { 85 new DeprecatedPlugin("mappaint", IN_CORE),86 new DeprecatedPlugin("unglueplugin", IN_CORE),87 new DeprecatedPlugin("lang-de", IN_CORE),88 new DeprecatedPlugin("lang-en_GB", IN_CORE),89 new DeprecatedPlugin("lang-fr", IN_CORE),90 new DeprecatedPlugin("lang-it", IN_CORE),91 new DeprecatedPlugin("lang-pl", IN_CORE),92 new DeprecatedPlugin("lang-ro", IN_CORE),93 new DeprecatedPlugin("lang-ru", IN_CORE),94 new DeprecatedPlugin("ewmsplugin", IN_CORE),95 new DeprecatedPlugin("ywms", IN_CORE),96 new DeprecatedPlugin("tways-0.2", IN_CORE),97 new DeprecatedPlugin("geotagged", IN_CORE),85 new DeprecatedPlugin("mappaint", inCore), 86 new DeprecatedPlugin("unglueplugin", inCore), 87 new DeprecatedPlugin("lang-de", inCore), 88 new DeprecatedPlugin("lang-en_GB", inCore), 89 new DeprecatedPlugin("lang-fr", inCore), 90 new DeprecatedPlugin("lang-it", inCore), 91 new DeprecatedPlugin("lang-pl", inCore), 92 new DeprecatedPlugin("lang-ro", inCore), 93 new DeprecatedPlugin("lang-ru", inCore), 94 new DeprecatedPlugin("ewmsplugin", inCore), 95 new DeprecatedPlugin("ywms", inCore), 96 new DeprecatedPlugin("tways-0.2", inCore), 97 new DeprecatedPlugin("geotagged", inCore), 98 98 new DeprecatedPlugin("landsat", tr("replaced by new {0} plugin", "lakewalker")), 99 new DeprecatedPlugin("namefinder", IN_CORE),100 new DeprecatedPlugin("waypoints", IN_CORE),101 new DeprecatedPlugin("slippy_map_chooser", IN_CORE),99 new DeprecatedPlugin("namefinder", inCore), 100 new DeprecatedPlugin("waypoints", inCore), 101 new DeprecatedPlugin("slippy_map_chooser", inCore), 102 102 new DeprecatedPlugin("tcx-support", tr("replaced by new {0} plugin", "dataimport")), 103 new DeprecatedPlugin("usertools", IN_CORE),104 new DeprecatedPlugin("AgPifoJ", IN_CORE),105 new DeprecatedPlugin("utilsplugin", IN_CORE),106 new DeprecatedPlugin("ghost", IN_CORE),107 new DeprecatedPlugin("validator", IN_CORE),108 new DeprecatedPlugin("multipoly", IN_CORE),109 new DeprecatedPlugin("multipoly-convert", IN_CORE),110 new DeprecatedPlugin("remotecontrol", IN_CORE),111 new DeprecatedPlugin("imagery", IN_CORE),112 new DeprecatedPlugin("slippymap", IN_CORE),113 new DeprecatedPlugin("wmsplugin", IN_CORE),114 new DeprecatedPlugin("ParallelWay", IN_CORE),103 new DeprecatedPlugin("usertools", inCore), 104 new DeprecatedPlugin("AgPifoJ", inCore), 105 new DeprecatedPlugin("utilsplugin", inCore), 106 new DeprecatedPlugin("ghost", inCore), 107 new DeprecatedPlugin("validator", inCore), 108 new DeprecatedPlugin("multipoly", inCore), 109 new DeprecatedPlugin("multipoly-convert", inCore), 110 new DeprecatedPlugin("remotecontrol", inCore), 111 new DeprecatedPlugin("imagery", inCore), 112 new DeprecatedPlugin("slippymap", inCore), 113 new DeprecatedPlugin("wmsplugin", inCore), 114 new DeprecatedPlugin("ParallelWay", inCore), 115 115 new DeprecatedPlugin("dumbutils", tr("replaced by new {0} plugin", "utilsplugin2")), 116 new DeprecatedPlugin("ImproveWayAccuracy", IN_CORE),116 new DeprecatedPlugin("ImproveWayAccuracy", inCore), 117 117 new DeprecatedPlugin("Curves", tr("replaced by new {0} plugin", "utilsplugin2")), 118 118 new DeprecatedPlugin("epsg31287", tr("replaced by new {0} plugin", "proj4j")), 119 119 new DeprecatedPlugin("licensechange", tr("no longer required")), 120 new DeprecatedPlugin("restart", IN_CORE),121 new DeprecatedPlugin("wayselector", IN_CORE),120 new DeprecatedPlugin("restart", inCore), 121 new DeprecatedPlugin("wayselector", inCore), 122 122 new DeprecatedPlugin("openstreetbugs", tr("replaced by new {0} plugin", "notes")), 123 123 new DeprecatedPlugin("nearclick", tr("no longer required")), 124 new DeprecatedPlugin("notes", IN_CORE),125 new DeprecatedPlugin("mirrored_download", IN_CORE),126 new DeprecatedPlugin("ImageryCache", IN_CORE),124 new DeprecatedPlugin("notes", inCore), 125 new DeprecatedPlugin("mirrored_download", inCore), 126 new DeprecatedPlugin("ImageryCache", inCore), 127 127 new DeprecatedPlugin("commons-imaging", tr("replaced by new {0} plugin", "apache-commons")), 128 128 new DeprecatedPlugin("missingRoads", tr("replaced by new {0} plugin", "ImproveOsm")), -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r9231 r10001 177 177 for (int c = 1;; ++c) { 178 178 int d; /* Active diagonal. */ 179 boolean big _snake = false;179 boolean bigSnake = false; 180 180 181 181 /* Extend the top-down search by an edit step in each diagonal. */ … … 204 204 } 205 205 if (x - oldx > SNAKE_LIMIT) { 206 big _snake = true;206 bigSnake = true; 207 207 } 208 208 fd[fdiagoff + d] = x; … … 238 238 } 239 239 if (oldx - x > SNAKE_LIMIT) { 240 big _snake = true;240 bigSnake = true; 241 241 } 242 242 bd[bdiagoff + d] = x; … … 255 255 of changes, the algorithm is linear in the file size. */ 256 256 257 if (c > 200 && big _snake && heuristic) {257 if (c > 200 && bigSnake && heuristic) { 258 258 int best = 0; 259 259 int bestpos = -1; … … 618 618 */ 619 619 int[] equivCount() { 620 int[] equiv _count = new int[equivMax];620 int[] equivCount = new int[equivMax]; 621 621 for (int i = 0; i < bufferedLines; ++i) { 622 ++equiv _count[equivs[i]];623 } 624 return equiv _count;622 ++equivCount[equivs[i]]; 623 } 624 return equivCount; 625 625 } 626 626 … … 853 853 void shift_boundaries(FileData f) { 854 854 final boolean[] changed = changedFlag; 855 final boolean[] other _changed = f.changedFlag;855 final boolean[] otherChanged = f.changedFlag; 856 856 int i = 0; 857 857 int j = 0; 858 int i _end = bufferedLines;858 int iEnd = bufferedLines; 859 859 int preceding = -1; 860 int other _preceding = -1;860 int otherPreceding = -1; 861 861 862 862 for (;;) { 863 int start, end, other _start;863 int start, end, otherStart; 864 864 865 865 /* Scan forwards to find beginning of another run of changes. 866 866 Also keep track of the corresponding point in the other file. */ 867 867 868 while (i < i _end && !changed[1+i]) {869 while (other _changed[1+j++]) {868 while (i < iEnd && !changed[1+i]) { 869 while (otherChanged[1+j++]) { 870 870 /* Non-corresponding lines in the other file 871 871 will count as the preceding batch of changes. */ 872 other _preceding = j;872 otherPreceding = j; 873 873 } 874 874 i++; 875 875 } 876 876 877 if (i == i _end) {877 if (i == iEnd) { 878 878 break; 879 879 } 880 880 881 881 start = i; 882 other _start = j;882 otherStart = j; 883 883 884 884 for (;;) { 885 885 /* Now find the end of this run of changes. */ 886 886 887 while (i < i _end && changed[1+i]) {887 while (i < iEnd && changed[1+i]) { 888 888 i++; 889 889 } … … 899 899 Only because the previous run was shifted here. */ 900 900 901 if (end != i _end && equivs[start] == equivs[end] && !other_changed[1+j]902 && !((preceding >= 0 && start == preceding) || (other _preceding >= 0 && other_start == other_preceding))) {901 if (end != iEnd && equivs[start] == equivs[end] && !otherChanged[1+j] 902 && !((preceding >= 0 && start == preceding) || (otherPreceding >= 0 && otherStart == otherPreceding))) { 903 903 changed[1+end++] = true; 904 904 changed[1+start++] = false; … … 914 914 915 915 preceding = i; 916 other _preceding = j;916 otherPreceding = j; 917 917 } 918 918 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r9949 r10001 753 753 extensions = new String[] {".png", ".svg"}; 754 754 } 755 final int ARCHIVE = 0, LOCAL = 1; 756 for (int place : new Integer[] {ARCHIVE, LOCAL}) { 755 final int typeArchive = 0; 756 final int typeLocal = 1; 757 for (int place : new Integer[] {typeArchive, typeLocal}) { 757 758 for (String ext : extensions) { 758 759 … … 777 778 778 779 switch (place) { 779 case ARCHIVE:780 case typeArchive: 780 781 if (archive != null) { 781 782 ir = getIfAvailableZip(fullName, archive, inArchiveDir, type); … … 786 787 } 787 788 break; 788 case LOCAL:789 case typeLocal: 789 790 // getImageUrl() does a ton of "stat()" calls and gets expensive 790 791 // and redundant when you have a whole ton of objects. So, … … 924 925 } 925 926 } else { 926 final String fn _md5 = Utils.md5Hex(fn);927 url = b + fn _md5.substring(0, 1) + '/' + fn_md5.substring(0, 2) + "/" + fn;927 final String fnMD5 = Utils.md5Hex(fn); 928 url = b + fnMD5.substring(0, 1) + '/' + fnMD5.substring(0, 2) + "/" + fn; 928 929 } 929 930 result = getIfAvailableHttp(url, type);
Note:
See TracChangeset
for help on using the changeset viewer.