Changeset 16630 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-06-14T17:17:08+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r16119 r16630 157 157 Collection<Command> corrCmds = Collections.<Command>emptyList(); 158 158 if (Config.getPref().getBoolean("tag-correction.reverse-way", true)) { 159 corrCmds = (new ReverseWayTagCorrector()).execute(w, wnew);159 corrCmds = new ReverseWayTagCorrector().execute(w, wnew); 160 160 } 161 161 return new ReverseWayResult(wnew, corrCmds, new ChangeCommand(w, wnew)); -
trunk/src/org/openstreetmap/josm/actions/SaveAction.java
r16509 r16630 101 101 Layer activeLayer = getLayerManager().getActiveLayer(); 102 102 boolean en = activeLayer != null 103 && activeLayer.isSavable() && (!(activeLayer.getAssociatedFile() != null104 && activeLayer instanceof SaveToFile && !((SaveToFile) activeLayer).requiresSaveToFile()) );103 && activeLayer.isSavable() && !(activeLayer.getAssociatedFile() != null 104 && activeLayer instanceof SaveToFile && !((SaveToFile) activeLayer).requiresSaveToFile()); 105 105 GuiHelper.runInEDT(() -> setEnabled(en)); 106 106 } -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r16566 r16630 173 173 auto ? tr("Proceed without simplifying") : tr("Cancel")) 174 174 .setContent(p) 175 .configureContextsensitiveHelp( ("Action/SimplifyWay"), true);175 .configureContextsensitiveHelp("Action/SimplifyWay", true); 176 176 if (auto) { 177 177 ed.setButtonIcons("simplify", "ok"); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java
r13927 r16630 44 44 @Override 45 45 public Future<?> loadUrl(DownloadParams settings, String url, ProgressMonitor progressMonitor) { 46 if (url != null && (url.matches(PATTERN_SESSION))) {46 if (url != null && url.matches(PATTERN_SESSION)) { 47 47 try { 48 48 URL u = new URL(url); -
trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
r16436 r16630 375 375 for (OsmPrimitive parent : osm.getReferrers()) { 376 376 if (parent instanceof Relation 377 && ! (toPurgeChecked.contains(parent))377 && !toPurgeChecked.contains(parent) 378 378 && hasOnlyIncompleteMembers((Relation) parent, toPurgeChecked, relSet)) { 379 379 relSet.add((Relation) parent); … … 386 386 for (int i = 0; i < relLst.size(); ++i) { // foreach loop not applicable since list gets extended while looping over it 387 387 for (OsmPrimitive parent : relLst.get(i).getReferrers()) { 388 if (! (toPurgeChecked.contains(parent))388 if (!toPurgeChecked.contains(parent) 389 389 && hasOnlyIncompleteMembers((Relation) parent, toPurgeChecked, relLst)) { 390 390 relLst.add((Relation) parent); -
trunk/src/org/openstreetmap/josm/data/osm/Storage.java
r16621 r16630 174 174 public Storage(Hash<? super T, ? super T> ha, int capacity, boolean safeIterator) { 175 175 this.hash = ha; 176 int cap = 1 << (int) (Math.ceil(Math.log(capacity/LOAD_FACTOR) / Math.log(2)));176 int cap = 1 << (int) Math.ceil(Math.log(capacity/LOAD_FACTOR) / Math.log(2)); 177 177 @SuppressWarnings("unchecked") 178 178 T[] newData = (T[]) new Object[cap]; -
trunk/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
r13626 r16630 304 304 final double n3n4 = n3 - n4; 305 305 final double n4n5 = n4 - n5; 306 final double ap = a * (1.0 - n + (5.0 / 4.0) * (n2n3) + (81.0 / 64.0) * (n4n5));307 final double bp = (3.0 / 2.0) * a * (n1n2 + (7.0 / 8.0) * (n3n4)+ (55.0 / 64.0) * n5);308 final double cp = (15.0 / 16.0) * a * (n2n3 + (3.0 / 4.0) * (n4n5));306 final double ap = a * (1.0 - n + (5.0 / 4.0) * n2n3 + (81.0 / 64.0) * n4n5); 307 final double bp = (3.0 / 2.0) * a * (n1n2 + (7.0 / 8.0) * n3n4 + (55.0 / 64.0) * n5); 308 final double cp = (15.0 / 16.0) * a * (n2n3 + (3.0 / 4.0) * n4n5); 309 309 final double dp = (35.0 / 48.0) * a * (n3n4 + (11.0 / 16.0) * n5); 310 final double ep = (315.0 / 512.0) * a * (n4n5);310 final double ep = (315.0 / 512.0) * a * n4n5; 311 311 return ap * phi - bp * sin2Phi + cp * sin4Phi - dp * sin6Phi + ep * sin8Phi; 312 312 } -
trunk/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java
r13627 r16630 59 59 public LatLon fromWGS84(LatLon ll) { 60 60 double[] xyz = Ellipsoid.WGS84.latLon2Cart(ll); 61 double x = (1-s)*(-dx + xyz[0] + ((-dz+xyz[2])* (-ry) - (-dy+xyz[1])*(-rz)));62 double y = (1-s)*(-dy + xyz[1] + ((-dx+xyz[0])* (-rz) - (-dz+xyz[2])*(-rx)));63 double z = (1-s)*(-dz + xyz[2] + ((-dy+xyz[1])* (-rx) - (-dx+xyz[0])*(-ry)));61 double x = (1-s)*(-dx + xyz[0] + ((-dz+xyz[2])* -ry - (-dy+xyz[1])* -rz)); 62 double y = (1-s)*(-dy + xyz[1] + ((-dx+xyz[0])* -rz - (-dz+xyz[2])* -rx)); 63 double z = (1-s)*(-dz + xyz[2] + ((-dy+xyz[1])* -rx - (-dx+xyz[0])* -ry)); 64 64 return this.ellps.cart2LatLon(x, y, z); 65 65 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/AbstractProj.java
r16627 r16630 126 126 (en2 + sphi * 127 127 (en3 + sphi * 128 (en4))));128 en4))); 129 129 } 130 130 -
trunk/src/org/openstreetmap/josm/data/projection/proj/CassiniSoldner.java
r16627 r16630 76 76 double cosphi = Math.cos(phi); 77 77 78 double n = 1.0 / (Math.sqrt(1.0 - e2 * sinphi * sinphi));78 double n = 1.0 / Math.sqrt(1.0 - e2 * sinphi * sinphi); 79 79 double tn = Math.tan(phi); 80 80 double t = tn * tn; -
trunk/src/org/openstreetmap/josm/data/projection/proj/Mercator.java
r12013 r16630 84 84 final double lat0 = Utils.toRadians(params.lat0); 85 85 final double sinPhi = Math.sin(lat0); 86 scaleFactor *= (Math.cos(lat0) / (Math.sqrt(1 - e2 * sinPhi * sinPhi)));86 scaleFactor *= Math.cos(lat0) / Math.sqrt(1 - e2 * sinPhi * sinPhi); 87 87 } 88 88 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/ConnectivityRelations.java
r16628 r16630 308 308 private static boolean checkMemberTagsForImpliedConnectivity(Relation relation, Map<String, Integer> roleLanes) { 309 309 // The members have different lane counts 310 if (roleLanes.containsKey(TO) && roleLanes.containsKey(FROM) && (!roleLanes.get(TO).equals(roleLanes.get(FROM)))) {310 if (roleLanes.containsKey(TO) && roleLanes.containsKey(FROM) && !roleLanes.get(TO).equals(roleLanes.get(FROM))) { 311 311 return false; 312 312 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r16553 r16630 233 233 public boolean isPrimitiveUsable(OsmPrimitive p) { 234 234 return super.isPrimitiveUsable(p) && p.hasKey("boundary") && !p.hasTag("boundary", "protected_area") 235 && (!(p instanceof Relation) || (((Relation) p).isMultipolygon()));235 && (!(p instanceof Relation) || p.isMultipolygon()); 236 236 } 237 237 -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r16445 r16630 630 630 for (RelationMember rm : r.getMembers()) { 631 631 if (rm.isWay()) { 632 if (rm.hasRole() && ! (rm.hasRole("inner", "outer")))632 if (rm.hasRole() && !rm.hasRole("inner", "outer")) 633 633 hasUnexpectedWayRole = true; 634 if (! (rm.hasRole("inner", "outer")) || !rm.hasRole()) {634 if (!rm.hasRole("inner", "outer") || !rm.hasRole()) { 635 635 tmpErrors.add(TestError.builder(this, Severity.ERROR, WRONG_MEMBER_ROLE) 636 636 .message(tr("Role for multipolygon way member should be inner or outer")) -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r16445 r16630 737 737 if (!checkValues || value == null) 738 738 return; 739 if ( (containsUnwantedNonPrintingControlCharacter(value)) && !withErrors.contains(p, "ICV")) {739 if (containsUnwantedNonPrintingControlCharacter(value) && !withErrors.contains(p, "ICV")) { 740 740 errors.add(TestError.builder(this, Severity.WARNING, LOW_CHAR_VALUE) 741 741 .message(tr("Tag value contains non-printing (usually invisible) character"), s, key) … … 761 761 withErrors.put(p, "LV"); 762 762 } 763 if ( (value.trim().isEmpty()) && !withErrors.contains(p, "EV")) {763 if (value.trim().isEmpty() && !withErrors.contains(p, "EV")) { 764 764 errors.add(TestError.builder(this, Severity.WARNING, EMPTY_VALUES) 765 765 .message(tr("Tags with empty values"), s, key) … … 795 795 if (!checkKeys || key == null) 796 796 return; 797 if ( (containsUnwantedNonPrintingControlCharacter(key)) && !withErrors.contains(p, "ICK")) {797 if (containsUnwantedNonPrintingControlCharacter(key) && !withErrors.contains(p, "ICK")) { 798 798 errors.add(TestError.builder(this, Severity.WARNING, LOW_CHAR_KEY) 799 799 .message(tr("Tag key contains non-printing character"), s, key) -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r16553 r16630 1042 1042 } 1043 1043 } else { 1044 if (distSq-minDistSq < (4)*(4)) {1044 if (distSq-minDistSq < 16) { 1045 1045 nearestList.addAll(nlist); 1046 1046 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r16553 r16630 856 856 */ 857 857 public boolean isDialogInDefaultView() { 858 return isShowing && isDocked && (!isCollapsed);858 return isShowing && isDocked && !isCollapsed; 859 859 } 860 860 -
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/MergeGpxLayerDialog.java
r14341 r16630 133 133 134 134 if ((row == 0 || newRow == 0) 135 && (!ConditionalOptionPaneUtil.showConfirmationDialog(135 && !ConditionalOptionPaneUtil.showConfirmationDialog( 136 136 "gpx_target_change", 137 137 getParent(), … … 142 142 JOptionPane.OK_CANCEL_OPTION, 143 143 JOptionPane.INFORMATION_MESSAGE, 144 JOptionPane.OK_OPTION)) ){144 JOptionPane.OK_OPTION)) { 145 145 return; 146 146 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeModel.java
r16438 r16630 62 62 int count = 0; 63 63 for (RelationMember member : parent.getMembers()) { 64 if (! (member.isRelation())) {64 if (!member.isRelation()) { 65 65 continue; 66 66 } … … 87 87 int idx = 0; 88 88 for (RelationMember member : parent.getMembers()) { 89 if (! (member.isRelation())) {89 if (!member.isRelation()) { 90 90 continue; 91 91 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java
r14030 r16630 199 199 if (onewayReverseMap.ways.containsKey(way)) { 200 200 for (Node n : onewayReverseMap.ways.get(way)) { 201 if ( (map.nodes.containsKey(n))201 if (map.nodes.containsKey(n) 202 202 || (onewayMap.nodes.containsKey(n) && onewayMap.nodes.get(n).size() > 1)) 203 203 return n; -
trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java
r14802 r16630 292 292 @Override 293 293 protected Collection<Layer> realRemoveSingleLayer(Layer layer) { 294 if ( (layer instanceof OsmDataLayer) && (((OsmDataLayer) layer).isUploadInProgress())) {294 if (layer instanceof OsmDataLayer && ((OsmDataLayer) layer).isUploadInProgress()) { 295 295 GuiHelper.runInEDT(() -> JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 296 296 tr("Trying to delete the layer with background upload. Please wait until the upload is finished."))); -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java
r13354 r16630 21 21 * An empty style cache entry 22 22 */ 23 public static final StyleCache EMPTY_STYLECACHE = (new StyleCache()).intern();23 public static final StyleCache EMPTY_STYLECACHE = new StyleCache().intern(); 24 24 25 25 private static final int PLAIN = 0; -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
r13919 r16630 155 155 return "RepeatImageStyle{" + super.toString() + "pattern=[" + pattern + 156 156 "], offset=" + offset + ", spacing=" + spacing + 157 ", phase=" + (-phase)+ ", align=" + align + '}';157 ", phase=" + -phase + ", align=" + align + '}'; 158 158 } 159 159 } -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r16321 r16630 146 146 if (o2.isChanged() && !o1.isChanged()) 147 147 return 1; 148 if (! (o1.isDefault()) && o2.isDefault())148 if (!o1.isDefault() && o2.isDefault()) 149 149 return -1; 150 if (! (o2.isDefault()) && o1.isDefault())150 if (!o2.isDefault() && o1.isDefault()) 151 151 return 1; 152 152 return o1.compareTo(o2); … … 280 280 JFileChooser.FILES_ONLY, "customsettings.lastDirectory"); 281 281 if (fc != null) { 282 File[] sel = fc.isMultiSelectionEnabled() ? fc.getSelectedFiles() : (new File[]{fc.getSelectedFile()});282 File[] sel = fc.isMultiSelectionEnabled() ? fc.getSelectedFiles() : new File[]{fc.getSelectedFile()}; 283 283 if (sel.length == 1 && !sel[0].getName().contains(".")) 284 284 sel[0] = new File(sel[0].getAbsolutePath()+".xml"); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
r16398 r16630 488 488 // iterate over the buttons, add change listener to any change event 489 489 for (Enumeration<AbstractButton> button = colorGroup.getElements(); button.hasMoreElements();) { 490 (button.nextElement()).addChangeListener(e -> {490 button.nextElement().addChangeListener(e -> { 491 491 colorTypeVelocityTune.setEnabled(colorTypeVelocity.isSelected()); 492 492 colorTypeHeatMapTune.setEnabled(colorTypeHeatMap.isSelected()); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r16276 r16630 135 135 try { 136 136 // TODO there must be a better way to parse a number like "+3" than this. 137 final int buttonvalue = (NumberFormat.getIntegerInstance().parse(ai.replace("+", ""))).intValue();137 final int buttonvalue = NumberFormat.getIntegerInstance().parse(ai.replace("+", "")).intValue(); 138 138 if (auto_increment_selected == buttonvalue) aibutton.setSelected(true); 139 139 aibutton.addActionListener(e -> auto_increment_selected = buttonvalue); -
trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java
r16628 r16630 344 344 private static Rectangle boundsWithYandHeight(Rectangle bounds, double y, double height) { 345 345 Rectangle r = new Rectangle(); 346 r.setBounds((int) (bounds.getX()), (int) y, (int) (bounds.getWidth()), (int) height);346 r.setBounds((int) bounds.getX(), (int) y, (int) bounds.getWidth(), (int) height); 347 347 return r; 348 348 } … … 350 350 private static Rectangle boundsWithXandWidth(Rectangle bounds, double x, double width) { 351 351 Rectangle r = new Rectangle(); 352 r.setBounds((int) x, (int) (bounds.getY()), (int) width, (int) (bounds.getHeight()));352 r.setBounds((int) x, (int) bounds.getY(), (int) width, (int) bounds.getHeight()); 353 353 return r; 354 354 } -
trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
r16553 r16630 131 131 this.data = updateData(); 132 132 saveToDisk(); 133 Config.getPref().putInt("cache." + ident, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));133 Config.getPref().putInt("cache." + ident, (int) TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())); 134 134 return data; 135 135 } -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r16427 r16630 188 188 String host = null; 189 189 try { 190 host = (new URL(serverUrl)).getHost();190 host = new URL(serverUrl).getHost(); 191 191 } catch (MalformedURLException e) { 192 192 Logging.warn(e); -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r14231 r16630 205 205 throwException(tr("Missing mandatory attribute ''{0}''.", "version")); 206 206 } 207 if (! ("0.6".equals(v))) {207 if (!"0.6".equals(v)) { 208 208 throwException(tr("Unsupported version: {0}", v)); 209 209 } -
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r16553 r16630 485 485 if ("GET".equalsIgnoreCase(mode) && getMapUrl != null && !"".equals(getMapUrl)) { 486 486 try { 487 String query = (new URL(getMapUrl)).getQuery();487 String query = new URL(getMapUrl).getQuery(); 488 488 if (query == null) { 489 489 this.getMapUrl = getMapUrl + "?"; -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r16407 r16630 649 649 public static <T> T getNestedException(Exception e, Class<T> nestedClass) { 650 650 Throwable t = e; 651 while (t != null && ! (nestedClass.isInstance(t))) {651 while (t != null && !nestedClass.isInstance(t)) { 652 652 t = t.getCause(); 653 653 } -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r16472 r16630 38 38 } 39 39 String text = k.substring(1, k.length()-1); 40 return (new TextAnalyzer(text)).parseString("\r\t\n");40 return new TextAnalyzer(text).parseString("\r\t\n"); 41 41 } 42 42
Note:
See TracChangeset
for help on using the changeset viewer.