Changeset 8443 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2015-06-02T16:40:38+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java
r8291 r8443 111 111 public static void ensureValidNodeId(PrimitiveId id, String parameterName) throws IllegalArgumentException { 112 112 ensureParameterNotNull(id, parameterName); 113 if (! 113 if (!id.getType().equals(OsmPrimitiveType.NODE)) 114 114 throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' of type node expected, got ''{1}''", parameterName, id.getType().getAPIName())); 115 115 } -
trunk/src/org/openstreetmap/josm/tools/ColorScale.java
r8419 r8443 38 38 ColorScale sc = new ColorScale(); 39 39 // red yellow green blue red 40 int[] h = new int[] { 41 int[] s = new int[] { 42 int[] b = new int[] { 40 int[] h = new int[] {0, 59, 127, 244, 360}; 41 int[] s = new int[] {100, 84, 99, 100}; 42 int[] b = new int[] {90, 93, 74, 83}; 43 43 44 44 sc.colors = new Color[count]; -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r8419 r8443 97 97 public Diff(Object[] a, Object[] b) { 98 98 Map<Object,Integer> h = new HashMap<>(a.length + b.length); 99 filevec = new FileData[] { 99 filevec = new FileData[] {new FileData(a,h), new FileData(b,h)}; 100 100 } 101 101 -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r8419 r8443 298 298 if (Math.abs(det) > 1e-12 * mag) { 299 299 double u = uu/det, v = vv/det; 300 if (u>-1e-8 && u < 1+1e-8 && v>-1e-8 && v < 1+1e-8 300 if (u>-1e-8 && u < 1+1e-8 && v>-1e-8 && v < 1+1e-8) { 301 301 if (u<0) u=0; 302 302 if (u>1) u=1.0; … … 355 355 return null; // Lines are parallel 356 356 357 return new EastNorth(b1 * c2 / det + p1.getX(), -a1 * c2 / det + p1.getY());357 return new EastNorth(b1 * c2 / det + p1.getX(), -a1 * c2 / det + p1.getY()); 358 358 } 359 359 -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r8419 r8443 721 721 String[] extensions; 722 722 if (name.indexOf('.') != -1) { 723 extensions = new String[] { ""};723 extensions = new String[] {""}; 724 724 } else { 725 extensions = new String[] { 725 extensions = new String[] {".png", ".svg"}; 726 726 } 727 727 final int ARCHIVE = 0, LOCAL = 1; 728 for (int place : new Integer[] { 728 for (int place : new Integer[] {ARCHIVE, LOCAL}) { 729 729 for (String ext : extensions) { 730 730 -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r8419 r8443 415 415 // Try to reassign Meta to Ctrl 416 416 int newmodifier = findNewOsxModifier(requestedGroup); 417 if ( 417 if (findShortcut(requestedKey, newmodifier) == null) { 418 418 return reassignShortcut(shortText, longText, requestedKey, conflict, requestedGroup, requestedKey, newmodifier); 419 419 } … … 422 422 for (int k : keys) { 423 423 int newmodifier = getGroupModifier(m); 424 if ( 424 if (findShortcut(k, newmodifier) == null) { 425 425 return reassignShortcut(shortText, longText, requestedKey, conflict, m, k, newmodifier); 426 426 } -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r8375 r8443 132 132 while (pos < n) { 133 133 c = data.charAt(pos); 134 if (c == '\t' || c == '\n' || c == '\r' || c == ' ' 134 if (c == '\t' || c == '\n' || c == '\r' || c == ' ') { 135 135 pos++; 136 136 } else { … … 142 142 143 143 protected static String unescape(String k) { 144 if (!(k.startsWith("\"") && k.endsWith("\""))144 if (!(k.startsWith("\"") && k.endsWith("\""))) { 145 145 if (k.contains("=")) { 146 146 // '=' not in quotes will be treated as an error! … … 220 220 String bufJson = buf.trim(); 221 221 // trim { }, if there are any 222 if (bufJson.startsWith("{") && bufJson.endsWith("}") ) bufJson = bufJson.substring(1,bufJson.length()-1); 222 if (bufJson.startsWith("{") && bufJson.endsWith("}")) 223 bufJson = bufJson.substring(1, bufJson.length()-1); 223 224 tags = readTagsByRegexp(bufJson, "[\\s]*,[\\s]*", 224 225 "[\\s]*(\\\".*?[^\\\\]\\\")"+"[\\s]*:[\\s]*"+"(\\\".*?[^\\\\]\\\")[\\s]*", true); -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r8435 r8443 421 421 */ 422 422 public static boolean deleteDirectory(File path) { 423 if (path.exists()423 if (path.exists()) { 424 424 File[] files = path.listFiles(); 425 425 if (files != null) { -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r8394 r8443 68 68 public static WindowGeometry centerInWindow(Component reference, Dimension extent) { 69 69 Window parentWindow = null; 70 while(reference != null && ! 70 while (reference != null && !(reference instanceof Window)) { 71 71 reference = reference.getParent(); 72 72 }
Note:
See TracChangeset
for help on using the changeset viewer.