Changeset 12538 in josm


Ignore:
Timestamp:
2017-07-30T00:47:03+02:00 (3 months ago)
Author:
Don-vip
Message:

PMD - ShortMethodName

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r12375 r12538  
    234234     * @param pCoordinate The coordinate to convert
    235235     * @return The coordinate in degrees/minutes format
    236      */
    237     public static String dm(double pCoordinate) {
     236     * @since 12537
     237     */
     238    public static String degreesMinutes(double pCoordinate) {
    238239
    239240        double tAbsCoord = Math.abs(pCoordinate);
     
    250251
    251252        return sDegrees + '\u00B0' + sMinutes + '\'';
     253    }
     254
     255    /**
     256     * Replies the coordinate in degrees/minutes format
     257     * @param pCoordinate The coordinate to convert
     258     * @return The coordinate in degrees/minutes format
     259     * @deprecated use {@link #degreesMinutes(double)} instead
     260     */
     261    @Deprecated
     262    public static String dm(double pCoordinate) {
     263        return degreesMinutes(pCoordinate);
    252264    }
    253265
     
    291303        case DECIMAL_DEGREES: return cDdFormatter.format(y);
    292304        case DEGREES_MINUTES_SECONDS: return dms(y) + ((y < 0) ? SOUTH : NORTH);
    293         case NAUTICAL: return dm(y) + ((y < 0) ? SOUTH : NORTH);
     305        case NAUTICAL: return degreesMinutes(y) + ((y < 0) ? SOUTH : NORTH);
    294306        case EAST_NORTH: return cDdFormatter.format(this.getEastNorth().north());
    295307        default: return "ERR";
     
    311323        case DECIMAL_DEGREES: return cDdFormatter.format(x);
    312324        case DEGREES_MINUTES_SECONDS: return dms(x) + ((x < 0) ? WEST : EAST);
    313         case NAUTICAL: return dm(x) + ((x < 0) ? WEST : EAST);
     325        case NAUTICAL: return degreesMinutes(x) + ((x < 0) ? WEST : EAST);
    314326        case EAST_NORTH: return cDdFormatter.format(this.getEastNorth().east());
    315327        default: return "ERR";
  • trunk/src/org/openstreetmap/josm/tools/ColorScale.java

    r12367 r12538  
    6262            quadrant = Utils.mod(quadrant+1, 4);
    6363
    64             float vh = h[quadrant] * w(angle) + h[quadrant+1] * (1 - w(angle));
    65             float vs = s[quadrant] * w(angle) + s[Utils.mod(quadrant+1, 4)] * (1 - w(angle));
    66             float vb = b[quadrant] * w(angle) + b[Utils.mod(quadrant+1, 4)] * (1 - w(angle));
     64            float vh = h[quadrant] * weighted(angle) + h[quadrant+1] * (1 - weighted(angle));
     65            float vs = s[quadrant] * weighted(angle) + s[Utils.mod(quadrant+1, 4)] * (1 - weighted(angle));
     66            float vb = b[quadrant] * weighted(angle) + b[Utils.mod(quadrant+1, 4)] * (1 - weighted(angle));
    6767
    6868            sc.colors[i] = Color.getHSBColor(vh/360f, vs/100f, vb/100f);
     
    7979     * @return the weighted value
    8080     */
    81     private static float w(float x) {
     81    private static float weighted(float x) {
    8282        if (x < 0.5)
    8383            return 1 - 2*x*x;
Note: See TracChangeset for help on using the changeset viewer.