- Timestamp:
- 2015-05-19T00:05:33+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r8356 r8395 1000 1000 } 1001 1001 } 1002 if(!fileList.isEmpty()) 1003 { 1002 if(!fileList.isEmpty()) { 1004 1003 OpenFileAction.openFiles(fileList, true); 1005 1004 } -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r8390 r8395 222 222 final Way selectedWay = combineResult.a; 223 223 Main.main.undoRedo.add(combineResult.b); 224 if(selectedWay != null) 225 { 224 if(selectedWay != null) { 226 225 Runnable guiTask = new Runnable() { 227 226 @Override -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r8384 r8395 1328 1328 } 1329 1329 1330 for (Way way :innerWays) 1331 { 1330 for (Way way :innerWays) { 1332 1331 if (processedOuterWays.contains(way)) { 1333 1332 new Notification( -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r8390 r8395 1144 1144 * @param seg the reference segment 1145 1145 */ 1146 private void drawReferenceSegment(Graphics2D g2, MapView mv, ReferenceSegment seg) 1147 { 1146 private void drawReferenceSegment(Graphics2D g2, MapView mv, ReferenceSegment seg) { 1148 1147 Point p1 = mv.getPoint(seg.p1); 1149 1148 Point p2 = mv.getPoint(seg.p2); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r8345 r8395 509 509 return; 510 510 511 if (mode != Mode.ROTATE && mode != Mode.SCALE) // button is pressed in rotate mode 512 { 513 if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0) 514 return; 511 if (mode != Mode.ROTATE && mode != Mode.SCALE && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0) { 512 // button is pressed in rotate mode 513 return; 515 514 } 516 515 -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r8394 r8395 261 261 left.add(in_selection, GBC.eop()); 262 262 left.add(caseSensitive, GBC.eol()); 263 if(Main.pref.getBoolean("expert", false)) 264 { 263 if(Main.pref.getBoolean("expert", false)) { 265 264 left.add(allElements, GBC.eol()); 266 265 left.add(regexSearch, GBC.eol()); -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r8394 r8395 655 655 private void processIfElement(Element elem) { 656 656 String realValue = evalVars(elem.getAttribute("test")); 657 boolean v=false; 658 if ("true".equals(realValue)) v=true; else 659 if ("fales".equals(realValue)) v=true; else 660 { 657 boolean v = false; 658 if ("true".equals(realValue) || "false".equals(realValue)) { 659 processXmlFragment(elem); 660 v = true; 661 } else { 661 662 log("Error: Illegal test expression in if: %s=%s\n", elem.getAttribute("test"), realValue); 662 663 } 663 664 664 if (v) processXmlFragment(elem);665 665 lastV = v; 666 666 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r8394 r8395 1728 1728 List<Map<String, String>> newlist = new ArrayList<Map<String, String>>(); 1729 1729 boolean modified = false; 1730 for(Map<String, String> map : data) 1731 { 1730 for(Map<String, String> map : data) { 1732 1731 Map<String, String> newmap = new LinkedHashMap<String, String>(); 1733 1732 for (Entry<String, String> entry : map.entrySet()) { -
trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java
r8384 r8395 53 53 long tile = 0; 54 54 int i; 55 for (i = NR_LEVELS-1; i >= 0; i--) 56 { 55 for (i = NR_LEVELS-1; i >= 0; i--) { 57 56 long xbit = (x >> i) & 1; 58 57 long ybit = (y >> i) & 1; -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r8390 r8395 298 298 get/set functions calling this implicitely is preferred, so we can have 299 299 transparent cache handling in the future. */ 300 public void clearCachedStyle() 301 { 300 public void clearCachedStyle() { 302 301 mappaintStyle = null; 303 302 } -
trunk/src/org/openstreetmap/josm/data/osm/User.java
r8342 r8395 49 49 */ 50 50 public static synchronized User createLocalUser(String name) { 51 for(long i = -1; i >= uidCounter; --i) 52 { 51 for(long i = -1; i >= uidCounter; --i) { 53 52 User olduser = getById(i); 54 53 if(olduser != null && olduser.hasName(name)) -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r7816 r8395 49 49 50 50 public void visit(Bounds b) { 51 if(b != null) 52 { 51 if (b != null) { 53 52 visit(b.getMin()); 54 53 visit(b.getMax()); … … 57 56 58 57 public void visit(ProjectionBounds b) { 59 if(b != null) 60 { 58 if (b != null) { 61 59 visit(b.getMin()); 62 60 visit(b.getMax()); … … 65 63 66 64 public void visit(LatLon latlon) { 67 if(latlon != null) 68 { 69 if(latlon instanceof CachedLatLon) { 65 if (latlon != null) { 66 if (latlon instanceof CachedLatLon) { 70 67 visit(((CachedLatLon)latlon).getEastNorth()); 71 68 } else { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
r8345 r8395 212 212 if (it.hasNext()) { 213 213 Point lastP = nc.getPoint(it.next()); 214 while (it.hasNext()) 215 { 214 while (it.hasNext()) { 216 215 Point p = nc.getPoint(it.next()); 217 if (isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace)) 218 { 216 if (isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace)) { 219 217 int x = (p.x+lastP.x)/2; 220 218 int y = (p.y+lastP.y)/2; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r8393 r8395 750 750 g.rotate(-theta, p.x, p.y); 751 751 g.setPaintMode(); 752 if (selected || member) 753 { 752 if (selected || member) { 754 753 Color color; 755 754 if (disabled) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r8378 r8395 200 200 201 201 for (final OsmPrimitive osm: data.searchNodes(bbox)) { 202 if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden()) 203 { 202 if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden()) { 204 203 osm.accept(this); 205 204 } -
trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java
r8126 r8395 382 382 } 383 383 } else { // escaped value content is an entity name 384 if(mapNameToValue == null) 385 { 384 if(mapNameToValue == null) { 386 385 mapNameToValue = new HashMap<>(); 387 386 for (String[] pair : ARRAY) -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r8394 r8395 155 155 n = node.getName(); 156 156 } 157 if(n == null) 158 { 157 if (n == null) { 159 158 String s; 160 159 if((s = node.get("addr:housename")) != null) { … … 432 431 if (OsmUtils.isTrue(building)) { 433 432 name = tr("building"); 434 } else if(building != null) 435 { 433 } else if (building != null) { 436 434 name = tr(building); // translate tag! 437 435 } -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r8390 r8395 652 652 path.moveTo(p.x, p.y); 653 653 double max = b.getMax().lat(); 654 for(; lat <= max; lat += 1.0) 655 { 654 for(; lat <= max; lat += 1.0) { 656 655 p = getPoint(new LatLon(lat >= max ? max : lat, lon)); 657 656 path.lineTo(p.x, p.y); 658 657 } 659 658 lat = max; max = b.getMax().lon(); 660 for(; lon <= max; lon += 1.0) 661 { 659 for(; lon <= max; lon += 1.0) { 662 660 p = getPoint(new LatLon(lat, lon >= max ? max : lon)); 663 661 path.lineTo(p.x, p.y); 664 662 } 665 663 lon = max; max = b.getMinLat(); 666 for(; lat >= max; lat -= 1.0) 667 { 664 for(; lat >= max; lat -= 1.0) { 668 665 p = getPoint(new LatLon(lat <= max ? max : lat, lon)); 669 666 path.lineTo(p.x, p.y); 670 667 } 671 668 lat = max; max = b.getMinLon(); 672 for(; lon >= max; lon -= 1.0) 673 { 669 for(; lon >= max; lon -= 1.0) { 674 670 p = getPoint(new LatLon(lat, lon <= max ? max : lon)); 675 671 path.lineTo(p.x, p.y); -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r8384 r8395 693 693 for (Node n : ds.searchNodes(getBBox(p, PROP_SNAP_DISTANCE.get()))) { 694 694 if (predicate.evaluate(n) 695 && (dist = getPoint2D(n).distanceSq(p)) < snapDistanceSq) 696 { 695 && (dist = getPoint2D(n).distanceSq(p)) < snapDistanceSq) { 697 696 List<Node> nlist; 698 697 if (nearestMap.containsKey(dist)) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r8378 r8395 277 277 * Hide the Panel, if there is nothing to show 278 278 */ 279 if (numPanels == 1 && panels.get(N-1).getComponents().length == 0) 280 { 279 if (numPanels == 1 && panels.get(N-1).getComponents().length == 0) { 281 280 parent.setDividerSize(0); 282 281 this.setVisible(false); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r8377 r8395 207 207 KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), 208 208 KeyStroke.getKeyStroke(KeyEvent.VK_F8, 0), 209 }) 210 { 209 }) { 211 210 layerList.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks, new Object()); 212 211 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r8368 r8395 800 800 } 801 801 StringBuilder text = new StringBuilder(); 802 if (ways != 0) {802 if (ways != 0) { 803 803 text.append(text.length() > 0 ? ", " : "") 804 804 .append(trn("{0} way", "{0} ways", ways, ways)); 805 805 } 806 if (nodes != 0) {806 if (nodes != 0) { 807 807 text.append(text.length() > 0 ? ", " : "") 808 808 .append(trn("{0} node", "{0} nodes", nodes, nodes)); 809 809 } 810 if (relations != 0) {810 if (relations != 0) { 811 811 text.append(text.length() > 0 ? ", " : "") 812 812 .append(trn("{0} relation", "{0} relations", relations, relations)); 813 813 } 814 if (ways + nodes + relations == 0) {814 if (ways + nodes + relations == 0) { 815 815 text.append(tr("Unselectable now")); 816 816 this.sel=new ArrayList<>(); // empty selection 817 817 } 818 if(ways + nodes + relations == 1) 819 { 818 if (ways + nodes + relations == 1) { 820 819 text.append(": "); 821 820 for(OsmPrimitive o : sel) { -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserHistory.java
r8318 r8395 64 64 history = new ArrayList<>(); 65 65 } 66 if(add) 67 { 66 if (add) { 68 67 history.add(url); 69 68 historyPos = history.size()-1; -
trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
r8285 r8395 343 343 protected JTextField nextTF; 344 344 345 public TFKeyListener (CredentialDialog owner, JTextField currentTF, JTextField nextTF) 346 { 345 public TFKeyListener (CredentialDialog owner, JTextField currentTF, JTextField nextTF) { 347 346 this.owner = owner; 348 347 this.currentTF = currentTF; … … 368 367 369 368 @Override 370 public void keyReleased ( KeyEvent e ){369 public void keyReleased(KeyEvent e) { 371 370 } 372 371 -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r8378 r8395 791 791 .getValue(); 792 792 793 if(result == 2) 794 { 793 if (result == 2) { 795 794 data.remove(currentPhoto); 796 795 if (currentPhoto >= data.size()) { -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r8390 r8395 436 436 437 437 private static void playAdjacentMarker(Marker startMarker, boolean next) { 438 Marker m = null;439 438 if (!Main.isDisplayingMapView()) 440 439 return; 440 Marker m = null; 441 441 Layer l = Main.map.mapView.getActiveLayer(); 442 if (l != null) {442 if (l != null) { 443 443 m = getAdjacentMarker(startMarker, next, l); 444 444 } 445 if(m == null) 446 { 447 for (Layer layer : Main.map.mapView.getAllLayers()) 448 { 445 if (m == null) { 446 for (Layer layer : Main.map.mapView.getAllLayers()) { 449 447 m = getAdjacentMarker(startMarker, next, layer); 450 if (m != null) {448 if (m != null) { 451 449 break; 452 450 } 453 451 } 454 452 } 455 if (m != null) {453 if (m != null) { 456 454 ((AudioMarker)m).play(); 457 455 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r8377 r8395 165 165 if (osm instanceof Node) 166 166 return generateStyles(osm, scale, false); 167 else if (osm instanceof Way) 168 { 167 else if (osm instanceof Way) { 169 168 Pair<StyleList, Range> p = generateStyles(osm, scale, false); 170 169 -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinePrototype.java
r6986 r8395 32 32 public LinePrototype() { init(); } 33 33 34 public void init() 35 { 34 public void init() { 36 35 priority = 0; 37 36 range = Range.ZERO_TO_INFINITY; -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinemodPrototype.java
r6890 r8395 29 29 public float getWidth(float ref) { 30 30 float res; 31 if (widthMode == WidthMode.ABSOLUTE) {31 if (widthMode == WidthMode.ABSOLUTE) { 32 32 res = width; 33 } else if (widthMode == WidthMode.OFFSET) {33 } else if (widthMode == WidthMode.OFFSET) { 34 34 res = ref + width; 35 } else 36 { 37 if(width < 0) { 35 } else { 36 if (width < 0) { 38 37 res = 0; 39 38 } else { -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
r8345 r8395 171 171 } 172 172 for (IconPrototype s : iconsList) { 173 if (s.check(primitive)) 174 { 173 if (s.check(primitive)) { 175 174 icon = update(icon, s, scale, mc); 176 175 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r8392 r8395 337 337 @Override 338 338 public Object getValueAt(int rowIndex, int columnIndex) { 339 if(currentAction.getAction() instanceof AdaptableAction) 340 { 339 if(currentAction.getAction() instanceof AdaptableAction) { 341 340 if (rowIndex < 2) { 342 341 switch (columnIndex) { … … 350 349 } else { 351 350 rowIndex -= 2; 352 }351 } 353 352 } 354 353 ActionParameter<Object> param = getParam(rowIndex); … … 370 369 @Override 371 370 public void setValueAt(Object aValue, int rowIndex, int columnIndex) { 372 if(currentAction.getAction() instanceof AdaptableAction) 373 { 371 if(currentAction.getAction() instanceof AdaptableAction) { 374 372 if (rowIndex == 0) { 375 373 currentAction.setName((String)aValue); … … 380 378 } else { 381 379 rowIndex -= 2; 382 }380 } 383 381 } 384 382 ActionParameter<Object> param = getParam(rowIndex); … … 944 942 rootActionsNode.removeAllChildren(); 945 943 loadAction(rootActionsNode, Main.main.menu); 946 for(Map.Entry<String, Action> a : regactions.entrySet()) 947 { 948 if(actions.get(a.getKey()) == null) { 944 for (Map.Entry<String, Action> a : regactions.entrySet()) { 945 if (actions.get(a.getKey()) == null) { 949 946 rootActionsNode.add(new DefaultMutableTreeNode(a.getValue())); 950 947 } -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java
r8378 r8395 323 323 label.setForeground(foregroundColor); 324 324 } 325 if (pe.isChanged()) {325 if (pe.isChanged()) { 326 326 label.setBackground(changedColor); 327 } else if (!pe.isDefault()) {327 } else if (!pe.isDefault()) { 328 328 label.setBackground(nonDefaultColor); 329 329 } … … 333 333 } 334 334 val = pe.getDefaultValue().getValue(); 335 if(val != null) 336 { 337 if(pe.isDefault()) { 335 if (val != null) { 336 if (pe.isDefault()) { 338 337 label.setToolTipText(tr("Current value is default.")); 339 338 } else { -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r8377 r8395 184 184 @Override 185 185 public void actionPerformed(ActionEvent e) { 186 for(int i = 0; i < colors.getRowCount(); ++i) 187 { 186 for(int i = 0; i < colors.getRowCount(); ++i) { 188 187 String name = (String)colors.getValueAt(i, 0); 189 188 Color c = Main.pref.getDefaultColor(name); … … 208 207 209 208 colors = new JTable(tableModel) { 210 @Override public boolean isCellEditable(int row, int column) { 209 @Override 210 public boolean isCellEditable(int row, int column) { 211 211 return false; 212 212 } -
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r8390 r8395 235 235 // and result in a malformed packet. 236 236 String[] chkstrings = s.split("\\*"); 237 if(chkstrings.length > 1) 238 { 237 if (chkstrings.length > 1) { 239 238 byte[] chb = chkstrings[0].getBytes(StandardCharsets.UTF_8); 240 239 int chk=0; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
r8394 r8395 43 43 44 44 @Override 45 public String[] getMandatoryParams() 46 { 47 return new String[] { "lat", "lon" }; 45 public String[] getMandatoryParams() { 46 return new String[] {"lat", "lon"}; 48 47 } 49 48 50 49 @Override 51 public String[] getOptionalParams() 52 { 53 return new String[] { "addtags" }; 50 public String[] getOptionalParams() { 51 return new String[] {"addtags"}; 54 52 } 55 53 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r8394 r8395 249 249 * @param command The command. 250 250 */ 251 public void setCommand(String command) 252 { 251 public void setCommand(String command) { 253 252 if (command.charAt(0) == '/') { 254 253 command = command.substring(1); -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r8390 r8395 245 245 author = attr.getValue("Author"); 246 246 iconPath = attr.getValue("Plugin-Icon"); 247 if (iconPath != null) 248 { 247 if (iconPath != null) { 249 248 if (file != null) { 250 249 // extract icon from the plugin jar file -
trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
r8393 r8395 277 277 if (playingUrl != command.url() || 278 278 stateChange != State.PAUSED || 279 offset != 0) 280 { 279 offset != 0) { 281 280 if (audioInputStream != null) { 282 281 Utils.close(audioInputStream); -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r8378 r8395 170 170 bd[bdiagoff + bmid] = xlim; 171 171 172 for (int c = 1;; ++c) 173 { 172 for (int c = 1;; ++c) { 174 173 int d; /* Active diagonal. */ 175 174 boolean big_snake = false; … … 186 185 --fmax; 187 186 } 188 for (d = fmax; d >= fmin; d -= 2) 189 { 187 for (d = fmax; d >= fmin; d -= 2) { 190 188 int x, y, oldx, tlo = fd[fdiagoff + d - 1], thi = fd[fdiagoff + d + 1]; 191 189 … … 204 202 } 205 203 fd[fdiagoff + d] = x; 206 if (odd && bmin <= d && d <= bmax && bd[bdiagoff + d] <= fd[fdiagoff + d]) 207 { 204 if (odd && bmin <= d && d <= bmax && bd[bdiagoff + d] <= fd[fdiagoff + d]) { 208 205 cost = 2 * c - 1; 209 206 return d; … … 222 219 --bmax; 223 220 } 224 for (d = bmax; d >= bmin; d -= 2) 225 { 221 for (d = bmax; d >= bmin; d -= 2) { 226 222 int x, y, oldx, tlo = bd[bdiagoff + d - 1], thi = bd[bdiagoff + d + 1]; 227 223 … … 240 236 } 241 237 bd[bdiagoff + d] = x; 242 if (!odd && fmin <= d && d <= fmax && bd[bdiagoff + d] <= fd[fdiagoff + d]) 243 { 238 if (!odd && fmin <= d && d <= fmax && bd[bdiagoff + d] <= fd[fdiagoff + d]) { 244 239 cost = 2 * c; 245 240 return d; … … 255 250 of changes, the algorithm is linear in the file size. */ 256 251 257 if (c > 200 && big_snake && heuristic) 258 { 252 if (c > 200 && big_snake && heuristic) { 259 253 int best = 0; 260 254 int bestpos = -1; 261 255 262 for (d = fmax; d >= fmin; d -= 2) 263 { 256 for (d = fmax; d >= fmin; d -= 2) { 264 257 int dd = d - fmid; 265 258 int x = fd[fdiagoff + d]; 266 259 int y = x - d; 267 260 int v = (x - xoff) * 2 - dd; 268 if (v > 12 * (c + (dd < 0 ? -dd : dd))) 269 { 261 if (v > 12 * (c + (dd < 0 ? -dd : dd))) { 270 262 if (v > best 271 263 && xoff + SNAKE_LIMIT <= x && x < xlim 272 && yoff + SNAKE_LIMIT <= y && y < ylim) 273 { 264 && yoff + SNAKE_LIMIT <= y && y < ylim) { 274 265 /* We have a good enough best diagonal. 275 266 now insist that it end with a significant snake. */ … … 277 268 278 269 for (k = 1; xvec[x - k] == yvec[y - k]; k++) 279 if (k == SNAKE_LIMIT) 280 { 270 if (k == SNAKE_LIMIT) { 281 271 best = v; 282 272 bestpos = d; … … 286 276 } 287 277 } 288 if (best > 0) 289 { 278 if (best > 0) { 290 279 cost = 2 * c - 1; 291 280 return bestpos; … … 293 282 294 283 best = 0; 295 for (d = bmax; d >= bmin; d -= 2) 296 { 284 for (d = bmax; d >= bmin; d -= 2) { 297 285 int dd = d - bmid; 298 286 int x = bd[bdiagoff + d]; 299 287 int y = x - d; 300 288 int v = (xlim - x) * 2 + dd; 301 if (v > 12 * (c + (dd < 0 ? -dd : dd))) 302 { 289 if (v > 12 * (c + (dd < 0 ? -dd : dd))) { 303 290 if (v > best 304 291 && xoff < x && x <= xlim - SNAKE_LIMIT 305 && yoff < y && y <= ylim - SNAKE_LIMIT) 306 { 292 && yoff < y && y <= ylim - SNAKE_LIMIT) { 307 293 /* We have a good enough best diagonal. 308 294 now insist that it end with a significant snake. */ … … 310 296 311 297 for (k = 0; xvec[x + k] == yvec[y + k]; k++) 312 if (k == SNAKE_LIMIT) 313 { 298 if (k == SNAKE_LIMIT) { 314 299 best = v; 315 300 bestpos = d; … … 319 304 } 320 305 } 321 if (best > 0) 322 { 306 if (best > 0) { 323 307 cost = 2 * c - 1; 324 308 return bestpos; … … 371 355 Let's verify that this is true. */ 372 356 throw new IllegalArgumentException("Empty subsequence"); 373 else 374 { 357 else { 375 358 /* Use that point to split this problem into two subproblems. */ 376 359 compareseq (xoff, b, yoff, b - d); … … 425 408 public Change build_script( 426 409 final boolean[] changed0,int len0, 427 final boolean[] changed1,int len1) 428 { 410 final boolean[] changed1,int len1) { 429 411 Change script = null; 430 412 int i0 = 0, i1 = 0; … … 459 441 public Change build_script( 460 442 final boolean[] changed0,int len0, 461 final boolean[] changed1,int len1) 462 { 443 final boolean[] changed1,int len1) { 463 444 Change script = null; 464 445 int i0 = len0, i1 = len1; 465 446 466 while (i0 >= 0 || i1 >= 0) 467 { 468 if (changed0[i0] || changed1[i1]) 469 { 447 while (i0 >= 0 || i1 >= 0) { 448 if (changed0[i0] || changed1[i1]) { 470 449 int line0 = i0, line1 = i1; 471 450 … … 670 649 } 671 650 672 for (int i = 0; i < end; i++) 673 { 651 for (int i = 0; i < end; i++) { 674 652 int nmatch; 675 653 if (equivs[i] == 0) { … … 694 672 final int end = bufferedLines; 695 673 696 for (int i = 0; i < end; i++) 697 { 674 for (int i = 0; i < end; i++) { 698 675 /* Cancel provisional discards not in middle of run of discards. */ 699 676 if (discards[i] == 2) { 700 677 discards[i] = 0; 701 } else if (discards[i] != 0) 702 { 678 } else if (discards[i] != 0) { 703 679 /* We have found a nonprovisional discard. */ 704 680 int j; … … 708 684 /* Find end of this run of discardable lines. 709 685 Count how many are provisionally discardable. */ 710 for (j = i; j < end; j++) 711 { 686 for (j = i; j < end; j++) { 712 687 if (discards[j] == 0) { 713 688 break; … … 811 786 int j = 0; 812 787 for (int i = 0; i < end; ++i) 813 if (noDiscards || discards[i] == 0) 814 { 788 if (noDiscards || discards[i] == 0) { 815 789 undiscarded[j] = equivs[i]; 816 790 realindexes[j++] = i; … … 853 827 @param f the file being compared against 854 828 */ 855 856 829 void shift_boundaries(FileData f) { 857 830 final boolean[] changed = changedFlag; … … 863 836 int other_preceding = -1; 864 837 865 for (;;) 866 { 838 for (;;) { 867 839 int start, end, other_start; 868 840 … … 870 842 Also keep track of the corresponding point in the other file. */ 871 843 872 while (i < i_end && !changed[1+i]) 873 { 844 while (i < i_end && !changed[1+i]) { 874 845 while (other_changed[1+j++]) { 875 846 /* Non-corresponding lines in the other file … … 887 858 other_start = j; 888 859 889 for (;;) 890 { 860 for (;;) { 891 861 /* Now find the end of this run of changes. */ 892 862 … … 905 875 Only because the previous run was shifted here. */ 906 876 907 if (end != i_end 908 && equivs[start] == equivs[end] 909 && !other_changed[1+j] 910 && !((preceding >= 0 && start == preceding) 911 || (other_preceding >= 0 912 && other_start == other_preceding))) 913 { 877 if (end != i_end && equivs[start] == equivs[end] && !other_changed[1+j] 878 && !((preceding >= 0 && start == preceding) || (other_preceding >= 0 && other_start == other_preceding))) { 914 879 changed[1+end++] = true; 915 880 changed[1+start++] = false; -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r8393 r8395 601 601 if ((newPoint.getEastNorth().getY() < point.getEastNorth().getY()) == (point.getEastNorth().getY() <= oldPoint.getEastNorth().getY()) 602 602 && (point.getEastNorth().getX() - p1.getEastNorth().getX()) * (p2.getEastNorth().getY() - p1.getEastNorth().getY()) 603 < (p2.getEastNorth().getX() - p1.getEastNorth().getX()) * (point.getEastNorth().getY() - p1.getEastNorth().getY())) 604 { 603 < (p2.getEastNorth().getX() - p1.getEastNorth().getX()) * (point.getEastNorth().getY() - p1.getEastNorth().getY())) { 605 604 inside = !inside; 606 605 } … … 638 637 } 639 638 640 protected static double calcX(Node p1) {639 protected static double calcX(Node p1) { 641 640 double lat1, lon1, lat2, lon2; 642 641 double dlon, dlat; -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r8393 r8395 935 935 return svg == null ? null : new ImageResource(svg); 936 936 case OTHER: 937 while(size > 0) 938 { 937 while(size > 0) { 939 938 int l = is.read(buf, offs, size); 940 939 offs += l; -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r8380 r8395 253 253 public static List<Shortcut> listAll() { 254 254 List<Shortcut> l = new ArrayList<>(); 255 for(Shortcut c : shortcuts.values()) 256 { 257 if(!"core:none".equals(c.shortText)) { 255 for (Shortcut c : shortcuts.values()) { 256 if (!"core:none".equals(c.shortText)) { 258 257 l.add(c); 259 258 }
Note:
See TracChangeset
for help on using the changeset viewer.