Changeset 8513 in josm
- Timestamp:
- 2015-06-21T02:25:56+02:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 77 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r8512 r8513 934 934 } catch (ClassNotFoundException ex) { 935 935 // Do nothing 936 if (Main.isTraceEnabled()) { 937 Main.trace(ex.getMessage()); 938 } 936 939 } 937 940 } -
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r8510 r8513 248 248 // Search first fixed node 249 249 int startPosition = 0; 250 for (startPosition = 0; startPosition < nodeCount; startPosition++) 251 if (fixNodes.contains(nodes.get(startPosition % nodeCount))) break; 250 for (startPosition = 0; startPosition < nodeCount; startPosition++) { 251 if (fixNodes.contains(nodes.get(startPosition % nodeCount))) 252 break; 253 } 252 254 int i = startPosition; // Start position for current arc 253 255 int j; // End position for current arc 254 256 while (i < startPosition + nodeCount) { 255 for (j = i + 1; j < startPosition + nodeCount; j++) 256 if (fixNodes.contains(nodes.get(j % nodeCount))) break; 257 for (j = i + 1; j < startPosition + nodeCount; j++) { 258 if (fixNodes.contains(nodes.get(j % nodeCount))) 259 break; 260 } 257 261 Node first = nodes.get(i % nodeCount); 258 262 PolarCoor pcFirst = new PolarCoor(first.getEastNorth(), center, 0); … … 289 293 private List<Node> collectNodesWithExternReferers(List<Way> ways) { 290 294 List<Node> withReferrers = new ArrayList<>(); 291 for (Way w: ways) 292 for (Node n: w.getNodes()) 293 if (n.getReferrers().size() > 1) 295 for (Way w: ways) { 296 for (Node n: w.getNodes()) { 297 if (n.getReferrers().size() > 1) { 294 298 withReferrers.add(n); 299 } 300 } 301 } 295 302 return withReferrers; 296 303 } … … 312 319 if (way.firstNode() == lastNode) { 313 320 List<Node> wayNodes = way.getNodes(); 314 for (int i = 0; i < wayNodes.size() - 1; i++) 321 for (int i = 0; i < wayNodes.size() - 1; i++) { 315 322 nodes.add(wayNodes.get(i)); 323 } 316 324 lastNode = way.lastNode(); 317 325 lastWay = way; … … 320 328 if (way.lastNode() == lastNode) { 321 329 List<Node> wayNodes = way.getNodes(); 322 for (int i = wayNodes.size() - 1; i > 0; i--) 330 for (int i = wayNodes.size() - 1; i > 0; i--) { 323 331 nodes.add(wayNodes.get(i)); 332 } 324 333 lastNode = way.firstNode(); 325 334 lastWay = way; … … 348 357 private boolean actionAllowed(Collection<Node> nodes) { 349 358 boolean outside = false; 350 for (Node n: nodes) 359 for (Node n: nodes) { 351 360 if (n.isOutsideDownloadArea()) { 352 361 outside = true; 353 362 break; 354 363 } 364 } 355 365 if (outside) 356 366 new Notification( -
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r8510 r8513 219 219 Collection<Command> cmds = new ArrayList<>(nodes.size()); 220 220 Line line = new Line(anchors[0], anchors[1]); 221 for (Node node: nodes) 221 for (Node node: nodes) { 222 222 if (node != anchors[0] && node != anchors[1]) 223 223 cmds.add(line.projectionCommand(node)); 224 } 224 225 return new SequenceCommand(tr("Align Nodes in Line"), cmds); 225 226 } … … 245 246 for (Node n: nodes) { 246 247 referers.clear(); 247 for (OsmPrimitive o: n.getReferrers()) 248 for (OsmPrimitive o: n.getReferrers()) { 248 249 if (ways.contains(o)) 249 250 referers.add((Way) o); 251 } 250 252 if (referers.size() == 1) { 251 253 Way way = referers.get(0); … … 274 276 List<Node> nodes = way.getNodes(); 275 277 neighbors.clear(); 276 for (int i = 1; i < nodes.size()-1; i++) 278 for (int i = 1; i < nodes.size()-1; i++) { 277 279 if (nodes.get(i) == node) { 278 280 neighbors.add(nodes.get(i-1)); 279 281 neighbors.add(nodes.get(i+1)); 280 282 } 283 } 281 284 if (neighbors.isEmpty()) 282 285 continue; -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r8510 r8513 103 103 104 104 // TODO: convert this to switch/case and make sure the parsing still works 105 // CHECKSTYLE.OFF: LeftCurly 106 // CHECKSTYLE.OFF: RightCurly 105 107 /* leave as single line for shortcut overview parsing! */ 106 108 if (mode.equals("data")) { shortcut = KeyEvent.VK_1; } … … 112 114 else if (mode.equals("previous")) { shortcut = KeyEvent.VK_8; } 113 115 else if (mode.equals("next")) { shortcut = KeyEvent.VK_9; } 116 // CHECKSTYLE.ON: LeftCurly 117 // CHECKSTYLE.ON: RightCurly 114 118 115 119 return shortcut; -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r8510 r8513 244 244 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 245 245 int numWays = 0; 246 for (OsmPrimitive osm : selection) 246 for (OsmPrimitive osm : selection) { 247 247 if (osm instanceof Way) { 248 248 numWays++; 249 249 } 250 } 250 251 setEnabled(numWays >= 2); 251 252 } -
trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
r8510 r8513 87 87 while (assign < nodesCount) { 88 88 int imax = 0; 89 for (int i = 1; i < angles.length; i++) 89 for (int i = 1; i < angles.length; i++) { 90 90 if (remainder[i] > remainder[imax]) 91 91 imax = i; 92 } 92 93 count[imax]++; 93 94 remainder[imax] = 0; -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r8443 r8513 369 369 370 370 // filter out empty key conflicts - we need second iteration 371 if (!Main.pref.getBoolean("multipoly.alltags", false)) 372 for (RelationMember m : relation.getMembers()) 373 if (m.hasRole() && "outer".equals(m.getRole()) && m.isWay()) 374 for (String key : values.keySet()) 375 if (!m.getWay().hasKey(key) && !relation.hasKey(key)) 371 if (!Main.pref.getBoolean("multipoly.alltags", false)) { 372 for (RelationMember m : relation.getMembers()) { 373 if (m.hasRole() && "outer".equals(m.getRole()) && m.isWay()) { 374 for (String key : values.keySet()) { 375 if (!m.getWay().hasKey(key) && !relation.hasKey(key)) { 376 376 conflictingKeys.add(key); 377 378 for (String key : conflictingKeys) 377 } 378 } 379 } 380 } 381 } 382 383 for (String key : conflictingKeys) { 379 384 values.remove(key); 380 381 for (String linearTag : Main.pref.getCollection("multipoly.lineartagstokeep", DEFAULT_LINEAR_TAGS)) 385 } 386 387 for (String linearTag : Main.pref.getCollection("multipoly.lineartagstokeep", DEFAULT_LINEAR_TAGS)) { 382 388 values.remove(linearTag); 389 } 383 390 384 391 if ("coastline".equals(values.get("natural"))) -
trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
r8512 r8513 239 239 } catch (NumberFormatException nfe) { 240 240 // we repaint offset numbers in any case 241 if (Main.isTraceEnabled()) { 242 Main.trace(nfe.getMessage()); 243 } 241 244 } 242 245 } -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r8510 r8513 165 165 */ 166 166 public void reverse() { 167 for (WayInPolygon way: ways) 167 for (WayInPolygon way: ways) { 168 168 way.insideToTheRight = !way.insideToTheRight; 169 } 169 170 Collections.reverse(ways); 170 171 } … … 266 267 double angle = Math.atan2(en3.getY() - en1.getY(), en3.getX() - en1.getX()) - 267 268 Math.atan2(en2.getY() - en1.getY(), en2.getX() - en1.getX()); 268 while (angle >= 2*Math.PI) 269 while (angle >= 2*Math.PI) { 269 270 angle -= 2*Math.PI; 270 while (angle < 0) 271 } 272 while (angle < 0) { 271 273 angle += 2*Math.PI; 274 } 272 275 return angle; 273 276 } … … 1070 1073 // Remove all of these way to make the next work. 1071 1074 List<WayInPolygon> cleanMultigonWays = new ArrayList<>(); 1072 for (WayInPolygon way: multigonWays) 1075 for (WayInPolygon way: multigonWays) { 1073 1076 if (way.way.getNodesCount() == 2 && way.way.isClosed()) 1074 1077 discardedWays.add(way); 1075 1078 else 1076 1079 cleanMultigonWays.add(way); 1080 } 1077 1081 1078 1082 WayTraverser traverser = new WayTraverser(cleanMultigonWays); … … 1105 1109 // Invalid ring (2 nodes) -> remove 1106 1110 traverser.removeWays(path); 1107 for (WayInPolygon way: path) 1111 for (WayInPolygon way: path) { 1108 1112 discardedResult.add(way.way); 1113 } 1109 1114 } else { 1110 1115 // Close ring -> add … … 1465 1470 for (RelationRole r : multiouters) { 1466 1471 // Add members 1467 for (RelationMember rm : r.rel.getMembers()) 1472 for (RelationMember rm : r.rel.getMembers()) { 1468 1473 if (!newRel.getMembers().contains(rm)) { 1469 1474 newRel.addMember(rm); 1470 1475 } 1476 } 1471 1477 // Add tags 1472 1478 for (String key : r.rel.keySet()) { -
trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
r8510 r8513 51 51 class OsmURLListener implements DocumentListener { 52 52 @Override 53 public void changedUpdate(DocumentEvent e) { parseURL(); } 54 55 @Override 56 public void insertUpdate(DocumentEvent e) { parseURL(); } 57 58 @Override 59 public void removeUpdate(DocumentEvent e) { parseURL(); } 53 public void changedUpdate(DocumentEvent e) { 54 parseURL(); 55 } 56 57 @Override 58 public void insertUpdate(DocumentEvent e) { 59 parseURL(); 60 } 61 62 @Override 63 public void removeUpdate(DocumentEvent e) { 64 parseURL(); 65 } 60 66 } 61 67 62 68 class OsmLonLatListener implements DocumentListener { 63 69 @Override 64 public void changedUpdate(DocumentEvent e) { updateUrl(false); } 65 66 @Override 67 public void insertUpdate(DocumentEvent e) { updateUrl(false); } 68 69 @Override 70 public void removeUpdate(DocumentEvent e) { updateUrl(false); } 70 public void changedUpdate(DocumentEvent e) { 71 updateUrl(false); 72 } 73 74 @Override 75 public void insertUpdate(DocumentEvent e) { 76 updateUrl(false); 77 } 78 79 @Override 80 public void removeUpdate(DocumentEvent e) { 81 updateUrl(false); 82 } 71 83 } 72 84 -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r8510 r8513 206 206 // to exactly one occurrence of the merged target node 207 207 newNodes.add(targetNode); 208 } else { 209 // drop the node 210 } 208 } 209 // else: drop the node 211 210 } 212 211 if (newNodes.size() < 2) { -
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r8510 r8513 72 72 double east = n.getEastNorth().east(); 73 73 double north = n.getEastNorth().north(); 74 if (east > maxEast) { maxEast = east; } 75 if (east < minEast) { minEast = east; } 76 if (north > maxNorth) { maxNorth = north; } 77 if (north < minNorth) { minNorth = north; } 74 if (east > maxEast) { 75 maxEast = east; 76 } 77 if (east < minEast) { 78 minEast = east; 79 } 80 if (north > maxNorth) { 81 maxNorth = north; 82 } 83 if (north < minNorth) { 84 minNorth = north; 85 } 78 86 } 79 87 } -
trunk/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java
r8379 r8513 84 84 return; 85 85 } catch (NumberFormatException ignore) { 86 if (Main.isTraceEnabled()) { 87 Main.trace(ignore.getMessage()); 88 } 86 89 } 87 90 -
trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java
r8338 r8513 41 41 outerNodes = new TreeSet<>(); 42 42 43 for (Way way : ways) 43 for (Way way : ways) { 44 44 addNodes(way); 45 } 45 46 } 46 47 } … … 150 151 151 152 selection = new LinkedList<>(); 152 for (OsmPrimitive primitive : currentSelection) 153 for (OsmPrimitive primitive : currentSelection) { 153 154 selection.add(primitive); 155 } 154 156 155 157 do { -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r8465 r8513 129 129 } catch (SecurityException e) { 130 130 // Ignore exception 131 if (Main.isTraceEnabled()) { 132 Main.trace(e.getMessage()); 133 } 131 134 } 132 135 List<String> commandLineArgs = Main.getCommandLineArgs(); -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r8510 r8513 411 411 List<Command> cmds = new LinkedList<>(); 412 412 Way way = null; 413 for (Way w: OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) 413 for (Way w: OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) { 414 414 if (w.isUsable() && w.getNodesCount() >= 1) { 415 415 way = w; 416 416 } 417 } 417 418 List<Node> oldNodes = way.getNodes(); 418 419 List<Node> newNodes = new ArrayList<>(oldNodes.size()); -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r8510 r8513 141 141 */ 142 142 protected boolean hasPrimitivesToDelete(Collection<OsmPrimitive> primitives) { 143 for (OsmPrimitive p: primitives) 143 for (OsmPrimitive p: primitives) { 144 144 if (p.isDeleted() && p.isModified() && !p.isNew()) 145 145 return true; 146 } 146 147 return false; 147 148 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r8510 r8513 539 539 if (way != null) { 540 540 int nodeCount = 0; 541 for (Node p : way.getNodes()) 541 for (Node p : way.getNodes()) { 542 542 if (p.equals(n0)) { 543 543 nodeCount++; 544 544 } 545 } 545 546 if (nodeCount > 1) { 546 547 way = null; -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r8444 r8513 258 258 } else if (matchesCurrentModifiers(toggleSelectedModifierCombo)) { 259 259 newCursor = ImageProvider.getCursor("normal", "parallel"); // FIXME 260 } else {260 } else if (Main.isDebugEnabled()) { 261 261 // TODO: set to a cursor indicating an error 262 Main.debug("TODO: set an error cursor"); 262 263 } 263 264 break; -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java
r8509 r8513 79 79 if (sortedNodesPath.get(i+1).getCoor().equals(n.getCoor())) { 80 80 removedNodes.add(n); 81 for (Way w : ways) 81 for (Way w : ways) { 82 82 w.removeNode(n); 83 } 83 84 continue; 84 85 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r8510 r8513 1067 1067 } catch (NumberFormatException e) { 1068 1068 // fall out 1069 if (Main.isTraceEnabled()) { 1070 Main.trace(e.getMessage()); 1071 } 1069 1072 } 1070 1073 return def; … … 1082 1085 } catch (NumberFormatException e) { 1083 1086 // fall out 1087 if (Main.isTraceEnabled()) { 1088 Main.trace(e.getMessage()); 1089 } 1084 1090 } 1085 1091 return def; … … 1095 1101 } catch (NumberFormatException e) { 1096 1102 // fall out 1103 if (Main.isTraceEnabled()) { 1104 Main.trace(e.getMessage()); 1105 } 1097 1106 } 1098 1107 return def; … … 1108 1117 } catch (NumberFormatException e) { 1109 1118 // fall out 1119 if (Main.isTraceEnabled()) { 1120 Main.trace(e.getMessage()); 1121 } 1110 1122 } 1111 1123 return def; … … 1472 1484 } catch (Exception e) { 1473 1485 // Ignore all exceptions 1486 if (Main.isTraceEnabled()) { 1487 Main.trace(e.getMessage()); 1488 } 1474 1489 } 1475 1490 // Workaround to fix a Java "feature" -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r8510 r8513 441 441 } catch (NumberFormatException e) { 442 442 // ignore malformed Cache-Control headers 443 if (Main.isTraceEnabled()) { 444 Main.trace(e.getMessage()); 445 } 443 446 } 444 447 } -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r8510 r8513 665 665 Matcher m = Pattern.compile(".*\\{PROJ\\(([^)}]+)\\)\\}.*").matcher(url.toUpperCase(Locale.ENGLISH)); 666 666 if (m.matches()) { 667 for (String p : m.group(1).split(",")) 667 for (String p : m.group(1).split(",")) { 668 668 serverProjections.add(p); 669 } 669 670 } 670 671 } catch (Exception e) { -
trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
r8415 r8513 79 79 } catch (MalformedURLException e) { 80 80 // Ignored 81 if (Main.isTraceEnabled()) { 82 Main.trace(e.getMessage()); 83 } 81 84 } 82 85 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/AllNodesVisitor.java
r7005 r8513 37 37 public void visit(Way w) { 38 38 if (w.isIncomplete()) return; 39 for (Node n : w.getNodes()) 39 for (Node n : w.getNodes()) { 40 40 visit(n); 41 } 41 42 } 42 43 … … 48 49 @Override 49 50 public void visit(Relation e) { 50 for (RelationMember m : e.getMembers()) 51 for (RelationMember m : e.getMembers()) { 51 52 if (m.isNode()) visit(m.getNode()); 53 } 52 54 } 53 55 … … 59 61 public static Collection<Node> getAllNodes(Collection<? extends OsmPrimitive> osms) { 60 62 AllNodesVisitor v = new AllNodesVisitor(); 61 for (OsmPrimitive osm : osms) 63 for (OsmPrimitive osm : osms) { 62 64 osm.accept(v); 65 } 63 66 return v.nodes; 64 67 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
r8395 r8513 144 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 145 // and report changes in a more controlled manner. 146 if (Main.isTraceEnabled()) { 147 Main.trace(e.getMessage()); 148 } 146 149 } 147 150 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r8510 r8513 214 214 List<RelationMember> rMembers = r.getMembers(); 215 215 Map<String, String> rkeys = r.getKeys(); 216 for (String key : ignoreKeys) 216 for (String key : ignoreKeys) { 217 217 rkeys.remove(key); 218 } 218 219 RelationPair rKey = new RelationPair(rMembers, rkeys); 219 220 relations.put(rKey, r); … … 231 232 Set<Relation> relFix = new HashSet<>(); 232 233 233 for (OsmPrimitive osm : sel) 234 for (OsmPrimitive osm : sel) { 234 235 if (osm instanceof Relation && !osm.isDeleted()) { 235 236 relFix.add((Relation) osm); 236 237 } 238 } 237 239 238 240 if (relFix.size() < 2) … … 294 296 Set<Relation> relations = new HashSet<>(); 295 297 296 for (OsmPrimitive osm : sel) 298 for (OsmPrimitive osm : sel) { 297 299 if (osm instanceof Relation) { 298 300 relations.add((Relation) osm); 299 301 } 302 } 300 303 301 304 if (relations.size() < 2) -
trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java
r8510 r8513 384 384 if (mapNameToValue == null) { 385 385 mapNameToValue = new HashMap<>(); 386 for (String[] pair : ARRAY) 386 for (String[] pair : ARRAY) { 387 387 mapNameToValue.put(pair[0], pair[1]); 388 } 388 389 } 389 390 String value = mapNameToValue.get(entityContent); -
trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
r8509 r8513 202 202 if (userName != null && !userName.equals(this.userName)) { 203 203 setPartiallyIdentified(userName); 204 } else { 205 // same name in the preferences as JOSM already knows about. 206 // keep the state, be it partially or fully identified 207 } 204 } 205 // else: same name in the preferences as JOSM already knows about. 206 // keep the state, be it partially or fully identified 208 207 } 209 208 } -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r8510 r8513 727 727 } catch (SecurityException e) { 728 728 // Don't care, awtListener probably wasn't registered anyway 729 if (Main.isTraceEnabled()) { 730 Main.trace(e.getMessage()); 731 } 729 732 } 730 733 mv.removeMouseMotionListener(mouseMotionListener); -
trunk/src/org/openstreetmap/josm/gui/SplashScreen.java
r8511 r8513 361 361 } catch (NullPointerException ignore) { 362 362 // NullPointerException at javax.swing.text.html.StyleSheet$ListPainter.paint 363 if (Main.isTraceEnabled()) { 364 Main.trace(ignore.getMessage()); 365 } 363 366 } 364 367 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/MergedTableCellRenderer.java
r8510 r8513 57 57 setText(item.getTheirTagValue()); 58 58 setToolTipText(item.getTheirTagValue()); 59 } else {60 // should not happen61 59 } 62 60 } 63 61 } 64 65 62 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItem.java
r8291 r8513 109 109 primitive.put(key, myTagValue); 110 110 } 111 } else {112 // should not happen113 111 } 114 112 } -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
r8510 r8513 267 267 // (only if both primitives are tagged) 268 268 decision.keepOne(values.get(0)); 269 } else { 270 // Do not suggest to keep all values in order to reduce the wrong usage of semicolon values, see #9104! 271 } 269 } 270 // else: Do not suggest to keep all values in order to reduce the wrong usage of semicolon values, see #9104! 272 271 } 273 272 rebuild(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
r8510 r8513 1095 1095 } catch (ParseException e) { 1096 1096 // Try next format 1097 if (Main.isTraceEnabled()) { 1098 Main.trace(e.getMessage()); 1099 } 1097 1100 } 1098 1101 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r8510 r8513 842 842 } catch (AddAbortException ex) { 843 843 // do nothing 844 if (Main.isTraceEnabled()) { 845 Main.trace(ex.getMessage()); 846 } 844 847 } 845 848 } … … 869 872 } catch (AddAbortException ex) { 870 873 // do nothing 874 if (Main.isTraceEnabled()) { 875 Main.trace(ex.getMessage()); 876 } 871 877 } 872 878 } … … 879 885 880 886 class AddSelectedBeforeSelection extends AddFromSelectionAction implements TableModelListener, ListSelectionListener { 887 /** 888 * Constructs a new {@code AddSelectedBeforeSelection}. 889 */ 881 890 public AddSelectedBeforeSelection() { 882 891 putValue(SHORT_DESCRIPTION, … … 899 908 } catch (AddAbortException ex) { 900 909 // do nothing 901 } 902 910 if (Main.isTraceEnabled()) { 911 Main.trace(ex.getMessage()); 912 } 913 } 903 914 } 904 915 … … 935 946 } catch (AddAbortException ex) { 936 947 // do nothing 948 if (Main.isTraceEnabled()) { 949 Main.trace(ex.getMessage()); 950 } 937 951 } 938 952 } … … 950 964 951 965 class RemoveSelectedAction extends AbstractAction implements TableModelListener { 966 /** 967 * Constructs a new {@code RemoveSelectedAction}. 968 */ 952 969 public RemoveSelectedAction() { 953 970 putValue(SHORT_DESCRIPTION, tr("Remove all members referring to one of the selected objects")); … … 1777 1794 } catch (AddAbortException ex) { 1778 1795 // Do nothing 1796 if (Main.isTraceEnabled()) { 1797 Main.trace(ex.getMessage()); 1798 } 1779 1799 } 1780 1800 } -
trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java
r8510 r8513 10 10 import java.nio.charset.StandardCharsets; 11 11 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.tools.Utils; 13 14 import org.openstreetmap.josm.tools.WikiReader; … … 62 63 } catch (IOException e1) { 63 64 // ignore 65 if (Main.isTraceEnabled()) { 66 Main.trace(e1.getMessage()); 67 } 64 68 } 65 69 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
r8510 r8513 315 315 } catch (NumberFormatException e) { 316 316 // don't save invalid value to preferences 317 if (Main.isTraceEnabled()) { 318 Main.trace(e.getMessage()); 319 } 317 320 } 318 321 } -
trunk/src/org/openstreetmap/josm/gui/layer/CustomizeColor.java
r8510 r8513 78 78 switch (answer) { 79 79 case 0: 80 for (Layer layer : layers) 80 for (Layer layer : layers) { 81 81 Main.pref.putColor("layer "+layer.getName(), c.getColor()); 82 } 82 83 break; 83 84 case 1: 84 85 return; 85 86 case 2: 86 for (Layer layer : layers) 87 for (Layer layer : layers) { 87 88 Main.pref.putColor("layer "+layer.getName(), null); 89 } 88 90 break; 89 91 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r8510 r8513 932 932 private boolean isDataSetEmpty() { 933 933 if (data != null) { 934 for (OsmPrimitive osm : data.allNonDeletedPrimitives()) 934 for (OsmPrimitive osm : data.allNonDeletedPrimitives()) { 935 935 if (!osm.isDeleted() || !osm.isNewOrUndeleted()) 936 936 return false; 937 } 937 938 } 938 939 return true; -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r8512 r8513 155 155 } catch (IOException e) { 156 156 // silence exceptions 157 if (Main.isTraceEnabled()) { 158 Main.trace(e.getMessage()); 159 } 157 160 } 158 161 -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r8510 r8513 490 490 public void visitBoundingBox(BoundingXYVisitor v) { 491 491 for (int x = 0; x < dax; ++x) { 492 for (int y = 0; y < day; ++y) 492 for (int y = 0; y < day; ++y) { 493 493 if (images[x][y].getImage() != null) { 494 494 v.visit(images[x][y].getMin()); 495 495 v.visit(images[x][y].getMax()); 496 496 } 497 } 497 498 } 498 499 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarker.java
r8126 r8513 67 67 * 68 68 */ 69 public void play() { play(0.0); } 69 public void play() { 70 play(0.0); 71 } 70 72 71 73 public void adjustOffset(double adjustment) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r8509 r8513 127 127 rotationAngle = RotationAngle.buildStaticRotation(rotationKW.val); 128 128 } catch (IllegalArgumentException ignore) { 129 if (Main.isTraceEnabled()) { 130 Main.trace(ignore.getMessage()); 131 } 129 132 } 130 133 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/AreaPrototype.java
r8419 r8513 18 18 } 19 19 20 public AreaPrototype() { init(); } 20 public AreaPrototype() { 21 init(); 22 } 21 23 22 24 public final void init() { -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/IconPrototype.java
r8419 r8513 18 18 } 19 19 20 public IconPrototype() { init(); } 20 /** 21 * Constructs a new {@code IconPrototype}. 22 */ 23 public IconPrototype() { 24 init(); 25 } 21 26 22 27 public final void init() { -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinePrototype.java
r8395 r8513 30 30 } 31 31 32 public LinePrototype() { init(); } 32 /** 33 * Constructs a new {@code LinePrototype}. 34 */ 35 public LinePrototype() { 36 init(); 37 } 33 38 34 39 public void init() { -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinemodPrototype.java
r8510 r8513 17 17 } 18 18 19 public LinemodPrototype() { init(); } 19 /** 20 * Constructs a new {@code LinemodPrototype}. 21 */ 22 public LinemodPrototype() { 23 init(); 24 } 20 25 21 26 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r8510 r8513 1371 1371 } catch (NumberFormatException e) { 1372 1372 // ignore 1373 if (Main.isTraceEnabled()) { 1374 Main.trace(e.getMessage()); 1375 } 1373 1376 } 1374 1377 } -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java
r8512 r8513 54 54 protected final void registerValidableComponent(AbstractButton component) { 55 55 component.addChangeListener(new ChangeListener() { 56 @Override public void stateChanged(ChangeEvent e) { notifyListeners(); } 56 @Override 57 public void stateChanged(ChangeEvent e) { 58 notifyListeners(); 59 } 57 60 }); 58 61 } -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r8510 r8513 72 72 } catch (SAXException e) { 73 73 // We will handle this in step with validation 74 if (Main.isTraceEnabled()) { 75 Main.trace(e.getMessage()); 76 } 74 77 } 75 78 -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
r8510 r8513 196 196 } catch (NumberFormatException e) { 197 197 // ignore - load from preference pluginmanager.time-based-update.interval 198 if (Main.isTraceEnabled()) { 199 Main.trace(e.getMessage()); 200 } 198 201 } 199 202 if (days <= 0) { -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMFranceDOMProjectionChoice.java
r8510 r8513 68 68 @Override 69 69 public Collection<String> getPreferencesFromCode(String code) { 70 for (int i = 0; i < utmEPSGs.length; i++) 70 for (int i = 0; i < utmEPSGs.length; i++) { 71 71 if (("EPSG:" + utmEPSGs[i]).equals(code)) 72 72 return Collections.singleton(Integer.toString(i+1)); 73 } 73 74 return null; 74 75 } 75 76 76 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r8510 r8513 657 657 } catch (NumberFormatException ex) { 658 658 // Ignore - cannot auto-increment if last was non-numeric 659 if (Main.isTraceEnabled()) { 660 Main.trace(ex.getMessage()); 661 } 659 662 } 660 663 } else if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) { … … 890 893 if (def && !PROP_FILL_DEFAULT.get()) { 891 894 // default is set and filling default values feature is disabled - check if all primitives are untagged 892 for (OsmPrimitive s : sel) 895 for (OsmPrimitive s : sel) { 893 896 if (s.hasKeys()) { 894 897 def = false; 895 898 } 899 } 896 900 } 897 901 -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java
r8510 r8513 221 221 edSearchText = new JosmTextField(); 222 222 edSearchText.getDocument().addDocumentListener(new DocumentListener() { 223 @Override public void removeUpdate(DocumentEvent e) { filterPresets(); } 224 225 @Override public void insertUpdate(DocumentEvent e) { filterPresets(); } 226 227 @Override public void changedUpdate(DocumentEvent e) { filterPresets(); } 223 @Override 224 public void removeUpdate(DocumentEvent e) { 225 filterPresets(); 226 } 227 228 @Override 229 public void insertUpdate(DocumentEvent e) { 230 filterPresets(); 231 } 232 233 @Override 234 public void changedUpdate(DocumentEvent e) { 235 filterPresets(); 236 } 228 237 }); 229 238 edSearchText.addKeyListener(new KeyAdapter() { -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
r8510 r8513 91 91 } catch (NumberFormatException e) { 92 92 // either the new text or the current text isn't a number. We continue with autocompletion 93 if (Main.isTraceEnabled()) { 94 Main.trace(e.getMessage()); 95 } 93 96 } 94 97 } -
trunk/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java
r8510 r8513 206 206 class OsmUrlRefresher implements DocumentListener { 207 207 @Override 208 public void changedUpdate(DocumentEvent e) { parseURL(); } 209 210 @Override 211 public void insertUpdate(DocumentEvent e) { parseURL(); } 212 213 @Override 214 public void removeUpdate(DocumentEvent e) { parseURL(); } 208 public void changedUpdate(DocumentEvent e) { 209 parseURL(); 210 } 211 212 @Override 213 public void insertUpdate(DocumentEvent e) { 214 parseURL(); 215 } 216 217 @Override 218 public void removeUpdate(DocumentEvent e) { 219 parseURL(); 220 } 215 221 } 216 222 } -
trunk/src/org/openstreetmap/josm/gui/widgets/ChangesetIdTextField.java
r8510 r8513 5 5 6 6 import javax.swing.text.JTextComponent; 7 8 import org.openstreetmap.josm.Main; 7 9 8 10 /** … … 26 28 return validator.id; 27 29 } 28 30 29 31 /** 30 32 * Reads the changeset id. … … 36 38 return validator.readChangesetId(); 37 39 } 38 40 39 41 /** 40 42 * Validator for a changeset ID entered in a {@link JTextComponent}. 41 43 */ 42 44 public static class ChangesetIdValidator extends AbstractTextComponentValidator { 43 45 44 46 private int id = 0; 45 47 … … 65 67 } 66 68 } 67 69 68 70 /** 69 71 * Reads the changeset id. … … 82 84 } catch (NumberFormatException e) { 83 85 // Ignored 86 if (Main.isTraceEnabled()) { 87 Main.trace(e.getMessage()); 88 } 84 89 } 85 90 } -
trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuLauncher.java
r8510 r8513 53 53 54 54 @Override 55 public void mousePressed(MouseEvent e) { processEvent(e); } 55 public void mousePressed(MouseEvent e) { 56 processEvent(e); 57 } 56 58 57 59 @Override 58 public void mouseReleased(MouseEvent e) { processEvent(e); } 60 public void mouseReleased(MouseEvent e) { 61 processEvent(e); 62 } 59 63 60 64 private void processEvent(MouseEvent e) { -
trunk/src/org/openstreetmap/josm/gui/widgets/QuadStateCheckBox.java
r8510 r8513 182 182 } 183 183 } 184 /** Filter: No one may change the armed/selected/pressed status except us. */ 185 @Override public void setArmed(boolean b) { } 186 187 @Override public void setSelected(boolean b) { } 188 189 @Override public void setPressed(boolean b) { } 184 185 // ---------------------------------------------------------------------- 186 // Filter: No one may change the armed/selected/pressed status except us. 187 // ---------------------------------------------------------------------- 188 189 @Override 190 public void setArmed(boolean b) { } 191 192 @Override 193 public void setSelected(boolean b) { } 194 195 @Override 196 public void setPressed(boolean b) { } 190 197 191 198 /** We disable focusing on the component when it is not enabled. */ 192 @Override public void setEnabled(boolean b) { 199 @Override 200 public void setEnabled(boolean b) { 193 201 setFocusable(b); 194 202 other.setEnabled(b); 195 203 } 196 /** All these methods simply delegate to the "other" model 197 * that is being decorated. */ 198 @Override public boolean isArmed() { return other.isArmed(); } 199 200 @Override public boolean isSelected() { return other.isSelected(); } 201 202 @Override public boolean isEnabled() { return other.isEnabled(); } 203 204 @Override public boolean isPressed() { return other.isPressed(); } 205 206 @Override public boolean isRollover() { return other.isRollover(); } 207 208 @Override public void setRollover(boolean b) { other.setRollover(b); } 209 210 @Override public void setMnemonic(int key) { other.setMnemonic(key); } 211 212 @Override public int getMnemonic() { return other.getMnemonic(); } 213 214 @Override public void setActionCommand(String s) { 204 205 // ------------------------------------------------------------------------------- 206 // All these methods simply delegate to the "other" model that is being decorated. 207 // ------------------------------------------------------------------------------- 208 209 @Override 210 public boolean isArmed() { 211 return other.isArmed(); 212 } 213 214 @Override 215 public boolean isSelected() { 216 return other.isSelected(); 217 } 218 219 @Override 220 public boolean isEnabled() { 221 return other.isEnabled(); 222 } 223 224 @Override 225 public boolean isPressed() { 226 return other.isPressed(); 227 } 228 229 @Override 230 public boolean isRollover() { 231 return other.isRollover(); 232 } 233 234 @Override 235 public void setRollover(boolean b) { 236 other.setRollover(b); 237 } 238 239 @Override 240 public void setMnemonic(int key) { 241 other.setMnemonic(key); 242 } 243 244 @Override 245 public int getMnemonic() { 246 return other.getMnemonic(); 247 } 248 249 @Override 250 public void setActionCommand(String s) { 215 251 other.setActionCommand(s); 216 252 } -
trunk/src/org/openstreetmap/josm/io/OsmApiException.java
r8510 r8513 2 2 package org.openstreetmap.josm.io; 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 5 import org.openstreetmap.josm.Main; 4 6 5 7 /** … … 144 146 } catch (Exception e) { 145 147 // Ignored 148 if (Main.isTraceEnabled()) { 149 Main.trace(e.getMessage()); 150 } 146 151 } 147 152 try { … … 154 159 } catch (Exception e) { 155 160 // Ignored 161 if (Main.isTraceEnabled()) { 162 Main.trace(e.getMessage()); 163 } 156 164 } 157 165 return sb.toString(); -
trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java
r8510 r8513 10 10 import java.util.List; 11 11 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.data.coor.LatLon; 13 14 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 87 88 // TODO: handle thumbnail loading 88 89 } catch (NumberFormatException e) { 89 // nothing 90 // do nothing 91 if (Main.isTraceEnabled()) { 92 Main.trace(e.getMessage()); 93 } 90 94 } 91 95 } -
trunk/src/org/openstreetmap/josm/plugins/Plugin.java
r8510 r8513 93 93 * if any available. 94 94 */ 95 public PreferenceSetting getPreferenceSetting() { return null; } 95 public PreferenceSetting getPreferenceSetting() { 96 return null; 97 } 96 98 97 99 /** -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r8510 r8513 1124 1124 */ 1125 1125 public static Object getPlugin(String name) { 1126 for (PluginProxy plugin : pluginList) 1126 for (PluginProxy plugin : pluginList) { 1127 1127 if (plugin.getPluginInformation().name.equals(name)) 1128 1128 return plugin.plugin; 1129 } 1129 1130 return null; 1130 1131 } -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r8512 r8513 267 267 int k; 268 268 269 for (k = 1; xvec[x - k] == yvec[y - k]; k++) 269 for (k = 1; xvec[x - k] == yvec[y - k]; k++) { 270 270 if (k == SNAKE_LIMIT) { 271 271 best = v; … … 273 273 break; 274 274 } 275 } 275 276 } 276 277 } … … 295 296 int k; 296 297 297 for (k = 0; xvec[x + k] == yvec[y + k]; k++) 298 for (k = 0; xvec[x + k] == yvec[y + k]; k++) { 298 299 if (k == SNAKE_LIMIT) { 299 300 best = v; … … 301 302 break; 302 303 } 304 } 303 305 } 304 306 } … … 723 725 /* Cancel any subrun of MINIMUM or more provisionals 724 726 within the larger run. */ 725 for (j = 0, consec = 0; j < length; j++) 727 for (j = 0, consec = 0; j < length; j++) { 726 728 if (discards[i + j] != 2) { 727 729 consec = 0; … … 732 734 discards[i + j] = 0; 733 735 } 736 } 734 737 735 738 /* Scan from beginning of run … … 783 786 final int end = bufferedLines; 784 787 int j = 0; 785 for (int i = 0; i < end; ++i) 788 for (int i = 0; i < end; ++i) { 786 789 if (noDiscards || discards[i] == 0) { 787 790 undiscarded[j] = equivs[i]; … … 790 793 changedFlag[1+i] = true; 791 794 } 795 } 792 796 nondiscardedLines = j; 793 797 } -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r8510 r8513 442 442 } catch (MalformedURLException ex) { 443 443 // shouldn't happen 444 if (Main.isTraceEnabled()) { 445 Main.trace(e.getMessage()); 446 } 444 447 } 445 448 … … 602 605 } catch (MalformedURLException ex) { 603 606 // shouldn't happen 607 if (Main.isTraceEnabled()) { 608 Main.trace(e.getMessage()); 609 } 604 610 } 605 611 -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r8510 r8513 482 482 } catch (IOException e) { 483 483 // Ignore 484 if (Main.isTraceEnabled()) { 485 Main.trace(e.getMessage()); 486 } 484 487 } 485 488 } … … 511 514 } catch (IOException e) { 512 515 // Ignore exception 516 if (Main.isTraceEnabled()) { 517 Main.trace(e.getMessage()); 518 } 513 519 } 514 520 return false; -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r8510 r8513 131 131 public void initSystemShortcuts() { 132 132 // TODO: Insert system shortcuts here. See Windows and especially OSX to see how to. 133 for (int i = KeyEvent.VK_F1; i <= KeyEvent.VK_F12; ++i) 133 for (int i = KeyEvent.VK_F1; i <= KeyEvent.VK_F12; ++i) { 134 134 Shortcut.registerSystemShortcut("screen:toogle"+i, tr("reserved"), 135 135 i, KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK).setAutomatic(); 136 } 136 137 Shortcut.registerSystemShortcut("system:reset", tr("reserved"), 137 138 KeyEvent.VK_DELETE, KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK).setAutomatic(); … … 374 375 } catch (IOException e) { 375 376 // Ignore 377 if (Main.isTraceEnabled()) { 378 Main.trace(e.getMessage()); 379 } 376 380 } 377 381 } -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r8510 r8513 62 62 while (true) { 63 63 skipEmpty(); 64 if (pos == n) { break; } 64 if (pos == n) { 65 break; 66 } 65 67 k = parseString("\n\r\t= "); 66 if (pos == n) { tags.clear(); break; } 68 if (pos == n) { 69 tags.clear(); 70 break; 71 } 67 72 skipSign(); 68 if (pos == n) { tags.clear(); break; } 73 if (pos == n) { 74 tags.clear(); 75 break; 76 } 69 77 v = parseString("\n\r\t "); 70 78 tags.put(k, v); -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r8512 r8513 1301 1301 public static boolean hasExtension(String filename, String ... extensions) { 1302 1302 String name = filename.toLowerCase(Locale.ENGLISH); 1303 for (String ext : extensions) 1303 for (String ext : extensions) { 1304 1304 if (name.endsWith("."+ext.toLowerCase(Locale.ENGLISH))) 1305 1305 return true; 1306 } 1306 1307 return false; 1307 1308 } -
trunk/src/org/openstreetmap/josm/tools/date/FallbackDateParser.java
r7299 r8513 8 8 import java.util.Date; 9 9 import java.util.List; 10 11 import org.openstreetmap.josm.Main; 10 12 11 13 /** … … 101 103 } catch (ParseException pe) { 102 104 // Ignore parsing errors and try the next pattern. 105 if (Main.isTraceEnabled()) { 106 Main.trace(pe.getMessage()); 107 } 103 108 } 104 109 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java
r8510 r8513 10 10 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 13 14 import org.openstreetmap.josm.data.osm.User; … … 73 74 } catch (IndexOutOfBoundsException e) { 74 75 // OK 76 if (Main.isTraceEnabled()) { 77 Main.trace(e.getMessage()); 78 } 75 79 } 76 80 -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r8510 r8513 79 79 @Test 80 80 public void a_latlon2eastNorth_test() { 81 { 82 LatLon ll = new LatLon(46.518, 6.567); 83 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 84 if (debug) { 85 System.out.println(en); 86 } 87 assertTrue("Lausanne", Math.abs(en.east() - 533111.69) < 0.1); 88 assertTrue("Lausanne", Math.abs(en.north() - 152227.85) < 0.1); 89 } 90 91 { 92 LatLon ll = new LatLon(47.78, 8.58); 93 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 94 if (debug) { 95 System.out.println(en); 96 } 97 assertTrue("Schafouse", Math.abs(en.east() - 685544.16) < 0.1); 98 assertTrue("Schafouse", Math.abs(en.north() - 292782.91) < 0.1); 99 } 100 101 { 102 LatLon ll = new LatLon(46.58, 10.48); 103 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 104 if (debug) { 105 System.out.println(en); 106 } 107 assertTrue("Grinson", Math.abs(en.east() - 833068.04) < 0.1); 108 assertTrue("Grinson", Math.abs(en.north() - 163265.39) < 0.1); 109 } 110 111 { 112 LatLon ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600); 113 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 114 if (debug) { 115 System.out.println(en); 116 } 117 assertTrue("Berne", Math.abs(en.east() - 600000.0) < 0.1); 118 assertTrue("Berne", Math.abs(en.north() - 200000.0) < 0.1); 119 } 120 { 121 LatLon ll = new LatLon(46.0 + 2.0 / 60 + 38.87 / 3600, 8.0 + 43.0 / 60 + 49.79 / 3600); 122 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 123 if (debug) { 124 System.out.println(en); 125 } 126 assertTrue("Ref", Math.abs(en.east() - 700000.0) < 0.1); 127 assertTrue("Ref", Math.abs(en.north() - 100000.0) < 0.1); 128 } 81 LatLon ll = new LatLon(46.518, 6.567); 82 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 83 if (debug) { 84 System.out.println(en); 85 } 86 assertTrue("Lausanne", Math.abs(en.east() - 533111.69) < 0.1); 87 assertTrue("Lausanne", Math.abs(en.north() - 152227.85) < 0.1); 88 89 ll = new LatLon(47.78, 8.58); 90 en = Main.getProjection().latlon2eastNorth(ll); 91 if (debug) { 92 System.out.println(en); 93 } 94 assertTrue("Schafouse", Math.abs(en.east() - 685544.16) < 0.1); 95 assertTrue("Schafouse", Math.abs(en.north() - 292782.91) < 0.1); 96 97 ll = new LatLon(46.58, 10.48); 98 en = Main.getProjection().latlon2eastNorth(ll); 99 if (debug) { 100 System.out.println(en); 101 } 102 assertTrue("Grinson", Math.abs(en.east() - 833068.04) < 0.1); 103 assertTrue("Grinson", Math.abs(en.north() - 163265.39) < 0.1); 104 105 ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600); 106 en = Main.getProjection().latlon2eastNorth(ll); 107 if (debug) { 108 System.out.println(en); 109 } 110 assertTrue("Berne", Math.abs(en.east() - 600000.0) < 0.1); 111 assertTrue("Berne", Math.abs(en.north() - 200000.0) < 0.1); 112 113 ll = new LatLon(46.0 + 2.0 / 60 + 38.87 / 3600, 8.0 + 43.0 / 60 + 49.79 / 3600); 114 en = Main.getProjection().latlon2eastNorth(ll); 115 if (debug) { 116 System.out.println(en); 117 } 118 assertTrue("Ref", Math.abs(en.east() - 700000.0) < 0.1); 119 assertTrue("Ref", Math.abs(en.north() - 100000.0) < 0.1); 129 120 } 130 121 131 122 @Test 132 123 public void b_eastNorth2latlon_test() { 133 { 134 EastNorth en = new EastNorth(533111.69, 152227.85); 135 LatLon ll = Main.getProjection().eastNorth2latlon(en); 136 if (debug) { 137 System.out.println(ll); 138 } 139 assertTrue("Lausanne", Math.abs(ll.lat() - 46.518) < 0.00001); 140 assertTrue("Lausanne", Math.abs(ll.lon() - 6.567) < 0.00001); 141 } 142 143 { 144 EastNorth en = new EastNorth(685544.16, 292782.91); 145 LatLon ll = Main.getProjection().eastNorth2latlon(en); 146 if (debug) { 147 System.out.println(ll); 148 } 149 assertTrue("Schafouse", Math.abs(ll.lat() - 47.78) < 0.00001); 150 assertTrue("Schafouse", Math.abs(ll.lon() - 8.58) < 0.00001); 151 } 152 153 { 154 EastNorth en = new EastNorth(833068.04, 163265.39); 155 LatLon ll = Main.getProjection().eastNorth2latlon(en); 156 if (debug) { 157 System.out.println(ll); 158 } 159 assertTrue("Grinson", Math.abs(ll.lat() - 46.58) < 0.00001); 160 assertTrue("Grinson", Math.abs(ll.lon() - 10.48) < 0.00001); 161 } 162 163 { 164 EastNorth en = new EastNorth(600000.0, 200000.0); 165 LatLon ll = Main.getProjection().eastNorth2latlon(en); 166 if (debug) { 167 System.out.println(ll); 168 } 169 assertTrue("Berne", Math.abs(ll.lat() - (46.0 + 57.0 / 60 + 3.89813884505 / 3600)) < 0.00001); 170 assertTrue("Berne", Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001); 171 } 172 173 { 174 EastNorth en = new EastNorth(700000.0, 100000.0); 175 LatLon ll = Main.getProjection().eastNorth2latlon(en); 176 if (debug) { 177 System.out.println(ll); 178 } 179 assertTrue("Ref", Math.abs(ll.lat() - (46.0 + 2.0 / 60 + 38.87 / 3600)) < 0.00001); 180 assertTrue("Ref", Math.abs(ll.lon() - (8.0 + 43.0 / 60 + 49.79 / 3600)) < 0.00001); 181 } 182 } 183 124 EastNorth en = new EastNorth(533111.69, 152227.85); 125 LatLon ll = Main.getProjection().eastNorth2latlon(en); 126 if (debug) { 127 System.out.println(ll); 128 } 129 assertTrue("Lausanne", Math.abs(ll.lat() - 46.518) < 0.00001); 130 assertTrue("Lausanne", Math.abs(ll.lon() - 6.567) < 0.00001); 131 132 en = new EastNorth(685544.16, 292782.91); 133 ll = Main.getProjection().eastNorth2latlon(en); 134 if (debug) { 135 System.out.println(ll); 136 } 137 assertTrue("Schafouse", Math.abs(ll.lat() - 47.78) < 0.00001); 138 assertTrue("Schafouse", Math.abs(ll.lon() - 8.58) < 0.00001); 139 140 en = new EastNorth(833068.04, 163265.39); 141 ll = Main.getProjection().eastNorth2latlon(en); 142 if (debug) { 143 System.out.println(ll); 144 } 145 assertTrue("Grinson", Math.abs(ll.lat() - 46.58) < 0.00001); 146 assertTrue("Grinson", Math.abs(ll.lon() - 10.48) < 0.00001); 147 148 en = new EastNorth(600000.0, 200000.0); 149 ll = Main.getProjection().eastNorth2latlon(en); 150 if (debug) { 151 System.out.println(ll); 152 } 153 assertTrue("Berne", Math.abs(ll.lat() - (46.0 + 57.0 / 60 + 3.89813884505 / 3600)) < 0.00001); 154 assertTrue("Berne", Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001); 155 156 en = new EastNorth(700000.0, 100000.0); 157 ll = Main.getProjection().eastNorth2latlon(en); 158 if (debug) { 159 System.out.println(ll); 160 } 161 assertTrue("Ref", Math.abs(ll.lat() - (46.0 + 2.0 / 60 + 38.87 / 3600)) < 0.00001); 162 assertTrue("Ref", Math.abs(ll.lon() - (8.0 + 43.0 / 60 + 49.79 / 3600)) < 0.00001); 163 } 184 164 185 165 /** … … 188 168 @Test 189 169 public void c_sendandreturn_test() { 190 { 191 EastNorth en = new EastNorth(533111.69, 152227.85); 192 LatLon ll = Main.getProjection().eastNorth2latlon(en); 193 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 194 if (debug) { 195 System.out.println(en.east() - en2.east()); 196 } 197 if (debug) { 198 System.out.println(en.north() - en2.north()); 199 } 200 assertTrue("Lausanne", Math.abs(en.east() - en2.east()) < 0.002); 201 assertTrue("Lausanne", Math.abs(en.north() - en2.north()) < 0.002); 202 } 203 204 { 205 EastNorth en = new EastNorth(685544.16, 292782.91); 206 LatLon ll = Main.getProjection().eastNorth2latlon(en); 207 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 208 if (debug) { 209 System.out.println(en.east() - en2.east()); 210 } 211 if (debug) { 212 System.out.println(en.north() - en2.north()); 213 } 214 assertTrue("Schafouse", Math.abs(en.east() - en2.east()) < 0.002); 215 assertTrue("Schafouse", Math.abs(en.north() - en2.north()) < 0.002); 216 } 217 218 { 219 EastNorth en = new EastNorth(833068.04, 163265.39); 220 LatLon ll = Main.getProjection().eastNorth2latlon(en); 221 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 222 if (debug) { 223 System.out.println(en.east() - en2.east()); 224 } 225 if (debug) { 226 System.out.println(en.north() - en2.north()); 227 } 228 assertTrue("Grinson", Math.abs(en.east() - en2.east()) < 0.002); 229 assertTrue("Grinson", Math.abs(en.north() - en2.north()) < 0.002); 230 } 231 232 { 233 EastNorth en = new EastNorth(600000.0, 200000.0); 234 LatLon ll = Main.getProjection().eastNorth2latlon(en); 235 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 236 if (debug) { 237 System.out.println(en.east() - en2.east()); 238 } 239 if (debug) { 240 System.out.println(en.north() - en2.north()); 241 } 242 assertTrue("Berne", Math.abs(en.east() - en2.east()) < 0.002); 243 assertTrue("Berne", Math.abs(en.north() - en2.north()) < 0.002); 244 } 245 246 { 247 EastNorth en = new EastNorth(700000.0, 100000.0); 248 LatLon ll = Main.getProjection().eastNorth2latlon(en); 249 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 250 if (debug) { 251 System.out.println(en.east() - en2.east()); 252 } 253 if (debug) { 254 System.out.println(en.north() - en2.north()); 255 } 256 assertTrue("Ref", Math.abs(en.east() - en2.east()) < 0.002); 257 assertTrue("Ref", Math.abs(en.north() - en2.north()) < 0.002); 258 } 170 EastNorth en = new EastNorth(533111.69, 152227.85); 171 LatLon ll = Main.getProjection().eastNorth2latlon(en); 172 EastNorth en2 = Main.getProjection().latlon2eastNorth(ll); 173 if (debug) { 174 System.out.println(en.east() - en2.east()); 175 } 176 if (debug) { 177 System.out.println(en.north() - en2.north()); 178 } 179 assertTrue("Lausanne", Math.abs(en.east() - en2.east()) < 0.002); 180 assertTrue("Lausanne", Math.abs(en.north() - en2.north()) < 0.002); 181 182 en = new EastNorth(685544.16, 292782.91); 183 ll = Main.getProjection().eastNorth2latlon(en); 184 en2 = Main.getProjection().latlon2eastNorth(ll); 185 if (debug) { 186 System.out.println(en.east() - en2.east()); 187 } 188 if (debug) { 189 System.out.println(en.north() - en2.north()); 190 } 191 assertTrue("Schafouse", Math.abs(en.east() - en2.east()) < 0.002); 192 assertTrue("Schafouse", Math.abs(en.north() - en2.north()) < 0.002); 193 194 en = new EastNorth(833068.04, 163265.39); 195 ll = Main.getProjection().eastNorth2latlon(en); 196 en2 = Main.getProjection().latlon2eastNorth(ll); 197 if (debug) { 198 System.out.println(en.east() - en2.east()); 199 } 200 if (debug) { 201 System.out.println(en.north() - en2.north()); 202 } 203 assertTrue("Grinson", Math.abs(en.east() - en2.east()) < 0.002); 204 assertTrue("Grinson", Math.abs(en.north() - en2.north()) < 0.002); 205 206 en = new EastNorth(600000.0, 200000.0); 207 ll = Main.getProjection().eastNorth2latlon(en); 208 en2 = Main.getProjection().latlon2eastNorth(ll); 209 if (debug) { 210 System.out.println(en.east() - en2.east()); 211 } 212 if (debug) { 213 System.out.println(en.north() - en2.north()); 214 } 215 assertTrue("Berne", Math.abs(en.east() - en2.east()) < 0.002); 216 assertTrue("Berne", Math.abs(en.north() - en2.north()) < 0.002); 217 218 en = new EastNorth(700000.0, 100000.0); 219 ll = Main.getProjection().eastNorth2latlon(en); 220 en2 = Main.getProjection().latlon2eastNorth(ll); 221 if (debug) { 222 System.out.println(en.east() - en2.east()); 223 } 224 if (debug) { 225 System.out.println(en.north() - en2.north()); 226 } 227 assertTrue("Ref", Math.abs(en.east() - en2.east()) < 0.002); 228 assertTrue("Ref", Math.abs(en.north() - en2.north()) < 0.002); 259 229 } 260 230 } -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java
r8510 r8513 21 21 import org.junit.Test; 22 22 import org.openstreetmap.josm.JOSMFixture; 23 import org.openstreetmap.josm.Main; 23 24 import org.openstreetmap.josm.data.osm.DatasetFactory; 24 25 import org.openstreetmap.josm.data.osm.Node; … … 357 358 } catch (IllegalArgumentException e) { 358 359 // OK 360 if (Main.isTraceEnabled()) { 361 Main.trace(e.getMessage()); 362 } 359 363 } 360 364 … … 364 368 } catch (IllegalArgumentException e) { 365 369 // OK 370 if (Main.isTraceEnabled()) { 371 Main.trace(e.getMessage()); 372 } 366 373 } 367 374 } -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeItemTest.java
r8510 r8513 9 9 import org.junit.Test; 10 10 import org.openstreetmap.josm.JOSMFixture; 11 import org.openstreetmap.josm.Main; 11 12 import org.openstreetmap.josm.data.osm.Node; 12 13 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; … … 87 88 } catch (IllegalArgumentException e) { 88 89 // OK 90 if (Main.isTraceEnabled()) { 91 Main.trace(e.getMessage()); 92 } 89 93 } 90 94 } … … 133 137 } catch (IllegalStateException e) { 134 138 // OK 139 if (Main.isTraceEnabled()) { 140 Main.trace(e.getMessage()); 141 } 135 142 } 136 143 } … … 145 152 } catch (IllegalArgumentException e) { 146 153 // OK 154 if (Main.isTraceEnabled()) { 155 Main.trace(e.getMessage()); 156 } 147 157 } 148 158 } -
trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java
r8509 r8513 4 4 import org.junit.Assert; 5 5 import org.junit.Test; 6 import org.openstreetmap.josm.Main; 6 7 import org.openstreetmap.josm.data.Bounds; 7 8 … … 71 72 } catch (IllegalArgumentException e) { 72 73 // Ignore. check if bounds is null after 74 if (Main.isTraceEnabled()) { 75 Main.trace(e.getMessage()); 76 } 73 77 } 74 78 Assert.assertEquals(item.url, item.bounds, bounds); -
trunk/tools/checkstyle/josm_checks.xml
r8512 r8513 75 75 <module name="ModifierOrder"/> 76 76 <module name="RedundantModifier"/> 77 <module name="AvoidNestedBlocks"> 78 <property name="allowInSwitchCase" value="true"/> 79 </module> 80 <module name="EmptyBlock"> 81 <property name="tokens" value="LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_DO,LITERAL_ELSE,LITERAL_FOR,INSTANCE_INIT,STATIC_INIT,LITERAL_SWITCH"/> 82 </module> 83 <module name="EmptyCatchBlock"/> 84 <module name="LeftCurly"> 85 <property name="maxLineLength" value="140"/> 86 </module> 87 <module name="RightCurly"/> 88 <module name="NeedBraces"> 89 <property name="tokens" value="LITERAL_DO,LITERAL_FOR,LITERAL_WHILE"/> 90 <property name="allowSingleLineStatement" value="true"/> 91 </module> 77 92 </module> 78 93 <module name="Header">
Note:
See TracChangeset
for help on using the changeset viewer.