Changeset 8199 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
- Timestamp:
- 2015-04-15T23:51:33+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r7937 r8199 30 30 import org.openstreetmap.josm.gui.mappaint.Cascade; 31 31 import org.openstreetmap.josm.gui.mappaint.Environment; 32 import org.openstreetmap.josm.gui.util.RotationAngle; 32 33 import org.openstreetmap.josm.io.XmlWriter; 33 34 import org.openstreetmap.josm.tools.ColorHelper; … … 547 548 548 549 /** 550 * Converts an angle in degrees to radians. 551 * @param degree the angle in degrees 552 * @return the angle in radians 553 * @see Math#toRadians(double) 554 */ 555 public static double degree_to_radians(double degree) { 556 return Math.toRadians(degree); 557 } 558 559 /** 560 * Converts an angle diven in cardinal directions to radians. 561 * The following values are supported: {@code n}, {@code north}, {@code ne}, {@code northeast}, 562 * {@code e}, {@code east}, {@code se}, {@code southeast}, {@code s}, {@code south}, 563 * {@code sw}, {@code southwest}, {@code w}, {@code west}, {@code nw}, {@code northwest}. 564 * @param cardinal the angle in cardinal directions. 565 * @see RotationAngle#parseCardinalRotation(String) 566 * @return the angle in radians 567 */ 568 public static Double cardinal_to_radians(String cardinal) { 569 try { 570 return RotationAngle.parseCardinalRotation(cardinal); 571 } catch (IllegalArgumentException ignore) { 572 return null; 573 } 574 } 575 576 /** 549 577 * Determines if the objects {@code a} and {@code b} are equal. 550 578 * @param a First object
Note:
See TracChangeset
for help on using the changeset viewer.
