Changeset 8540 in josm
- Timestamp:
- 2015-06-27T21:43:35+02:00 (10 years ago)
- Location:
- trunk
- Files:
-
- 105 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r8533 r8540 221 221 * Returns a {@link Pair} of a multipolygon creating/modifying {@link Command} as well as the multipolygon {@link Relation}. 222 222 */ 223 public static Pair<SequenceCommand, Relation> createMultipolygonCommand(Collection<Way> selectedWays, Relation selectedMultipolygonRelation) { 223 public static Pair<SequenceCommand, Relation> createMultipolygonCommand(Collection<Way> selectedWays, 224 Relation selectedMultipolygonRelation) { 224 225 225 226 final Pair<Relation, Relation> rr = selectedMultipolygonRelation == null -
trunk/src/org/openstreetmap/josm/actions/DownloadAction.java
r8510 r8540 33 33 public DownloadAction() { 34 34 super(tr("Download from OSM..."), "download", tr("Download map data from the OSM server."), 35 // CHECKSTYLE.OFF: LineLength 35 36 Shortcut.registerShortcut("file:download", tr("File: {0}", tr("Download from OSM...")), KeyEvent.VK_DOWN, Shortcut.CTRL_SHIFT), true); 37 // CHECKSTYLE.ON: LineLength 36 38 putValue("help", ht("/Action/Download")); 37 39 } -
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r8404 r8540 184 184 HelpAwareOptionPane.showMessageDialogInEDT( 185 185 Main.parent, 186 tr("<html>Could not load session file ''{0}''.<br>Error is:<br>{1}</html>", uri != null ? uri : file.getName(), e.getMessage()), 186 tr("<html>Could not load session file ''{0}''.<br>Error is:<br>{1}</html>", 187 uri != null ? uri : file.getName(), e.getMessage()), 187 188 dialogTitle, 188 189 JOptionPane.ERROR_MESSAGE, -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r8510 r8540 205 205 cmds.add(new DeleteCommand(delNodes)); 206 206 w.getDataSet().clearSelection(delNodes); 207 return new SequenceCommand(trn("Simplify Way (remove {0} node)", "Simplify Way (remove {0} nodes)", delNodes.size(), delNodes.size()), cmds); 207 return new SequenceCommand( 208 trn("Simplify Way (remove {0} node)", "Simplify Way (remove {0} nodes)", delNodes.size(), delNodes.size()), cmds); 208 209 } 209 210 -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r8510 r8540 58 58 59 59 /** 60 * @param command The command to be performed to split the way (which is saved for later retrieval by the {@link #getCommand} method)61 * @param newSelection The new list of selected primitives ids (which is saved for later retrieval by the {@link #getNewSelection} method)62 * @param originalWay The original way being split (which is saved for later retrieval by the {@link #getOriginalWay} method)63 * @param newWays The resulting new ways (which is saved for later retrieval by the {@link #getOriginalWay} method)60 * @param command The command to be performed to split the way (which is saved for later retrieval with {@link #getCommand}) 61 * @param newSelection The new list of selected primitives ids (which is saved for later retrieval with {@link #getNewSelection}) 62 * @param originalWay The original way being split (which is saved for later retrieval with {@link #getOriginalWay}) 63 * @param newWays The resulting new ways (which is saved for later retrieval with {@link #getOriginalWay}) 64 64 */ 65 65 public SplitWayResult(Command command, List<? extends PrimitiveId> newSelection, Way originalWay, List<Way> newWays) { … … 342 342 * @return the result from the split operation 343 343 */ 344 public static SplitWayResult splitWay(OsmDataLayer layer, Way way, List<List<Node>> wayChunks, Collection<? extends OsmPrimitive> selection) { 344 public static SplitWayResult splitWay(OsmDataLayer layer, Way way, List<List<Node>> wayChunks, 345 Collection<? extends OsmPrimitive> selection) { 345 346 // build a list of commands, and also a new selection list 346 347 Collection<Command> commandList = new ArrayList<>(wayChunks.size()); -
trunk/src/org/openstreetmap/josm/actions/ToggleAction.java
r8509 r8540 79 79 return (Boolean) selected; 80 80 } else { 81 Main.warn(getClass().getName()+" does not define a boolean for SELECTED_KEY but "+selected+". You should report it to JOSM developers."); 81 Main.warn(getClass().getName() + " does not define a boolean for SELECTED_KEY but " + selected + 82 ". You should report it to JOSM developers."); 82 83 return false; 83 84 } -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r8513 r8540 49 49 "uploadselection", 50 50 tr("Upload all changes in the current selection to the OSM server."), 51 // CHECKSTYLE.OFF: LineLength 51 52 Shortcut.registerShortcut("file:uploadSelection", tr("File: {0}", tr("Upload selection")), KeyEvent.VK_U, Shortcut.ALT_CTRL_SHIFT), 53 // CHECKSTYLE.ON: LineLength 52 54 true); 53 55 putValue("help", ht("/Action/UploadSelection")); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r8510 r8540 338 338 if (dataSet.allPrimitives().isEmpty()) { 339 339 rememberErrorMessage(tr("No data found in this area.")); 340 // need to synthesize a download bounds lest the visual indication of downloaded 341 // area doesn't work342 dataSet.dataSources.add(new DataSource(currentBounds != null ? currentBounds :new Bounds(new LatLon(0, 0)), "OpenStreetMap server"));340 // need to synthesize a download bounds lest the visual indication of downloaded area doesn't work 341 dataSet.dataSources.add(new DataSource(currentBounds != null ? currentBounds : 342 new Bounds(new LatLon(0, 0)), "OpenStreetMap server")); 343 343 } 344 344 -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r8510 r8540 296 296 @Override 297 297 public String getModeHelpText() { 298 // CHECKSTYLE.OFF: LineLength 298 299 return tr("Click to delete. Shift: delete way segment. Alt: do not delete unused nodes when deleting a way. Ctrl: delete referring objects."); 300 // CHECKSTYLE.ON: LineLength 299 301 } 300 302 -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r8510 r8540 915 915 916 916 // find out the movement distance, in metres 917 double distance = Main.getProjection().eastNorth2latlon(initialN1en).greatCircleDistance(Main.getProjection().eastNorth2latlon(n1movedEn)); 917 double distance = Main.getProjection().eastNorth2latlon(initialN1en).greatCircleDistance( 918 Main.getProjection().eastNorth2latlon(n1movedEn)); 918 919 Main.map.statusLine.setDist(distance); 919 920 updateStatusLine(); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r8513 r8540 192 192 switch (mode) { 193 193 case normal: 194 // CHECKSTYLE.OFF: LineLength 194 195 return tr("Select ways as in Select mode. Drag selected ways or a single way to create a parallel copy (Alt toggles tag preservation)"); 196 // CHECKSTYLE.ON: LineLength 195 197 case dragging: 196 198 return tr("Hold Ctrl to toggle snapping"); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r8512 r8540 827 827 ed.setContent( 828 828 /* for correct i18n of plural forms - see #9110 */ 829 trn( 830 "You moved more than {0} element. " + "Moving a large number of elements is often an error.\n" + "Really move them?", 831 "You moved more than {0} elements. " + "Moving a large number of elements is often an error.\n" + "Really move them?", 832 max, max)); 829 trn("You moved more than {0} element. " + "Moving a large number of elements is often an error.\n" + "Really move them?", 830 "You moved more than {0} elements. " + "Moving a large number of elements is often an error.\n" + "Really move them?", 831 max, max)); 833 832 ed.setCancelButton(2); 834 833 ed.toggleEnable("movedManyElements"); -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r8510 r8540 403 403 .addKeyword("child <i>expr</i>", "child ", tr("all children of objects matching the expression"), "child building") 404 404 .addKeyword("parent <i>expr</i>", "parent ", tr("all parents of objects matching the expression"), "parent bus_stop") 405 .addKeyword("nth:<i>7</i>", "nth: ", tr("n-th member of relation and/or n-th node of way"), "nth:5 (child type:relation)", "nth:-1") 406 .addKeyword("nth%:<i>7</i>", "nth%: ", tr("every n-th member of relation and/or every n-th node of way"), "nth%:100 (child waterway)") 405 .addKeyword("nth:<i>7</i>", "nth: ", 406 tr("n-th member of relation and/or n-th node of way"), "nth:5 (child type:relation)", "nth:-1") 407 .addKeyword("nth%:<i>7</i>", "nth%: ", 408 tr("every n-th member of relation and/or every n-th node of way"), "nth%:100 (child waterway)") 407 409 , GBC.eol()); 408 410 right.add(new SearchKeywordRow(hcbSearchString) -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r8510 r8540 477 477 } 478 478 479 public static boolean checkAndConfirmOutlyingDelete(Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) { 479 public static boolean checkAndConfirmOutlyingDelete(Collection<? extends OsmPrimitive> primitives, 480 Collection<? extends OsmPrimitive> ignore) { 480 481 return Command.checkAndConfirmOutlyingOperation("delete", 481 482 tr("Delete confirmation"), -
trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java
r8510 r8540 159 159 boolean lowerOnly = Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false); 160 160 boolean customAreaOnly = Main.pref.getBoolean("system_of_measurement.use_only_custom_area_unit", false); 161 if ((!lowerOnly && areaCustomValue > 0 && a > areaCustomValue / (aValue*aValue) && a < (bValue*bValue) / (aValue*aValue)) || customAreaOnly) 161 if ((!lowerOnly && areaCustomValue > 0 && a > areaCustomValue / (aValue*aValue) 162 && a < (bValue*bValue) / (aValue*aValue)) || customAreaOnly) 162 163 return formatText(area / areaCustomValue, areaCustomName, format); 163 164 else if (!lowerOnly && a >= (bValue*bValue) / (aValue*aValue)) -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r8530 r8540 335 335 // for further requests - use HEAD 336 336 String serverKey = getServerKey(); 337 log.log(Level.INFO, "JCS - Host: {0} found not to return 304 codes for If-Modifed-Since or If-None-Match headers", serverKey); 337 log.log(Level.INFO, "JCS - Host: {0} found not to return 304 codes for If-Modifed-Since or If-None-Match headers", 338 serverKey); 338 339 useHead.put(serverKey, Boolean.TRUE); 339 340 } -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r8526 r8540 31 31 * where valid values are in the [-180,180] and positive values specify positions east of the prime meridian. 32 32 * <br> 33 * <img alt="lat/lon" src="https://upload.wikimedia.org/wikipedia/commons/ thumb/6/62/Latitude_and_Longitude_of_the_Earth.svg/500px-Latitude_and_Longitude_of_the_Earth.svg.png">33 * <img alt="lat/lon" src="https://upload.wikimedia.org/wikipedia/commons/6/62/Latitude_and_Longitude_of_the_Earth.svg"> 34 34 * <br> 35 35 * This class is immutable. -
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r8530 r8540 133 133 // E.g. [1] lists lat as first coordinate axis and lot as second, so it is switched for EPSG:4326. 134 134 // For most other EPSG code there seems to be no difference. 135 // CHECKSTYLE.OFF: LineLength 135 136 // [1] https://www.epsg-registry.org/report.htm?type=selection&entity=urn:ogc:def:crs:EPSG::4326&reportDetail=short&style=urn:uuid:report-style:default-with-code&style_name=OGP%20Default%20With%20Code&title=EPSG:4326 137 // CHECKSTYLE.ON: LineLength 136 138 boolean switchLatLon = false; 137 139 if (baseUrl.toLowerCase().contains("crs=epsg:4326")) { -
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r8510 r8540 528 528 for (int i = 0; i < keys.length; i += 2) { 529 529 if (keys[i].equals(key)) { 530 keys[i+1] = value; // This modifies the keys array but it doesn't make it invalidate for any time so its ok (see note no top) 530 // This modifies the keys array but it doesn't make it invalidate for any time so its ok (see note no top) 531 keys[i+1] = value; 531 532 keysChangedImpl(originalKeys); 532 533 return; -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r8512 r8540 178 178 OsmPrimitive source = sourceDataSet.getPrimitiveById(target.getPrimitiveId()); 179 179 if (source == null) 180 throw new RuntimeException(tr("Object of type {0} with id {1} was marked to be deleted, but it''s missing in the source dataset", 180 throw new RuntimeException( 181 tr("Object of type {0} with id {1} was marked to be deleted, but it''s missing in the source dataset", 181 182 target.getType(), target.getUniqueId())); 182 183 -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r8512 r8540 374 374 final boolean containsN = visited.contains(n); 375 375 visited.add(n); 376 if (!containsN && (predicate == null || predicate.evaluate(n)) && n.isConnectedTo(otherNodes, hops - 1, predicate, visited)) { 376 if (!containsN && (predicate == null || predicate.evaluate(n)) 377 && n.isConnectedTo(otherNodes, hops - 1, predicate, visited)) { 377 378 return true; 378 379 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r8510 r8540 75 75 * @since 5440 76 76 */ 77 public HistoryOsmPrimitive(long id, long version, boolean visible, User user, long changesetId, Date timestamp, boolean checkHistoricParams) { 77 public HistoryOsmPrimitive(long id, long version, boolean visible, User user, long changesetId, Date timestamp, 78 boolean checkHistoricParams) { 78 79 ensurePositiveLong(id, "id"); 79 80 ensurePositiveLong(version, "version"); -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryRelation.java
r8510 r8540 70 70 * @throws IllegalArgumentException if preconditions are violated 71 71 */ 72 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Date timestamp, List<RelationMemberData> members) { 72 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Date timestamp, 73 List<RelationMemberData> members) { 73 74 this(id, version, visible, user, changesetId, timestamp); 74 75 if (members != null) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
r8513 r8540 127 127 try { 128 128 // print highlighted virtual nodes. Since only the color changes, simply 129 // drawing them over the existing ones works fine (at least in their current 130 // simple style) 129 // drawing them over the existing ones works fine (at least in their current simple style) 131 130 path = new GeneralPath(); 132 131 for (WaySegment wseg: data.getHighlightedVirtualNodes()) { … … 141 140 // if the way has changed while being rendered (fix #7979) 142 141 // TODO: proper solution ? 143 // Idea from bastiK: avoid the WaySegment class and add another data class with { Way way; Node firstNode, secondNode; int firstIdx; }. 144 // On read, it would first check, if the way still has firstIdx+2 nodes, then check if the corresponding way nodes are still the same 145 // and report changes in a more controlled manner. 142 // Idea from bastiK: 143 // avoid the WaySegment class and add another data class with { Way way; Node firstNode, secondNode; int firstIdx; }. 144 // On read, it would first check, if the way still has firstIdx+2 nodes, then check if the corresponding way nodes are still 145 // the same and report changes in a more controlled manner. 146 146 if (Main.isTraceEnabled()) { 147 147 Main.trace(e.getMessage()); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r8510 r8540 250 250 if (!isRegistered(defaultRenderer)) 251 251 throw new IllegalStateException( 252 MessageFormat.format("Class ''{0}'' not registered as renderer. Can''t activate default renderer.", defaultRenderer.getName()) 252 MessageFormat.format("Class ''{0}'' not registered as renderer. Can''t activate default renderer.", 253 defaultRenderer.getName()) 253 254 ); 254 255 activate(defaultRenderer); -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java
r7937 r8540 13 13 */ 14 14 public class NTV2GridShiftFileWrapper { 15 16 // CHECKSTYLE.OFF: LineLength 15 17 16 18 /** … … 29 31 */ 30 32 public static final NTV2GridShiftFileWrapper ntf_rgf93 = new NTV2GridShiftFileWrapper("resource://data/projection/ntf_r93_b.gsb"); 33 34 // CHECKSTYLE.ON: LineLength 31 35 32 36 private NTV2GridShiftFile instance = null; -
trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java
r8509 r8540 20 20 import org.openstreetmap.josm.data.projection.ProjectionConfigurationException; 21 21 22 // CHECKSTYLE.OFF: LineLength 23 22 24 /** 23 25 * Projection for the SwissGrid CH1903 / L03, see <a href="https://en.wikipedia.org/wiki/Swiss_coordinate_system">Wikipedia article</a>.<br> … … 32 34 */ 33 35 public class SwissObliqueMercator implements Proj { 36 37 // CHECKSTYLE.ON: LineLength 34 38 35 39 private Ellipsoid ellps; -
trunk/src/org/openstreetmap/josm/data/validation/tests/ConditionalKeys.java
r8509 r8540 27 27 28 28 private final OpeningHourTest openingHourTest = new OpeningHourTest(); 29 private static final Set<String> RESTRICTION_TYPES = new HashSet<>(Arrays.asList("oneway", "toll", "noexit", "maxspeed", "minspeed", "maxstay", 30 "maxweight", "maxaxleload", "maxheight", "maxwidth", "maxlength", "overtaking", "maxgcweight", "maxgcweightrating", "fee")); 29 private static final Set<String> RESTRICTION_TYPES = new HashSet<>(Arrays.asList("oneway", "toll", "noexit", "maxspeed", "minspeed", 30 "maxstay", "maxweight", "maxaxleload", "maxheight", "maxwidth", "maxlength", "overtaking", "maxgcweight", "maxgcweightrating", 31 "fee")); 31 32 private static final Set<String> RESTRICTION_VALUES = new HashSet<>(Arrays.asList("yes", "official", "designated", "destination", 32 33 "delivery", "permissive", "private", "agricultural", "forestry", "no")); -
trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java
r8509 r8540 93 93 } 94 94 if (n.hasKey("source:maxspeed")) { 95 // Check maxspeed but not context against highway for nodes as maxspeed is not set on highways here but on signs, speed cameras, etc. 95 // Check maxspeed but not context against highway for nodes 96 // as maxspeed is not set on highways here but on signs, speed cameras, etc. 96 97 testSourceMaxspeed(n, false); 97 98 } … … 209 210 } 210 211 if ((leftByPedestrians || leftByCyclists) && leftByCars) { 211 errors.add(new TestError(this, Severity.OTHER, tr("Missing pedestrian crossing information"), MISSING_PEDESTRIAN_CROSSING, n)); 212 errors.add(new TestError(this, Severity.OTHER, tr("Missing pedestrian crossing information"), 213 MISSING_PEDESTRIAN_CROSSING, n)); 212 214 return; 213 215 } … … 244 246 String country = value.substring(0, index); 245 247 if (!ISO_COUNTRIES.contains(country)) { 246 errors.add(new TestError(this, Severity.WARNING, tr("Unknown country code: {0}", country), SOURCE_MAXSPEED_UNKNOWN_COUNTRY_CODE, p)); 248 errors.add(new TestError(this, Severity.WARNING, 249 tr("Unknown country code: {0}", country), SOURCE_MAXSPEED_UNKNOWN_COUNTRY_CODE, p)); 247 250 } 248 251 // Check context -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r8510 r8540 431 431 final StringBuffer sb = new StringBuffer(); 432 432 while (m.find()) { 433 final String argument = determineArgument((Selector.GeneralSelector) matchingSelector, Integer.parseInt(m.group(1)), m.group(2), p); 433 final String argument = determineArgument((Selector.GeneralSelector) matchingSelector, 434 Integer.parseInt(m.group(1)), m.group(2), p); 434 435 try { 435 436 // Perform replacement with null-safe + regex-safe handling -
trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
r8510 r8540 192 192 * @return a list of {@link TestError} or an empty list 193 193 */ 194 public List<OpeningHoursTestError> checkOpeningHourSyntax(final String key, final String value, CheckMode mode, boolean ignoreOtherSeverity) { 194 public List<OpeningHoursTestError> checkOpeningHourSyntax(final String key, final String value, CheckMode mode, 195 boolean ignoreOtherSeverity) { 195 196 if (ENGINE == null || value == null || value.trim().isEmpty()) { 196 197 return Collections.emptyList(); -
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r8510 r8540 71 71 72 72 /** 73 * Determines whether the key has been marked to be part of a bulk operation (in order to provide a "Do not show again (this operation)" option). 73 * Determines whether the key has been marked to be part of a bulk operation 74 * (in order to provide a "Do not show again (this operation)" option). 74 75 * @param prefKey the preference key 75 76 */ -
trunk/src/org/openstreetmap/josm/gui/FileDrop.java
r8512 r8540 34 34 import org.openstreetmap.josm.Main; 35 35 import org.openstreetmap.josm.actions.OpenFileAction; 36 37 // CHECKSTYLE.OFF: HideUtilityClassConstructor 36 38 37 39 /** … … 77 79 public class FileDrop { 78 80 81 // CHECKSTYLE.ON: HideUtilityClassConstructor 82 79 83 private Border normalBorder; 80 84 private DropTargetListener dropListener; -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r8510 r8540 518 518 * @param actionToBeInserted the action that should get a menu item directly below {@code existingMenuEntryAction} 519 519 * @param isExpert whether the entry should only be visible if the expert mode is activated 520 * @param existingMenuEntryAction an action already added to the menu {@code menu}, the action {@code actionToBeInserted} is added directly below 520 * @param existingMenuEntryAction an action already added to the menu {@code menu}, 521 * the action {@code actionToBeInserted} is added directly below 521 522 * @return the created menu item 522 523 */ -
trunk/src/org/openstreetmap/josm/gui/MapMover.java
r8510 r8540 98 98 99 99 if (contentPane != null) { 100 // CHECKSTYLE.OFF: LineLength 100 101 contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( 101 102 Shortcut.registerShortcut("system:movefocusright", tr("Map: {0}", tr("Move right")), KeyEvent.VK_RIGHT, Shortcut.CTRL).getKeyStroke(), … … 117 118 "MapMover.Zoomer.down"); 118 119 contentPane.getActionMap().put("MapMover.Zoomer.down", new ZoomerAction("down")); 120 // CHECKSTYLE.ON: LineLength 119 121 120 122 // see #10592 - Disable these alternate shortcuts on OS X because of conflict with system shortcut -
trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java
r8510 r8540 197 197 * Task can run in background if returned value != null. Note that it's tasks responsibility 198 198 * to ensure proper synchronization, PleaseWaitRunnable doesn't with it. 199 * @return If returned value is != null then task can run in background. TaskId could be used in future for "Always run in background" checkbox 199 * @return If returned value is != null then task can run in background. 200 * TaskId could be used in future for "Always run in background" checkbox 200 201 */ 201 202 public ProgressTaskId canRunInBackground() { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
r8510 r8540 608 608 final Collection<? extends OsmPrimitive> primitives, 609 609 final TagCollection normalizedTags) throws UserCancelException { 610 String conflicts = Utils.joinAsHtmlUnorderedList(Utils.transform(normalizedTags.getKeysWithMultipleValues(), new Function<String, String>() {611 610 String conflicts = Utils.joinAsHtmlUnorderedList(Utils.transform(normalizedTags.getKeysWithMultipleValues(), 611 new Function<String, String>() { 612 612 @Override 613 613 public String apply(String key) { 614 return tr("{0} ({1})", key, Utils.join(tr(", "), Utils.transform(normalizedTags.getValues(key), new Function<String, String>() {615 614 return tr("{0} ({1})", key, Utils.join(tr(", "), Utils.transform(normalizedTags.getValues(key), 615 new Function<String, String>() { 616 616 @Override 617 617 public String apply(String x) { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
r8512 r8540 91 91 @Override 92 92 public void processKeyEvent(KeyEvent e) { 93 if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_ENTER) { 93 int keyCode = e.getKeyCode(); 94 if (e.getID() == KeyEvent.KEY_PRESSED && keyCode == KeyEvent.VK_ENTER) { 94 95 fireGotoNextDecision(); 95 } else if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode()== KeyEvent.VK_TAB) {96 } else if (e.getID() == KeyEvent.KEY_PRESSED && keyCode == KeyEvent.VK_TAB) { 96 97 if (e.isShiftDown()) { 97 98 fireGotoPreviousDecision(); … … 99 100 fireGotoNextDecision(); 100 101 } 101 } else if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_DELETE || e.getKeyCode()== KeyEvent.VK_BACK_SPACE) {102 } else if (e.getID() == KeyEvent.KEY_PRESSED && keyCode == KeyEvent.VK_DELETE || keyCode == KeyEvent.VK_BACK_SPACE) { 102 103 if (editorModel.getIndexOf(MultiValueDecisionType.KEEP_NONE) > 0) { 103 104 editorModel.setSelectedItem(MultiValueDecisionType.KEEP_NONE); 104 105 fireGotoNextDecision(); 105 106 } 106 } else if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode()== KeyEvent.VK_ESCAPE) {107 } else if (e.getID() == KeyEvent.KEY_PRESSED && keyCode == KeyEvent.VK_ESCAPE) { 107 108 cancelCellEditing(); 108 109 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
r8510 r8540 404 404 public SelectAndZoomAction() { 405 405 putValue(NAME, tr("Select and zoom")); 406 putValue(SHORT_DESCRIPTION, tr("Selects the objects that take part in this command (unless currently deleted), then and zooms to it")); 406 putValue(SHORT_DESCRIPTION, 407 tr("Selects the objects that take part in this command (unless currently deleted), then and zooms to it")); 407 408 putValue(SMALL_ICON, ImageProvider.get("dialogs/autoscale", "selection")); 408 409 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r8510 r8540 126 126 */ 127 127 JPanel p = panels.get(N-1); // current Panel (start with last one) 128 int k = -1; // indicates that thecurrent Panel index is N-1, but no default-view-Dialog has been added to this Panel yet.128 int k = -1; // indicates that current Panel index is N-1, but no default-view-Dialog has been added to this Panel yet. 129 129 for (int i = N-1; i >= 0; --i) { 130 130 final ToggleDialog dlg = allDialogs.get(i); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r8510 r8540 469 469 } 470 470 471 private static void setLatLon(final LatLonHolder latLon, final double coordDeg, final double coordMin, final double coordSec, final String card) { 471 private static void setLatLon(final LatLonHolder latLon, final double coordDeg, final double coordMin, final double coordSec, 472 final String card) { 472 473 if (coordDeg < -180 || coordDeg > 180 || coordMin < 0 || coordMin >= 60 || coordSec < 0 || coordSec > 60) { 473 474 throw new IllegalArgumentException("out of range"); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r8512 r8540 948 948 setSelected(visible); 949 949 setTranslucent(layer.getOpacity() < 1.0); 950 setToolTipText(visible ? tr("layer is currently visible (click to hide layer)") : tr("layer is currently hidden (click to show layer)")); 950 setToolTipText(visible ? 951 tr("layer is currently visible (click to hide layer)") : 952 tr("layer is currently hidden (click to show layer)")); 951 953 } 952 954 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r8512 r8540 108 108 private final DuplicateRelationAction duplicateAction = new DuplicateRelationAction(); 109 109 private final DownloadMembersAction downloadMembersAction = new DownloadMembersAction(); 110 private final DownloadSelectedIncompleteMembersAction downloadSelectedIncompleteMembersAction = new DownloadSelectedIncompleteMembersAction(); 110 private final DownloadSelectedIncompleteMembersAction downloadSelectedIncompleteMembersAction = 111 new DownloadSelectedIncompleteMembersAction(); 111 112 private final SelectMembersAction selectMembersAction = new SelectMembersAction(false); 112 113 private final SelectMembersAction addMembersToSelectionAction = new SelectMembersAction(true); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r8510 r8540 594 594 } 595 595 // It is wanted to ignore an error if it said fixable, even if fixCommand was null 596 // This is to fix #5764 and #5773: a delete command, for example, may be null if all concerned primitives have already been deleted 596 // This is to fix #5764 and #5773: 597 // a delete command, for example, may be null if all concerned primitives have already been deleted 597 598 error.setIgnored(true); 598 599 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
r8513 r8540 527 527 query.forUser(im.getUserId()); 528 528 } else 529 throw new IllegalStateException(tr("Cannot restrict changeset query to the current user because the current user is anonymous")); 529 throw new IllegalStateException( 530 tr("Cannot restrict changeset query to the current user because the current user is anonymous")); 530 531 } else if (rbRestrictToUid.isSelected()) { 531 532 int uid = valUid.getUid(); … … 536 537 } else if (rbRestrictToUserName.isSelected()) { 537 538 if (!valUserName.isValid()) 538 throw new IllegalStateException(tr("Cannot restrict the changeset query to the user name ''{0}''", tfUserName.getText())); 539 throw new IllegalStateException( 540 tr("Cannot restrict the changeset query to the user name ''{0}''", tfUserName.getText())); 539 541 query.forUser(tfUserName.getText()); 540 542 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java
r8510 r8540 31 31 if (isSelected) { 32 32 c.setForeground(Main.pref.getColor(marktr("Discardable key: selection Foreground"), Color.GRAY)); 33 c.setBackground(Main.pref.getColor(marktr("Discardable key: selection Background"), defaults.getColor("Table.selectionBackground"))); 33 c.setBackground(Main.pref.getColor(marktr("Discardable key: selection Background"), 34 defaults.getColor("Table.selectionBackground"))); 34 35 } else { 35 36 c.setForeground(Main.pref.getColor(marktr("Discardable key: foreground"), Color.GRAY)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r8510 r8540 183 183 184 184 private final DownloadMembersAction downloadMembersAction = new DownloadMembersAction(); 185 private final DownloadSelectedIncompleteMembersAction downloadSelectedIncompleteMembersAction = new DownloadSelectedIncompleteMembersAction(); 185 private final DownloadSelectedIncompleteMembersAction downloadSelectedIncompleteMembersAction = 186 new DownloadSelectedIncompleteMembersAction(); 186 187 187 188 private final SelectMembersAction selectMembersAction = new SelectMembersAction(false); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r8538 r8540 416 416 public static final BooleanProperty PROPERTY_FIX_TAG_LOCALE = new BooleanProperty("properties.fix-tag-combobox-locale", false); 417 417 public static final BooleanProperty PROPERTY_REMEMBER_TAGS = new BooleanProperty("properties.remember-recently-added-tags", true); 418 public static final IntegerProperty PROPERTY_RECENT_TAGS_NUMBER = new IntegerProperty("properties.recently-added-tags", DEFAULT_LRU_TAGS_NUMBER); 418 public static final IntegerProperty PROPERTY_RECENT_TAGS_NUMBER = new IntegerProperty("properties.recently-added-tags", 419 DEFAULT_LRU_TAGS_NUMBER); 419 420 420 421 abstract class AbstractTagsDialog extends ExtendedDialog { … … 697 698 String actionShortcutKey = "properties:recent:"+count; 698 699 String actionShortcutShiftKey = "properties:recent:shift:"+count; 700 // CHECKSTYLE.OFF: LineLength 699 701 Shortcut sc = Shortcut.registerShortcut(actionShortcutKey, tr("Choose recent tag {0}", count), KeyEvent.VK_0+count, Shortcut.CTRL); 702 // CHECKSTYLE.ON: LineLength 700 703 final JosmAction action = new JosmAction(actionShortcutKey, null, tr("Use this tag again"), sc, false) { 701 704 @Override -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r8513 r8540 222 222 registerCopyPasteAction(tagEditorPanel.getPasteAction(), 223 223 "PASTE_TAGS", 224 // CHECKSTYLE.OFF: LineLength 224 225 Shortcut.registerShortcut("system:pastestyle", tr("Edit: {0}", tr("Paste Tags")), KeyEvent.VK_V, Shortcut.CTRL_SHIFT).getKeyStroke()); 226 // CHECKSTYLE.ON: LineLength 225 227 registerCopyPasteAction(new PasteMembersAction(), "PASTE_MEMBERS", Shortcut.getPasteKeyStroke()); 226 228 registerCopyPasteAction(new CopyMembersAction(), "COPY_MEMBERS", Shortcut.getCopyKeyStroke()); … … 695 697 getRootPane().getActionMap().put(actionName, action); 696 698 getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(shortcut, actionName); 697 // Assign also to JTables because they have their own Copy&Paste implementation (which is disabled in this case but eats key shortcuts anyway) 699 // Assign also to JTables because they have their own Copy&Paste implementation 700 // (which is disabled in this case but eats key shortcuts anyway) 698 701 memberTable.getInputMap(JComponent.WHEN_FOCUSED).put(shortcut, actionName); 699 702 memberTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(shortcut, actionName); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
r8510 r8540 154 154 protected void realRun() throws SAXException, IOException, OsmTransferException { 155 155 try { 156 OsmServerObjectReader reader = new OsmServerObjectReader(relation.getId(), OsmPrimitiveType.from(relation), true /* full load */);156 OsmServerObjectReader reader = new OsmServerObjectReader(relation.getId(), OsmPrimitiveType.from(relation), true); 157 157 ds = reader.parseOsm(progressMonitor 158 158 .createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false)); -
trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java
r8510 r8540 91 91 * @param myVersion the version of the primitive in the local dataset 92 92 */ 93 protected void handleUploadConflictForKnownConflict(final OsmPrimitiveType primitiveType, final long id, String serverVersion, String myVersion) { 93 protected void handleUploadConflictForKnownConflict(final OsmPrimitiveType primitiveType, final long id, String serverVersion, 94 String myVersion) { 94 95 String lbl = ""; 95 96 switch(primitiveType) { -
trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
r8510 r8540 238 238 } 239 239 240 @Override protected void realRun() { 240 @Override 241 protected void realRun() { 241 242 try { 242 243 uploadloop: while (true) { 243 244 try { 244 getProgressMonitor().subTask(trn("Uploading {0} object...", "Uploading {0} objects...", toUpload.getSize(), toUpload.getSize())); 245 getProgressMonitor().subTask( 246 trn("Uploading {0} object...", "Uploading {0} objects...", toUpload.getSize(), toUpload.getSize())); 245 247 synchronized (this) { 246 248 writer = new OsmServerWriter(); -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r8530 r8540 1399 1399 g.setFont(InfoFont); 1400 1400 1401 // The current zoom tileset should have all of its tiles 1402 // due to the loadAllTiles(), unless it to tooLarge() 1401 // The current zoom tileset should have all of its tiles due to the loadAllTiles(), unless it to tooLarge() 1403 1402 for (Tile t : ts.allExistingTiles()) { 1404 1403 this.paintTileText(ts, t, g, mv, displayZoomLevel, t); 1405 1404 } 1406 1405 1407 attribution.paintAttribution(g, mv.getWidth(), mv.getHeight(), getShiftedCoord(topLeft), getShiftedCoord(botRight), displayZoomLevel, this); 1406 attribution.paintAttribution(g, mv.getWidth(), mv.getHeight(), getShiftedCoord(topLeft), getShiftedCoord(botRight), 1407 displayZoomLevel, this); 1408 1408 1409 1409 //g.drawString("currentZoomLevel=" + currentZoomLevel, 120, 120); -
trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
r8530 r8540 153 153 154 154 public static ImageryLayer create(ImageryInfo info) { 155 if (info.getImageryType() == ImageryType.WMS || info.getImageryType() == ImageryType.HTML) 155 ImageryType type = info.getImageryType(); 156 if (type == ImageryType.WMS || type == ImageryType.HTML) 156 157 return new WMSLayer(info); 157 else if ( info.getImageryType() == ImageryType.TMS || info.getImageryType() == ImageryType.BING || info.getImageryType()== ImageryType.SCANEX)158 else if (type == ImageryType.TMS || type == ImageryType.BING || type == ImageryType.SCANEX) 158 159 return new TMSLayer(info); 159 160 else throw new AssertionError(); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r8513 r8540 859 859 /** 860 860 * Sets the "discouraged upload" flag. 861 * @param uploadDiscouraged {@code true} if upload of data managed by this layer is discouraged. This feature allows to use "private" data layers. 861 * @param uploadDiscouraged {@code true} if upload of data managed by this layer is discouraged. 862 * This feature allows to use "private" data layers. 862 863 */ 863 864 public final void setUploadDiscouraged(boolean uploadDiscouraged) { -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r8530 r8540 42 42 AbstractTileSourceLayer.PROP_MAX_ZOOM_LVL.get()); 43 43 /** shall TMS layers be added to download dialog */ 44 public static final BooleanProperty PROP_ADD_TO_SLIPPYMAP_CHOOSER = new BooleanProperty(PREFERENCE_PREFIX + ".add_to_slippymap_chooser", true); 44 public static final BooleanProperty PROP_ADD_TO_SLIPPYMAP_CHOOSER = new BooleanProperty(PREFERENCE_PREFIX + ".add_to_slippymap_chooser", 45 true); 45 46 46 47 /** loader factory responsible for loading tiles for this layer */ -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r8512 r8540 1037 1037 @Override 1038 1038 public void propertyChange(PropertyChangeEvent evt) { 1039 if (NavigatableComponent.PROPNAME_CENTER.equals(evt.getPropertyName()) || NavigatableComponent.PROPNAME_SCALE.equals(evt.getPropertyName())) { 1039 if (NavigatableComponent.PROPNAME_CENTER.equals(evt.getPropertyName()) || 1040 NavigatableComponent.PROPNAME_SCALE.equals(evt.getPropertyName())) { 1040 1041 updateOffscreenBuffer = true; 1041 1042 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java
r8509 r8540 44 44 JPanel msg = new JPanel(new GridBagLayout()); 45 45 msg.add(new JLabel( 46 // CHECKSTYLE.OFF: LineLength 46 47 tr("<html>Upload of unprocessed GPS data as map data is considered harmful.<br>If you want to upload traces, look here:</html>")), 48 // CHECKSTYLE.ON: LineLength 47 49 GBC.eol()); 48 50 msg.add(new UrlLabel(Main.getOSMWebsite() + "/traces", 2), GBC.eop()); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r8510 r8540 327 327 case TIME: 328 328 double t = trkPnt.time; 329 if (t > 0 && t <= now && maxval - minval > minTrackDurationForTimeColoring) { // skip bad timestamps and very short tracks 329 // skip bad timestamps and very short tracks 330 if (t > 0 && t <= now && maxval - minval > minTrackDurationForTimeColoring) { 330 331 color = dateScale.getColor(t); 331 332 } else { -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r8510 r8540 110 110 names = ""; 111 111 } 112 MarkerLayer ml = new MarkerLayer(new GpxData(), tr("Audio markers from {0}", layer.getName()) + names, layer.getAssociatedFile(), layer); 112 MarkerLayer ml = new MarkerLayer(new GpxData(), 113 tr("Audio markers from {0}", layer.getName()) + names, layer.getAssociatedFile(), layer); 113 114 double firstStartTime = sel[0].lastModified() / 1000.0 - AudioUtil.getCalibratedDuration(sel[0]); 114 115 Markers m = new Markers(); … … 311 312 .showMessageDialog( 312 313 Main.parent, 314 // CHECKSTYLE.OFF: LineLength 313 315 tr("Some waypoints with timestamps from before the start of the track or after the end were omitted or moved to the start.")); 316 // CHECKSTYLE.ON: LineLength 314 317 markers.timedMarkersOmitted = timedMarkersOmitted; 315 318 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ButtonMarker.java
r6830 r8540 31 31 } 32 32 33 public ButtonMarker(LatLon ll, TemplateEngineDataProvider dataProvider, String buttonImage, MarkerLayer parentLayer, double time, double offset) { 33 public ButtonMarker(LatLon ll, TemplateEngineDataProvider dataProvider, String buttonImage, MarkerLayer parentLayer, double time, 34 double offset) { 34 35 super(ll, dataProvider, buttonImage, parentLayer, time, offset); 35 36 buttonRectangle = new Rectangle(0, 0, symbol.getIconWidth(), symbol.getIconHeight()); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
r8510 r8540 206 206 } 207 207 208 String urlStr ing= url == null ? "" : url.toString();208 String urlStr = url == null ? "" : url.toString(); 209 209 if (url == null) { 210 210 String symbolName = wpt.getString("symbol"); … … 213 213 } 214 214 return new Marker(wpt.getCoor(), wpt, symbolName, parentLayer, time, offset); 215 } else if (urlStr ing.endsWith(".wav")) {215 } else if (urlStr.endsWith(".wav")) { 216 216 AudioMarker audioMarker = new AudioMarker(wpt.getCoor(), wpt, url, parentLayer, time, offset); 217 217 Extensions exts = (Extensions) wpt.get(GpxConstants.META_EXTENSIONS); … … 224 224 } 225 225 return audioMarker; 226 } else if (urlStr ing.endsWith(".png") || urlString.endsWith(".jpg") || urlString.endsWith(".jpeg") || urlString.endsWith(".gif")) {226 } else if (urlStr.endsWith(".png") || urlStr.endsWith(".jpg") || urlStr.endsWith(".jpeg") || urlStr.endsWith(".gif")) { 227 227 return new ImageMarker(wpt.getCoor(), url, parentLayer, time, offset); 228 228 } else { -
trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java
r8512 r8540 231 231 @Override 232 232 public String toString() { 233 return "BoxTextElemStyle{" + super.toString() + " " + text.toStringImpl() + " box=" + box + " hAlign=" + hAlign + " vAlign=" + vAlign + '}'; 233 return "BoxTextElemStyle{" + super.toString() + " " + text.toStringImpl() 234 + " box=" + box + " hAlign=" + hAlign + " vAlign=" + vAlign + '}'; 234 235 } 235 236 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r8514 r8540 262 262 263 263 /** 264 * Creates a color value with the specified amounts of {@code r}ed, {@code g}reen, {@code b}lue, {@code alpha} (arguments from 0.0 to 1.0) 264 * Creates a color value with the specified amounts of {@code r}ed, {@code g}reen, {@code b}lue, {@code alpha} 265 * (arguments from 0.0 to 1.0) 265 266 * @param r the red component 266 267 * @param g the green component -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r8510 r8540 317 317 SessionId sessionId = extractOsmSession(connection); 318 318 if (sessionId == null) 319 throw new OsmOAuthAuthorizationException(tr("OSM website did not return a session cookie in response to ''{0}'',", url.toString())); 319 throw new OsmOAuthAuthorizationException( 320 tr("OSM website did not return a session cookie in response to ''{0}'',", url.toString())); 320 321 return sessionId; 321 322 } catch (IOException e) { … … 347 348 sessionId.token = extractToken(connection); 348 349 if (sessionId.token == null) 349 throw new OsmOAuthAuthorizationException(tr("OSM website did not return a session cookie in response to ''{0}'',", url.toString())); 350 throw new OsmOAuthAuthorizationException(tr("OSM website did not return a session cookie in response to ''{0}'',", 351 url.toString())); 350 352 } catch (IOException e) { 351 353 throw new OsmOAuthAuthorizationException(e); … … 396 398 int retCode = connection.getResponseCode(); 397 399 if (retCode != HttpURLConnection.HTTP_MOVED_TEMP) 398 throw new OsmOAuthAuthorizationException(tr("Failed to authenticate user ''{0}'' with password ''***'' as OAuth user", userName)); 400 throw new OsmOAuthAuthorizationException(tr("Failed to authenticate user ''{0}'' with password ''***'' as OAuth user", 401 userName)); 399 402 } catch (OsmOAuthAuthorizationException e) { 400 403 throw new OsmLoginFailedException(e.getCause()); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
r8510 r8540 159 159 160 160 // drawRawGpsMaxLineLengthLocal 161 drawRawGpsMaxLineLengthLocal.setToolTipText(tr("Maximum length (in meters) to draw lines for local files. Set to ''-1'' to draw all lines.")); 161 drawRawGpsMaxLineLengthLocal.setToolTipText( 162 tr("Maximum length (in meters) to draw lines for local files. Set to ''-1'' to draw all lines.")); 162 163 label = new JLabel(tr("Maximum length for local files (meters)")); 163 164 add(label, GBC.std().insets(40, 0, 0, 0)); -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java
r8526 r8540 42 42 public TMSSettingsPanel() { 43 43 super(new GridBagLayout()); 44 minZoomLvl = new JSpinner(new SpinnerNumberModel(TMSLayer.PROP_MIN_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM, 1)); 45 maxZoomLvl = new JSpinner(new SpinnerNumberModel(TMSLayer.PROP_MAX_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM, 1)); 46 maxElementsOnDisk = new JSpinner(new SpinnerNumberModel(TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.get().intValue(), 0, Integer.MAX_VALUE, 1)); 47 maxConcurrentDownloads = new JSpinner(new SpinnerNumberModel(TMSCachedTileLoaderJob.THREAD_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1)); 48 maxDownloadsPerHost = new JSpinner(new SpinnerNumberModel(TMSCachedTileLoader.HOST_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1)); 44 minZoomLvl = new JSpinner(new SpinnerNumberModel( 45 TMSLayer.PROP_MIN_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM, 1)); 46 maxZoomLvl = new JSpinner(new SpinnerNumberModel( 47 TMSLayer.PROP_MAX_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM, 1)); 48 maxElementsOnDisk = new JSpinner(new SpinnerNumberModel( 49 TMSCachedTileLoader.MAX_OBJECTS_ON_DISK.get().intValue(), 0, Integer.MAX_VALUE, 1)); 50 maxConcurrentDownloads = new JSpinner(new SpinnerNumberModel( 51 TMSCachedTileLoaderJob.THREAD_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1)); 52 maxDownloadsPerHost = new JSpinner(new SpinnerNumberModel( 53 TMSCachedTileLoader.HOST_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1)); 49 54 50 55 add(new JLabel(tr("Auto zoom by default: ")), GBC.std()); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r8510 r8540 354 354 Bounds b = proj.getWorldBoundsLatLon(); 355 355 CoordinateFormat cf = CoordinateFormat.getDefaultFormat(); 356 bounds.setText(b.getMin().lonToString(cf)+", "+b.getMin().latToString(cf)+" : "+b.getMax().lonToString(cf)+", "+b.getMax().latToString(cf)); 356 bounds.setText(b.getMin().lonToString(cf) + ", " + b.getMin().latToString(cf) + " : " + 357 b.getMax().lonToString(cf) + ", " + b.getMax().latToString(cf)); 357 358 boolean showCode = true; 358 359 boolean showName = false; -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r8510 r8540 61 61 // independent from the keyboard's labelling. But the operation system's locale 62 62 // usually matches the keyboard. This even works with my English Windows and my German keyboard. 63 private static final String SHIFT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers()); 64 private static final String CTRL = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers()); 65 private static final String ALT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK).getModifiers()); 66 private static final String META = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK).getModifiers()); 63 private static final String SHIFT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, 64 KeyEvent.SHIFT_DOWN_MASK).getModifiers()); 65 private static final String CTRL = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, 66 KeyEvent.CTRL_DOWN_MASK).getModifiers()); 67 private static final String ALT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, 68 KeyEvent.ALT_DOWN_MASK).getModifiers()); 69 private static final String META = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, 70 KeyEvent.META_DOWN_MASK).getModifiers()); 67 71 68 72 // A list of keys to present the user. Sadly this really is a list of keys Java knows about, -
trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java
r8510 r8540 336 336 List<PrimitiveData> directlyAdded = Main.pasteBuffer.getDirectlyAdded(); 337 337 if (directlyAdded == null || directlyAdded.isEmpty()) return; 338 PasteTagsAction.TagPaster tagPaster = new PasteTagsAction.TagPaster(directlyAdded, Collections.<OsmPrimitive>singletonList(relation)); 338 PasteTagsAction.TagPaster tagPaster = new PasteTagsAction.TagPaster(directlyAdded, 339 Collections.<OsmPrimitive>singletonList(relation)); 339 340 model.updateTags(tagPaster.execute()); 340 341 } else { -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
r8510 r8540 43 43 * @since 6867 44 44 */ 45 public static final String PRESET_MIME_TYPES = "application/xml, text/xml, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5"; 45 public static final String PRESET_MIME_TYPES = 46 "application/xml, text/xml, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5"; 46 47 47 48 private TaggingPresetReader() { … … 306 307 * @throws IOException if any I/O error occurs 307 308 */ 308 static Collection<TaggingPreset> readAll(String source, boolean validate, HashSetWithLast<TaggingPreset> all) throws SAXException, IOException { 309 static Collection<TaggingPreset> readAll(String source, boolean validate, HashSetWithLast<TaggingPreset> all) 310 throws SAXException, IOException { 309 311 Collection<TaggingPreset> tp; 310 312 CachedFile cf = new CachedFile(source).setHttpAccept(PRESET_MIME_TYPES); -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchPrimitiveDialog.java
r8378 r8540 80 80 public Action() { 81 81 super(tr("Search for objects by preset"), "dialogs/search", tr("Show preset search dialog"), 82 Shortcut.registerShortcut("preset:search-objects", tr("Search for objects by preset"), KeyEvent.VK_F3, Shortcut.SHIFT), false); 82 Shortcut.registerShortcut("preset:search-objects", tr("Search for objects by preset"), KeyEvent.VK_F3, Shortcut.SHIFT), 83 false); 83 84 putValue("toolbar", "presets/search-objects"); 84 85 Main.toolbar.register(this); -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java
r8513 r8540 397 397 boolean suitable = preset.typeMatches(presetTypes); 398 398 399 if (!suitable && preset.types.contains(TaggingPresetType.RELATION) && preset.roles != null && !preset.roles.roles.isEmpty()) { 399 if (!suitable && preset.types.contains(TaggingPresetType.RELATION) 400 && preset.roles != null && !preset.roles.roles.isEmpty()) { 400 401 final Predicate<Role> memberExpressionMatchesOnePrimitive = new Predicate<Role>() { 401 402 402 @Override 403 403 public boolean evaluate(Role object) { -
trunk/src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java
r8512 r8540 49 49 } 50 50 51 // CHECKSTYLE.OFF: LineLength 52 51 53 /** 52 54 * Creates a new {@code FileChooserManager}. … … 75 77 : Main.pref.get(this.lastDirProperty); 76 78 } 79 80 // CHECKSTYLE.ON: LineLength 77 81 78 82 /** -
trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
r7937 r8540 107 107 @Override 108 108 public void setFileSelectionMode(int selectionMode) { 109 // CHECKSTYLE.OFF: LineLength 109 110 // TODO implement this after Oracle fixes JDK-6192906 / JDK-6699863 / JDK-6927978 / JDK-7125172: 110 111 // https://bugs.openjdk.java.net/browse/JDK-6192906 : Add more features to java.awt.FileDialog … … 116 117 // http://stackoverflow.com/questions/1224714/how-can-i-make-a-java-filedialog-accept-directories-as-its-filetype-in-os-x/1224744#1224744 117 118 // https://bugs.openjdk.java.net/browse/JDK-7161437 : [macosx] awt.FileDialog doesn't respond appropriately for mac when selecting folders 119 // CHECKSTYLE.ON: LineLength 118 120 this.selectionMode = selectionMode; 119 121 } … … 164 166 switch (selectionMode) { 165 167 case JFileChooser.FILES_AND_DIRECTORIES: 168 // CHECKSTYLE.OFF: LineLength 166 169 // https://bugs.openjdk.java.net/browse/JDK-7125172 : FileDialog objects don't allow directory AND files selection simultaneously 167 170 return false; 168 171 case JFileChooser.DIRECTORIES_ONLY: 169 172 // http://stackoverflow.com/questions/1224714/how-can-i-make-a-java-filedialog-accept-directories-as-its-filetype-in-os-x/1224744#1224744 173 // CHECKSTYLE.ON: LineLength 170 174 return Main.isPlatformOsx(); 171 175 case JFileChooser.FILES_ONLY: -
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r8510 r8540 126 126 DataSet ds2 = null; 127 127 128 try (InputStream in = getInputStream(getRequestForBbox(lon1, lat1, 180.0, lat2), progressMonitor.createSubTaskMonitor(9, false))) { 128 try (InputStream in = getInputStream(getRequestForBbox(lon1, lat1, 180.0, lat2), 129 progressMonitor.createSubTaskMonitor(9, false))) { 129 130 if (in == null) 130 131 return null; … … 132 133 } 133 134 134 try (InputStream in = getInputStream(getRequestForBbox(-180.0, lat1, lon2, lat2), progressMonitor.createSubTaskMonitor(9, false))) { 135 try (InputStream in = getInputStream(getRequestForBbox(-180.0, lat1, lon2, lat2), 136 progressMonitor.createSubTaskMonitor(9, false))) { 135 137 if (in == null) 136 138 return null; … … 143 145 } else { 144 146 // Simple request 145 try (InputStream in = getInputStream(getRequestForBbox(lon1, lat1, lon2, lat2), progressMonitor.createSubTaskMonitor(9, false))) { 147 try (InputStream in = getInputStream(getRequestForBbox(lon1, lat1, lon2, lat2), 148 progressMonitor.createSubTaskMonitor(9, false))) { 146 149 if (in == null) 147 150 return null; … … 161 164 162 165 @Override 163 public List<Note> parseNotes(int noteLimit, int daysClosed, ProgressMonitor progressMonitor) throws OsmTransferException, MoreNotesException { 166 public List<Note> parseNotes(int noteLimit, int daysClosed, ProgressMonitor progressMonitor) 167 throws OsmTransferException, MoreNotesException { 164 168 progressMonitor.beginTask("Downloading notes"); 165 169 CheckParameterUtil.ensureThat(noteLimit > 0, "Requested note limit is less than 1."); -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r8510 r8540 230 230 } 231 231 } 232 233 // CHECKSTYLE.OFF: ParameterNumber 232 234 233 235 /** … … 248 250 final JLabel warning) { 249 251 252 // CHECKSTYLE.ON: ParameterNumber 250 253 ActionListener authorActionListener = new ActionListener() { 251 254 @Override -
trunk/src/org/openstreetmap/josm/io/JpgImporter.java
r8404 r8540 88 88 } 89 89 90 private void addRecursiveFiles(List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor) throws IOException { 90 private void addRecursiveFiles(List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor) 91 throws IOException { 91 92 92 93 if (progressMonitor.isCanceled()) -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r8510 r8540 513 513 * @throws OsmTransferException if an error occurs while communicating with the API server 514 514 */ 515 protected FetchResult multiGetIdPackage(OsmPrimitiveType type, Set<Long> pkg, ProgressMonitor progressMonitor) throws OsmTransferException { 515 protected FetchResult multiGetIdPackage(OsmPrimitiveType type, Set<Long> pkg, ProgressMonitor progressMonitor) 516 throws OsmTransferException { 516 517 String request = buildRequestString(type, pkg); 517 518 FetchResult result = null; … … 571 572 * @throws OsmTransferException if an error occurs while communicating with the API server 572 573 */ 573 protected FetchResult singleGetIdPackage(OsmPrimitiveType type, Set<Long> pkg, ProgressMonitor progressMonitor) throws OsmTransferException { 574 protected FetchResult singleGetIdPackage(OsmPrimitiveType type, Set<Long> pkg, ProgressMonitor progressMonitor) 575 throws OsmTransferException { 574 576 FetchResult result = new FetchResult(new DataSet(), new HashSet<PrimitiveId>()); 575 577 String baseUrl = OsmApi.getOsmApi().getBaseUrl(); -
trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
r8510 r8540 81 81 case "relation": 82 82 if (currentModificationType == null) { 83 // CHECKSTYLE.OFF: LineLength 83 84 throwException(tr("Illegal document structure. Found node, way, or relation outside of ''create'', ''modify'', or ''delete''.")); 85 // CHECKSTYLE.ON: LineLength 84 86 } 85 87 data.put(currentPrimitive, currentModificationType); -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r8510 r8540 317 317 id = Long.parseLong(value); 318 318 } catch (NumberFormatException e) { 319 throwException(tr("Illegal value for attribute ''ref'' on member in relation {0}. Got {1}", Long.toString(r.getUniqueId()), value), e); 319 throwException(tr("Illegal value for attribute ''ref'' on member in relation {0}. Got {1}", Long.toString(r.getUniqueId()), 320 value), e); 320 321 } 321 322 value = parser.getAttributeValue(null, "type"); … … 502 503 if (current.isNew()) { 503 504 // for a new primitive we just log a warning 504 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId())); 505 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", 506 v, current.getUniqueId())); 505 507 current.setChangesetId(0); 506 508 } else { … … 516 518 if (current.isNew()) { 517 519 // for a new primitive we just log a warning 518 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId())); 520 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", 521 v, current.getUniqueId())); 519 522 current.setChangesetId(0); 520 523 } else { -
trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java
r8510 r8540 141 141 * @since 7704 142 142 */ 143 public List<Changeset> readChangesets(Collection<Integer> ids, boolean includeDiscussion, ProgressMonitor monitor) throws OsmTransferException { 143 public List<Changeset> readChangesets(Collection<Integer> ids, boolean includeDiscussion, ProgressMonitor monitor) 144 throws OsmTransferException { 144 145 if (ids == null) 145 146 return Collections.emptyList(); … … 192 193 public ChangesetDataSet downloadChangeset(int id, ProgressMonitor monitor) throws OsmTransferException { 193 194 if (id <= 0) 194 throw new IllegalArgumentException(MessageFormat.format("Expected value of type integer > 0 for parameter ''{0}'', got {1}", "id", id)); 195 throw new IllegalArgumentException( 196 MessageFormat.format("Expected value of type integer > 0 for parameter ''{0}'', got {1}", "id", id)); 195 197 if (monitor == null) { 196 198 monitor = NullProgressMonitor.INSTANCE; -
trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java
r8510 r8540 125 125 userInfo.setUnreadMessages(Integer.parseInt(v)); 126 126 } catch (NumberFormatException e) { 127 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "unread", "received", v), e); 127 throw new XmlParsingException( 128 tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "unread", "received", v), e); 128 129 } 129 130 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r8510 r8540 128 128 this.sender = senderName; 129 129 130 final DefaultTableModel tm = new DefaultTableModel(new String[] {tr("Assume"), tr("Key"), tr("Value"), tr("Existing values")}, tags.length) { 130 final DefaultTableModel tm = new DefaultTableModel(new String[] {tr("Assume"), tr("Key"), tr("Value"), tr("Existing values")}, 131 tags.length) { 131 132 private final Class<?>[] types = {Boolean.class, String.class, Object.class, ExistingValues.class}; 132 133 @Override -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r8510 r8540 233 233 X509Certificate cert = generateCertificate("CN=localhost, OU=JOSM, O=OpenStreetMap", pair, 1825, "SHA256withRSA", 234 234 // see #10033#comment:20: All browsers respect "ip" in SAN, except IE which only understands DNS entries: 235 // CHECKSTYLE.OFF: LineLength 235 236 // https://connect.microsoft.com/IE/feedback/details/814744/the-ie-doesnt-trust-a-san-certificate-when-connecting-to-ip-address 237 // CHECKSTYLE.ON: LineLength 236 238 "dns:localhost,ip:127.0.0.1,dns:127.0.0.1,ip:::1,uri:https://127.0.0.1:"+HTTPS_PORT+",uri:https://::1:"+HTTPS_PORT); 237 239 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r8510 r8540 64 64 public String[] getUsageExamples() { 65 65 return new String[] { 66 // CHECKSTYLE.OFF: LineLength 66 67 "/add_way?way=53.2,13.3;53.3,13.3;53.3,13.2", 67 68 "/add_way?&addtags=building=yes&way=45.437213,-2.810792;45.437988,-2.455983;45.224080,-2.455036;45.223302,-2.809845;45.437213,-2.810792" 69 // CHECKSTYLE.ON: LineLength 68 70 }; 69 71 } -
trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java
r8513 r8540 25 25 26 26 @Override 27 public Layer load(Element elem, SessionReader.ImportSupport support, ProgressMonitor progressMonitor) throws IOException, IllegalDataException { 27 public Layer load(Element elem, SessionReader.ImportSupport support, ProgressMonitor progressMonitor) 28 throws IOException, IllegalDataException { 28 29 String version = elem.getAttribute("version"); 29 30 if (!"0.1".equals(version)) { -
trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionImporter.java
r7937 r8540 23 23 24 24 @Override 25 public Layer load(Element elem, SessionReader.ImportSupport support, ProgressMonitor progressMonitor) throws IOException, IllegalDataException { 25 public Layer load(Element elem, SessionReader.ImportSupport support, ProgressMonitor progressMonitor) 26 throws IOException, IllegalDataException { 26 27 String version = elem.getAttribute("version"); 27 28 if (!"0.1".equals(version)) { -
trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionImporter.java
r7326 r8540 39 39 OsmImporter importer = new OsmImporter(); 40 40 try (InputStream in = support.getInputStream(fileStr)) { 41 OsmImporter.OsmImporterData importData = importer.loadLayer(in, support.getFile(fileStr), support.getLayerName(), progressMonitor); 41 OsmImporter.OsmImporterData importData = importer.loadLayer(in, support.getFile(fileStr), support.getLayerName(), 42 progressMonitor); 42 43 43 44 support.addPostLayersTask(importData.getPostLayerTask()); -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r8510 r8540 308 308 if (centerEl != null && centerEl.hasAttribute("lat") && centerEl.hasAttribute("lon")) { 309 309 try { 310 LatLon centerLL = new LatLon(Double.parseDouble(centerEl.getAttribute("lat")), Double.parseDouble(centerEl.getAttribute("lon"))); 310 LatLon centerLL = new LatLon(Double.parseDouble(centerEl.getAttribute("lat")), 311 Double.parseDouble(centerEl.getAttribute("lon"))); 311 312 center = Projections.project(centerLL); 312 313 } catch (NumberFormatException ex) { -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r8513 r8540 1482 1482 gc.fill = GridBagConstraints.HORIZONTAL; 1483 1483 gc.weighty = 0.0; 1484 add(cbDontShowAgain = new JCheckBox(tr("Do not ask again and remember my decision (go to Preferences->Plugins to change it later)")), gc); 1484 add(cbDontShowAgain = new JCheckBox( 1485 tr("Do not ask again and remember my decision (go to Preferences->Plugins to change it later)")), gc); 1485 1486 cbDontShowAgain.setFont(cbDontShowAgain.getFont().deriveFont(Font.PLAIN)); 1486 1487 } -
trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
r8510 r8540 191 191 } 192 192 193 private void handleIOException(final ProgressMonitor monitor, IOException e, final String title, final String firstMessage, boolean displayMsg) { 193 private void handleIOException(final ProgressMonitor monitor, IOException e, final String title, final String firstMessage, 194 boolean displayMsg) { 194 195 StringBuilder sb = new StringBuilder(); 195 196 try (InputStream errStream = connection.getErrorStream()) { -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r8510 r8540 857 857 // See #10479: for PNG files, always enforce transparency to be sure tNRS chunk is used even not in paletted mode 858 858 // This can be removed if someday Oracle fixes https://bugs.openjdk.java.net/browse/JDK-6788458 859 // CHECKSTYLE.OFF: LineLength 859 860 // hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/828c4fedd29f/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java#l656 861 // CHECKSTYLE.ON: LineLength 860 862 Image img = read(new ByteArrayInputStream(bytes), false, true); 861 863 return img == null ? null : new ImageResource(img); … … 1541 1543 } 1542 1544 1545 // CHECKSTYLE.OFF: LineLength 1546 1543 1547 /** 1544 1548 * Returns the {@code TransparentColor} defined in image reader metadata. … … 1551 1555 */ 1552 1556 public static Color getTransparentColor(ColorModel model, ImageReader reader) throws IOException { 1557 // CHECKSTYLE.ON: LineLength 1553 1558 try { 1554 1559 IIOMetadata metadata = reader.getImageMetadata(0); -
trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java
r8291 r8540 51 51 Main.platform.openUrl(uri.toString()); 52 52 } else { 53 // This is not the case with some Linux environments (see below), and not sure about Mac OS X, so we need to handle API failure 53 // This is not the case with some Linux environments (see below), 54 // and not sure about Mac OS X, so we need to handle API failure 54 55 try { 55 56 Desktop.getDesktop().browse(uri); -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r8518 r8540 261 261 if ("Linux".equalsIgnoreCase(osName)) { 262 262 try { 263 // Try lsb_release (only available on LSB-compliant Linux systems, see https://www.linuxbase.org/lsb-cert/productdir.php?by_prod ) 263 // Try lsb_release (only available on LSB-compliant Linux systems, 264 // see https://www.linuxbase.org/lsb-cert/productdir.php?by_prod ) 264 265 Process p = Runtime.getRuntime().exec("lsb_release -ds"); 265 266 try (BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8))) { -
trunk/src/org/openstreetmap/josm/tools/template_engine/ParseError.java
r8308 r8540 17 17 18 18 public ParseError(Token unexpectedToken, TokenType expected) { 19 super(tr("Unexpected token on position {0}. Expected {1}, found {2}", unexpectedToken.getPosition(), expected, unexpectedToken.getType())); 19 super(tr("Unexpected token on position {0}. Expected {1}, found {2}", 20 unexpectedToken.getPosition(), expected, unexpectedToken.getType())); 20 21 this.unexpectedToken = unexpectedToken; 21 22 } -
trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
r8511 r8540 156 156 Main.logLevel = 4; 157 157 158 File dataSetCacheOutputFile = new File(System.getProperty("java.io.tmpdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset"); 158 File dataSetCacheOutputFile = new File(System.getProperty("java.io.tmpdir"), 159 MultiFetchServerObjectReaderTest.class.getName() + ".dataset"); 159 160 160 161 String p = System.getProperty("useCachedDataset"); -
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r8511 r8540 74 74 if (!f.exists() || !f.canRead()) { 75 75 fail(MessageFormat.format( 76 // CHECKSTYLE.OFF: LineLength 76 77 "property ''{0}'' points to ''{1}'' which is either not existing ({2}) or not readable ({3}). Current directory is ''{4}''.", 78 // CHECKSTYLE.ON: LineLength 77 79 "josm.home", josmHome, f.exists(), f.canRead(), Paths.get("").toAbsolutePath())); 78 80 } -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r8510 r8540 83 83 84 84 Random rand = new Random(); 85 try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) { 85 try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter( 86 new FileOutputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) { 86 87 out.write("# Data for test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java\n"); 87 88 out.write("# Format: 1. Projection code; 2. lat/lon; 3. lat/lon projected -> east/north; 4. east/north (3.) inverse projected\n"); -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r8513 r8540 23 23 Main.setProjection(Projections.getProjectionByCode(SWISS_EPSG_CODE)); // Swiss grid 24 24 } 25 26 // CHECKSTYLE.OFF: LineLength 25 27 26 28 /** … … 34 36 new ProjData("Monte Generoso", d(9, 1, 16.389053), d(45, 55, 45.438020), 1685.027, 722758.810, 87649.670, 1636.600) }; 35 37 38 // CHECKSTYLE.ON: LineLength 39 36 40 private double d(double deg, double min, double sec) { 37 41 return deg + min / 60. + sec / 3600.; -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/LatLonDialogTest.java
r8509 r8540 36 36 @Test 37 37 public void test6() throws Exception { 38 assertThat(LatLonDialog.parseLatLon("N 49°29'04\" E 19°24'43\""), is(new LatLon(49 + 29. / 60 + 04. / 3600, 19 + 24. / 60 + 43. / 3600))); 38 assertThat(LatLonDialog.parseLatLon("N 49°29'04\" E 19°24'43\""), 39 is(new LatLon(49 + 29. / 60 + 04. / 3600, 19 + 24. / 60 + 43. / 3600))); 39 40 } 40 41 … … 46 47 @Test 47 48 public void test8() throws Exception { 48 assertThat(LatLonDialog.parseLatLon("49°29'21\" N 19°24'38\" E"), is(new LatLon(49 + 29. / 60 + 21. / 3600, 19 + 24. / 60 + 38. / 3600))); 49 assertThat(LatLonDialog.parseLatLon("49°29'21\" N 19°24'38\" E"), 50 is(new LatLon(49 + 29. / 60 + 21. / 3600, 19 + 24. / 60 + 38. / 3600))); 49 51 } 50 52 -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/PresetClassificationsTest.java
r8511 r8540 36 36 37 37 private List<TaggingPresetSelector.PresetClassification> getMatchingPresets(String searchText, OsmPrimitive w) { 38 return classifications.getMatchingPresets(searchText, true, true, EnumSet.of(TaggingPresetType.forPrimitive(w)), Collections.singleton(w)); 38 return classifications.getMatchingPresets(searchText, true, true, EnumSet.of(TaggingPresetType.forPrimitive(w)), 39 Collections.singleton(w)); 39 40 } 40 41 -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java
r8510 r8540 71 71 public void testRequestParameter4() { 72 72 assertThat(getRequestParameter( 73 // CHECKSTYLE.OFF: LineLength 73 74 "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$'()*+,;=/?:@-._~!$'()*+,;==#/?:@-._~!$&'()*+,;="), 75 // CHECKSTYLE.ON: LineLength 74 76 is(Collections.singletonMap("/?:@-._~!$'()* ,;", "/?:@-._~!$'()* ,;=="))); 75 77 } -
trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEngineTest.java
r8510 r8540 217 217 @Test 218 218 public void testMultilevel() throws ParseError { 219 TemplateParser parser = new TemplateParser("!{(parent(parent(type=type1)) type=grandparent) | (parent type=type2 type=parent2) '{name}'}"); 219 TemplateParser parser = new TemplateParser( 220 "!{(parent(parent(type=type1)) type=grandparent) | (parent type=type2 type=parent2) '{name}'}"); 220 221 DatasetFactory ds = new DatasetFactory(); 221 222 Relation parent1 = ds.addRelation(1); -
trunk/tools/checkstyle/josm_checks.xml
r8536 r8540 36 36 </module> 37 37 <module name="ExecutableStatementCount"> 38 <property name="max" value="1 28"/>38 <property name="max" value="150"/> 39 39 <property name="tokens" value="INSTANCE_INIT,STATIC_INIT,METHOD_DEF,CTOR_DEF"/> 40 40 </module> 41 41 <module name="LineLength"> 42 <property name="max" value="1 50"/>42 <property name="max" value="145"/> 43 43 <property name="tabWidth" value="4"/> 44 44 </module>
Note:
See TracChangeset
for help on using the changeset viewer.