Changeset 10599 in josm for trunk/src/org/openstreetmap/josm/gui/util
- Timestamp:
- 2016-07-23T02:08:50+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/RotationAngle.java
r10228 r10599 12 12 13 13 /** 14 * Determines how an icon is to be rotated depending on the primitive to displayed. 14 * Determines how an icon is to be rotated depending on the primitive to be displayed. 15 * @since 8199 (creation) 16 * @since 10599 (functional interface) 15 17 */ 16 public abstract class RotationAngle { 18 @FunctionalInterface 19 public interface RotationAngle { 17 20 18 21 /** 19 * Calculates the rotation angle depending on the primitive to displayed.22 * Calculates the rotation angle depending on the primitive to be displayed. 20 23 * @param p primitive 21 24 * @return rotation angle 22 25 */ 23 public abstractdouble getRotationAngle(OsmPrimitive p);26 double getRotationAngle(OsmPrimitive p); 24 27 25 28 /** … … 28 31 * @return rotation angle 29 32 */ 30 publicstatic RotationAngle buildStaticRotation(final double angle) {33 static RotationAngle buildStaticRotation(final double angle) { 31 34 return new RotationAngle() { 32 35 @Override … … 47 50 * @return rotation angle 48 51 */ 49 publicstatic RotationAngle buildStaticRotation(final String string) {52 static RotationAngle buildStaticRotation(final String string) { 50 53 try { 51 54 return buildStaticRotation(parseCardinalRotation(string)); … … 63 66 * @return the angle in radians 64 67 */ 65 publicstatic double parseCardinalRotation(final String cardinal) {68 static double parseCardinalRotation(final String cardinal) { 66 69 switch (cardinal.toLowerCase(Locale.ENGLISH)) { 67 70 case "n": … … 98 101 * @return rotation angle 99 102 */ 100 publicstatic RotationAngle buildWayDirectionRotation() {103 static RotationAngle buildWayDirectionRotation() { 101 104 return new RotationAngle() { 102 105 @Override
Note:
See TracChangeset
for help on using the changeset viewer.