- Timestamp:
- 2016-02-23T21:14:30+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r9634 r9863 93 93 public class MapStatus extends JPanel implements Helpful, Destroyable, PreferenceChangedListener { 94 94 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); 98 97 99 98 /** … … 191 190 private final ImageLabel headingText = new ImageLabel("heading", 192 191 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()); 194 193 private final ImageLabel angleText = new ImageLabel("angle", 195 194 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()); 197 196 private final ImageLabel distText = new ImageLabel("dist", 198 197 tr("The length of the new way segment being drawn."), 10, PROP_BACKGROUND_COLOR.get()); … … 1028 1027 1029 1028 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"); 1031 1030 } 1032 1031 1033 1032 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"); 1035 1034 } 1036 1035 … … 1041 1040 public void setDist(double dist) { 1042 1041 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)); 1044 1043 } 1045 1044
Note:
See TracChangeset
for help on using the changeset viewer.