Changeset 17666 in josm for trunk


Ignore:
Timestamp:
2021-03-25T21:50:07+01:00 (4 years ago)
Author:
simon04
Message:

see #20101 - Separate MapStatus.setAngle/setAngleNaN for plugin compatibility

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r17632 r17666  
    900900    static void showStatusInfo(double angle, double hdg, double distance, boolean activeFlag) {
    901901        MapFrame map = MainApplication.getMap();
    902         map.statusLine.setAngle(angle);
     902        map.statusLine.setAngleNaN(angle);
    903903        map.statusLine.activateAnglePanel(activeFlag);
    904904        map.statusLine.setHeading(hdg);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r17632 r17666  
    772772                if (c instanceof RotateCommand) {
    773773                    double angle = Utils.toDegrees(((RotateCommand) c).getRotationAngle());
    774                     MainApplication.getMap().statusLine.setAngle(angle);
     774                    MainApplication.getMap().statusLine.setAngleNaN(angle);
    775775                } else if (c instanceof ScaleCommand) {
    776776                    // U+00D7 MULTIPLICATION SIGN
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r17632 r17666  
    10851085
    10861086    /**
     1087     * Sets the angle to display in the angle panel. Values less than 0 yield "--".
     1088     * @param a The angle
     1089     * @see #setAngleNaN
     1090     * @see #setAngleText
     1091     */
     1092    public void setAngle(double a) {
     1093        angleText.setText(a < 0 ? "--" : DECIMAL_FORMAT.format(a) + " \u00B0");
     1094    }
     1095
     1096    /**
    10871097     * Sets the angle to display in the angle panel. NaN yields "--".
    10881098     * @param a The angle
    1089      */
    1090     public void setAngle(double a) {
     1099     * @see #setAngle
     1100     * @see #setAngleText
     1101     */
     1102    public void setAngleNaN(double a) {
    10911103        angleText.setText(!Double.isFinite(a) ? "--" : DECIMAL_FORMAT.format(a) + " \u00B0");
    10921104    }
Note: See TracChangeset for help on using the changeset viewer.