Changeset 9269 in josm


Ignore:
Timestamp:
2016-01-02T23:09:57+01:00 (9 years ago)
Author:
simon04
Message:

fix #12275 - Allow changing decimal places in status line

Use expert preference keys statusbar.decimal-format and statusbar.distance-threshold for that,
and restart JOSM.

File:
1 edited

Legend:

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

    r9183 r9269  
    9292public class MapStatus extends JPanel implements Helpful, Destroyable, PreferenceChangedListener {
    9393
    94     private static final DecimalFormat ONE_DECIMAL_PLACE = new DecimalFormat("0.0");
     94    private static final DecimalFormat ONE_DECIMAL_PLACE = new DecimalFormat(
     95            Main.pref.get("statusbar.decimal-format", "0.0")); // change of preference requires restart
     96    private static final double DISTANCE_THRESHOLD = Main.pref.getDouble("statusbar.distance-threshold", 0.01);
    9597
    9698    /**
     
    9991001    public void setDist(double dist) {
    10001002        distValue = dist;
    1001         distText.setText(dist < 0 ? "--" : NavigatableComponent.getDistText(dist, ONE_DECIMAL_PLACE, 0.01));
     1003        distText.setText(dist < 0 ? "--" : NavigatableComponent.getDistText(dist, ONE_DECIMAL_PLACE, DISTANCE_THRESHOLD));
    10021004    }
    10031005
Note: See TracChangeset for help on using the changeset viewer.