Changeset 8251 in josm for trunk/src/org
- Timestamp:
- 2015-04-23T19:06:39+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/RotationAngle.java
r8238 r8251 43 43 final Pattern radiansPattern = Pattern.compile("(\\d+\\.?\\d*)\\s*(rad)?"); 44 44 final Pattern degreesPattern = Pattern.compile("(\\d+\\.?\\d*)\\s*(deg|°)"); 45 final Pattern gradianPattern = Pattern.compile("(\\d+\\.?\\d*)\\s*(grad)"); 46 final Pattern turnPattern = Pattern.compile("(\\d+\\.?\\d*)\\s*(turn)"); 45 47 final double value; 46 48 Matcher matcher; … … 49 51 } else if ((matcher = degreesPattern.matcher(string)).matches()) { 50 52 value = Math.toRadians(Double.parseDouble(matcher.group(1))); 53 } else if ((matcher = gradianPattern.matcher(string)).matches()) { 54 value = Double.parseDouble(matcher.group(1)) / 200 * Math.PI; 55 } else if ((matcher = turnPattern.matcher(string)).matches()) { 56 value = Double.parseDouble(matcher.group(1)) * 2 * Math.PI; 51 57 } else { 52 58 try {
Note:
See TracChangeset
for help on using the changeset viewer.