Changeset 7135 in josm for trunk/src/org/openstreetmap/josm/gui/MapStatus.java
- Timestamp:
- 2014-05-17T04:49:16+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r7005 r7135 27 27 import java.awt.event.MouseMotionListener; 28 28 import java.lang.reflect.InvocationTargetException; 29 import java.text.DecimalFormat; 29 30 import java.util.ArrayList; 30 31 import java.util.Collection; … … 85 86 */ 86 87 public class MapStatus extends JPanel implements Helpful, Destroyable, PreferenceChangedListener { 88 89 private static final DecimalFormat ONE_DECIMAL_PLACE = new DecimalFormat("0.0"); 87 90 88 91 /** … … 723 726 724 727 private final JSeparator separator = new JSeparator(); 725 728 726 729 private final JMenuItem doNotHide = new JCheckBoxMenuItem(new AbstractAction(tr("Do not hide status bar")) { 727 730 @Override … … 743 746 add(item); 744 747 } 745 748 746 749 add(separator); 747 750 add(doNotHide); 748 751 749 752 addPopupMenuListener(new PopupMenuListener() { 750 753 @Override … … 947 950 948 951 public void setAngle(double a) { 949 angleText.setText(a < 0 ? "--" : Math.round(a*10)/10.0+ " \u00B0");952 angleText.setText(a < 0 ? "--" : ONE_DECIMAL_PLACE.format(a) + " \u00B0"); 950 953 } 951 954 952 955 public void setHeading(double h) { 953 headingText.setText(h < 0 ? "--" : Math.round(h*10)/10.0+ " \u00B0");956 headingText.setText(h < 0 ? "--" : ONE_DECIMAL_PLACE.format(h) + " \u00B0"); 954 957 } 955 958 … … 960 963 public void setDist(double dist) { 961 964 distValue = dist; 962 distText.setText(dist < 0 ? "--" : NavigatableComponent.getDistText(dist ));965 distText.setText(dist < 0 ? "--" : NavigatableComponent.getDistText(dist, ONE_DECIMAL_PLACE, 0.01)); 963 966 } 964 967
Note:
See TracChangeset
for help on using the changeset viewer.