Changeset 6987 in josm for trunk/src/org
- Timestamp:
- 2014-04-16T02:29:53+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r6643 r6987 45 45 } 46 46 47 protected static void addToDownload(Area a, Rectangle2D r, Collection<Rectangle2D> results, double max _area) {47 protected static void addToDownload(Area a, Rectangle2D r, Collection<Rectangle2D> results, double maxArea) { 48 48 Area tmp = new Area(r); 49 49 // intersect with sought-after area … … 53 53 } 54 54 Rectangle2D bounds = tmp.getBounds2D(); 55 if (bounds.getWidth() * bounds.getHeight() > max _area) {55 if (bounds.getWidth() * bounds.getHeight() > maxArea) { 56 56 // the rectangle gets too large; split it and make recursive call. 57 57 Rectangle2D r1; … … 68 68 bounds.getHeight() / 2); 69 69 } 70 addToDownload(a, r1, results, max _area);71 addToDownload(a, r2, results, max _area);70 addToDownload(a, r1, results, maxArea); 71 addToDownload(a, r2, results, maxArea); 72 72 } else { 73 73 results.add(bounds); … … 92 92 * the areas if applicable. 93 93 */ 94 protected static void confirmAndDownloadAreas(Area a, double max _area, boolean osmDownload, boolean gpxDownload, String title, ProgressMonitor progressMonitor) {94 protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title, ProgressMonitor progressMonitor) { 95 95 List<Rectangle2D> toDownload = new ArrayList<Rectangle2D>(); 96 addToDownload(a, a.getBounds(), toDownload, max _area);96 addToDownload(a, a.getBounds(), toDownload, maxArea); 97 97 if (toDownload.isEmpty()) { 98 98 return; -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r6977 r6987 112 112 public boolean insideToTheRight; 113 113 114 public WayInPolygon(Way _way, boolean _insideRight) {115 this.way = _way;116 this.insideToTheRight = _insideRight;114 public WayInPolygon(Way way, boolean insideRight) { 115 this.way = way; 116 this.insideToTheRight = insideRight; 117 117 } 118 118 … … 289 289 public final AssembledMultipolygon pol; 290 290 291 public PolygonLevel(AssembledMultipolygon _pol, int _level) {292 pol = _pol;293 level = _level;291 public PolygonLevel(AssembledMultipolygon pol, int level) { 292 this.pol = pol; 293 this.level = level; 294 294 } 295 295 } -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r6986 r6987 518 518 * Class contains some auxiliary functions 519 519 */ 520 private static class EN {520 private static final class EN { 521 521 private EN() { 522 522 // Hide implicit public constructor for utility class -
trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java
r6822 r6987 11 11 12 12 public class CyclicUploadDependencyException extends Exception { 13 private Stack<Relation> cycle;13 private final Stack<Relation> cycle; 14 14 15 15 public CyclicUploadDependencyException(Stack<Relation> cycle) { 16 super();17 16 this.cycle = cycle; 18 17 } -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java
r6986 r6987 92 92 * @since 5787 93 93 */ 94 public static class TagSwitcher {94 public static final class TagSwitcher { 95 95 96 96 private TagSwitcher() { -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r6986 r6987 739 739 * Also contains functions that convert preferences object to JavaScript object and back 740 740 */ 741 public static class PreferencesUtils {741 public static final class PreferencesUtils { 742 742 743 743 private PreferencesUtils() { -
trunk/src/org/openstreetmap/josm/data/osm/DataIntegrityProblemException.java
r5170 r6987 4 4 public class DataIntegrityProblemException extends RuntimeException { 5 5 6 private String htmlMessage;6 private final String htmlMessage; 7 7 8 8 public DataIntegrityProblemException(String message) { 9 super(message);9 this(message, null); 10 10 } 11 11 -
trunk/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
r6974 r6987 237 237 * convert cartesian coordinates to ellipsoidal coordinates 238 238 * 239 * @param XYZthe coordinates in meters (X, Y, Z)239 * @param xyz the coordinates in meters (X, Y, Z) 240 240 * @return The corresponding latitude and longitude in degrees 241 241 */ 242 public LatLon cart2LatLon(double[] XYZ) { 243 return cart2LatLon(XYZ, 1e-11); 244 } 245 public LatLon cart2LatLon(double[] XYZ, double epsilon) { 246 double norm = Math.sqrt(XYZ[0] * XYZ[0] + XYZ[1] * XYZ[1]); 247 double lg = 2.0 * Math.atan(XYZ[1] / (XYZ[0] + norm)); 248 double lt = Math.atan(XYZ[2] / (norm * (1.0 - (a * e2 / Math.sqrt(XYZ[0] * XYZ[0] + XYZ[1] * XYZ[1] + XYZ[2] * XYZ[2]))))); 242 public LatLon cart2LatLon(double[] xyz) { 243 return cart2LatLon(xyz, 1e-11); 244 } 245 246 public LatLon cart2LatLon(double[] xyz, double epsilon) { 247 double norm = Math.sqrt(xyz[0] * xyz[0] + xyz[1] * xyz[1]); 248 double lg = 2.0 * Math.atan(xyz[1] / (xyz[0] + norm)); 249 double lt = Math.atan(xyz[2] / (norm * (1.0 - (a * e2 / Math.sqrt(xyz[0] * xyz[0] + xyz[1] * xyz[1] + xyz[2] * xyz[2]))))); 249 250 double delta = 1.0; 250 251 while (delta > epsilon) { 251 252 double s2 = Math.sin(lt); 252 253 s2 *= s2; 253 double l = Math.atan(( XYZ[2] / norm)254 double l = Math.atan((xyz[2] / norm) 254 255 / (1.0 - (a * e2 * Math.cos(lt) / (norm * Math.sqrt(1.0 - e2 * s2))))); 255 256 delta = Math.abs(l - lt); … … 270 271 271 272 double Rn = a / Math.sqrt(1 - e2 * Math.pow(Math.sin(phi), 2)); 272 double[] XYZ= new double[3];273 XYZ[0] = Rn * Math.cos(phi) * Math.cos(lambda);274 XYZ[1] = Rn * Math.cos(phi) * Math.sin(lambda);275 XYZ[2] = Rn * (1 - e2) * Math.sin(phi);276 277 return XYZ;273 double[] xyz = new double[3]; 274 xyz[0] = Rn * Math.cos(phi) * Math.cos(lambda); 275 xyz[1] = Rn * Math.cos(phi) * Math.sin(lambda); 276 xyz[2] = Rn * (1 - e2) * Math.sin(phi); 277 278 return xyz; 278 279 } 279 280 } -
trunk/src/org/openstreetmap/josm/gui/MenuScroller.java
r6986 r6987 439 439 protected void finalize() throws Throwable { 440 440 dispose(); 441 super.finalize(); 441 442 } 442 443 … … 566 567 UP(9, 1, 9), 567 568 DOWN(1, 9, 1); 568 static final int[] xPoints= {1, 5, 9};569 static final int[] XPOINTS = {1, 5, 9}; 569 570 final int[] yPoints; 570 571 … … 578 579 Graphics g2 = g.create(size.width / 2 - 5, size.height / 2 - 5, 10, 10); 579 580 g2.setColor(Color.GRAY); 580 g2.drawPolygon( xPoints, yPoints, 3);581 g2.drawPolygon(XPOINTS, yPoints, 3); 581 582 if (c.isEnabled()) { 582 583 g2.setColor(Color.BLACK); 583 g2.fillPolygon( xPoints, yPoints, 3);584 g2.fillPolygon(XPOINTS, yPoints, 3); 584 585 } 585 586 g2.dispose(); -
trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java
r6920 r6987 43 43 public String fetchHelpTopicContent(String helpTopicUrl, boolean dotest) throws HelpContentReaderException { 44 44 if(helpTopicUrl == null) 45 throw new MissingHelpContentException( );45 throw new MissingHelpContentException(helpTopicUrl); 46 46 HttpURLConnection con = null; 47 47 BufferedReader in = null; … … 90 90 } 91 91 if(dotest && s.isEmpty()) 92 throw new MissingHelpContentException( );92 throw new MissingHelpContentException(s); 93 93 return s; 94 94 } -
trunk/src/org/openstreetmap/josm/gui/help/HelpContentReaderException.java
r3408 r6987 4 4 public class HelpContentReaderException extends Exception { 5 5 private int responseCode; 6 7 public HelpContentReaderException() {8 super();9 }10 6 11 7 public HelpContentReaderException(String message, Throwable cause) { … … 39 35 this.responseCode = responseCode; 40 36 } 41 42 37 } -
trunk/src/org/openstreetmap/josm/gui/help/MissingHelpContentException.java
r3408 r6987 3 3 4 4 public class MissingHelpContentException extends HelpContentReaderException { 5 6 public MissingHelpContentException() {7 super();8 }9 5 10 6 public MissingHelpContentException(String message, Throwable cause) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSException.java
r6070 r6987 4 4 public class MapCSSException extends RuntimeException { 5 5 6 protected String specialmessage;6 protected final String specialmessage; 7 7 protected Integer line; 8 8 protected Integer column; -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r6643 r6987 148 148 } catch(OAuthCommunicationException e){ 149 149 if (canceled) 150 throw new OsmTransferCanceledException( );150 throw new OsmTransferCanceledException(e); 151 151 throw new OsmOAuthAuthorizationException(e); 152 152 } catch(OAuthException e){ 153 153 if (canceled) 154 throw new OsmTransferCanceledException( );154 throw new OsmTransferCanceledException(e); 155 155 throw new OsmOAuthAuthorizationException(e); 156 156 } finally { … … 182 182 } catch(OAuthCommunicationException e){ 183 183 if (canceled) 184 throw new OsmTransferCanceledException( );184 throw new OsmTransferCanceledException(e); 185 185 throw new OsmOAuthAuthorizationException(e); 186 186 } catch(OAuthException e){ 187 187 if (canceled) 188 throw new OsmTransferCanceledException( );188 throw new OsmTransferCanceledException(e); 189 189 throw new OsmOAuthAuthorizationException(e); 190 190 } finally { … … 569 569 } catch(OsmOAuthAuthorizationException e) { 570 570 if (canceled) 571 throw new OsmTransferCanceledException( );571 throw new OsmTransferCanceledException(e); 572 572 throw e; 573 573 } finally { -
trunk/src/org/openstreetmap/josm/io/OsmTransferCanceledException.java
r5386 r6987 7 7 public class OsmTransferCanceledException extends OsmTransferException { 8 8 9 /** 10 * Constructs a new {@code OsmTransferCanceledException}, without root cause. 11 */ 12 public OsmTransferCanceledException() { 13 14 } 15 16 /** 17 * Constructs a new {@code OsmTransferCanceledException}, with given root cause. 18 * @param cause the cause (which is saved for later retrieval by the {@link #getCause} method). 19 * A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown. 20 */ 21 public OsmTransferCanceledException(Throwable cause) { 22 super(cause); 23 } 9 24 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r6920 r6987 457 457 } 458 458 459 String full _name = subdir + name + ext;460 String cache _name = full_name;459 String fullName = subdir + name + ext; 460 String cacheName = fullName; 461 461 /* cache separately */ 462 462 if (dirs != null && !dirs.isEmpty()) { 463 cache _name = "id:" + id + ":" + full_name;463 cacheName = "id:" + id + ":" + fullName; 464 464 if(archive != null) { 465 cache _name += ":" + archive.getName();465 cacheName += ":" + archive.getName(); 466 466 } 467 467 } 468 468 469 ImageResource ir = cache.get(cache _name);469 ImageResource ir = cache.get(cacheName); 470 470 if (ir != null) return ir; 471 471 … … 473 473 case ARCHIVE: 474 474 if (archive != null) { 475 ir = getIfAvailableZip(full _name, archive, inArchiveDir, type);475 ir = getIfAvailableZip(fullName, archive, inArchiveDir, type); 476 476 if (ir != null) { 477 cache.put(cache _name, ir);477 cache.put(cacheName, ir); 478 478 return ir; 479 479 } … … 486 486 // and don't bother to create a URL unless we're actually 487 487 // creating the image. 488 URL path = getImageUrl(full _name, dirs, additionalClassLoaders);488 URL path = getImageUrl(fullName, dirs, additionalClassLoaders); 489 489 if (path == null) { 490 490 continue; … … 492 492 ir = getIfAvailableLocalURL(path, type); 493 493 if (ir != null) { 494 cache.put(cache _name, ir);494 cache.put(cacheName, ir); 495 495 return ir; 496 496 } … … 602 602 } 603 603 604 private static ImageResource getIfAvailableZip(String full _name, File archive, String inArchiveDir, ImageType type) {604 private static ImageResource getIfAvailableZip(String fullName, File archive, String inArchiveDir, ImageType type) { 605 605 ZipFile zipFile = null; 606 try 607 { 606 try { 608 607 zipFile = new ZipFile(archive); 609 608 if (inArchiveDir == null || inArchiveDir.equals(".")) { … … 612 611 inArchiveDir += "/"; 613 612 } 614 String entry _name = inArchiveDir + full_name;615 ZipEntry entry = zipFile.getEntry(entry _name);613 String entryName = inArchiveDir + fullName; 614 ZipEntry entry = zipFile.getEntry(entryName); 616 615 if(entry != null) 617 616 { … … 624 623 switch (type) { 625 624 case SVG: 626 URI uri = getSvgUniverse().loadSVG(is, entry _name);625 URI uri = getSvgUniverse().loadSVG(is, entryName); 627 626 SVGDiagram svg = getSvgUniverse().getDiagram(uri); 628 627 return svg == null ? null : new ImageResource(svg); … … 755 754 /** Quit parsing, when a certain condition is met */ 756 755 class SAXReturnException extends SAXException { 757 private String result;756 private final String result; 758 757 759 758 public SAXReturnException(String result) {
Note:
See TracChangeset
for help on using the changeset viewer.