Changeset 9863 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2016-02-23T21:14:30+01:00 (8 years ago)
Author:
simon04
Message:

see #12275 - Clarify variable name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r9634 r9863  
    9393public class MapStatus extends JPanel implements Helpful, Destroyable, PreferenceChangedListener {
    9494
    95     private static final DecimalFormat ONE_DECIMAL_PLACE = new DecimalFormat(
    96             Main.pref.get("statusbar.decimal-format", "0.0")); // change of preference requires restart
    97     private static final double DISTANCE_THRESHOLD = Main.pref.getDouble("statusbar.distance-threshold", 0.01);
     95    private final DecimalFormat DECIMAL_FORMAT = new DecimalFormat(Main.pref.get("statusbar.decimal-format", "0.0"));
     96    private final double DISTANCE_THRESHOLD = Main.pref.getDouble("statusbar.distance-threshold", 0.01);
    9897
    9998    /**
     
    191190    private final ImageLabel headingText = new ImageLabel("heading",
    192191            tr("The (compass) heading of the line segment being drawn."),
    193             ONE_DECIMAL_PLACE.format(360).length() + 1, PROP_BACKGROUND_COLOR.get());
     192            DECIMAL_FORMAT.format(360).length() + 1, PROP_BACKGROUND_COLOR.get());
    194193    private final ImageLabel angleText = new ImageLabel("angle",
    195194            tr("The angle between the previous and the current way segment."),
    196             ONE_DECIMAL_PLACE.format(360).length() + 1, PROP_BACKGROUND_COLOR.get());
     195            DECIMAL_FORMAT.format(360).length() + 1, PROP_BACKGROUND_COLOR.get());
    197196    private final ImageLabel distText = new ImageLabel("dist",
    198197            tr("The length of the new way segment being drawn."), 10, PROP_BACKGROUND_COLOR.get());
     
    10281027
    10291028    public void setAngle(double a) {
    1030         angleText.setText(a < 0 ? "--" : ONE_DECIMAL_PLACE.format(a) + " \u00B0");
     1029        angleText.setText(a < 0 ? "--" : DECIMAL_FORMAT.format(a) + " \u00B0");
    10311030    }
    10321031
    10331032    public void setHeading(double h) {
    1034         headingText.setText(h < 0 ? "--" : ONE_DECIMAL_PLACE.format(h) + " \u00B0");
     1033        headingText.setText(h < 0 ? "--" : DECIMAL_FORMAT.format(h) + " \u00B0");
    10351034    }
    10361035
     
    10411040    public void setDist(double dist) {
    10421041        distValue = dist;
    1043         distText.setText(dist < 0 ? "--" : NavigatableComponent.getDistText(dist, ONE_DECIMAL_PLACE, DISTANCE_THRESHOLD));
     1042        distText.setText(dist < 0 ? "--" : NavigatableComponent.getDistText(dist, DECIMAL_FORMAT, DISTANCE_THRESHOLD));
    10441043    }
    10451044
Note: See TracChangeset for help on using the changeset viewer.