Changeset 12674 in josm
 Timestamp:
 20170827T17:29:32+02:00 (3 years ago)
 Location:
 trunk/src/org/openstreetmap/josm
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java
r12542 r12674 13 13 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm. gui.preferences.projection.ProjectionPreference;15 import org.openstreetmap.josm.data.preferences.StringProperty; 16 16 17 17 /** 18 18 * A system of units used to express length and area measurements. 19 19 * <p> 20 * This class also manages one globally set system of measurement stored in the {@ linkProjectionPreference}20 * This class also manages one globally set system of measurement stored in the {@code ProjectionPreference} 21 21 * @since 3406 (creation) 22 22 * @since 6992 (extraction in this package) 23 23 */ 24 24 public class SystemOfMeasurement { 25 26 /** 27 * Preferences entry for system of measurement. 28 * @since 12674 (moved from ProjectionPreference) 29 */ 30 public static final StringProperty PROP_SYSTEM_OF_MEASUREMENT = new StringProperty("system_of_measurement", "Metric"); 25 31 26 32 /** … … 116 122 */ 117 123 public static SystemOfMeasurement getSystemOfMeasurement() { 118 return Optional.ofNullable(SystemOfMeasurement.ALL_SYSTEMS.get(P rojectionPreference.PROP_SYSTEM_OF_MEASUREMENT.get()))124 return Optional.ofNullable(SystemOfMeasurement.ALL_SYSTEMS.get(PROP_SYSTEM_OF_MEASUREMENT.get())) 119 125 .orElse(SystemOfMeasurement.METRIC); 120 126 } … … 130 136 throw new IllegalArgumentException("Invalid system of measurement: "+somKey); 131 137 } 132 String oldKey = P rojectionPreference.PROP_SYSTEM_OF_MEASUREMENT.get();133 if (P rojectionPreference.PROP_SYSTEM_OF_MEASUREMENT.put(somKey)) {138 String oldKey = PROP_SYSTEM_OF_MEASUREMENT.get(); 139 if (PROP_SYSTEM_OF_MEASUREMENT.put(somKey)) { 134 140 fireSoMChanged(oldKey, somKey); 135 141 } 
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r12663 r12674 71 71 import org.openstreetmap.josm.data.preferences.DoubleProperty; 72 72 import org.openstreetmap.josm.gui.help.Helpful; 73 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;74 73 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor; 75 74 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor.ProgressMonitorDialog; … … 807 806 Component invoker = ((JPopupMenu) e.getSource()).getInvoker(); 808 807 jumpButton.setVisible(latText.equals(invoker)  lonText.equals(invoker)); 809 String currentSOM = ProjectionPreference.PROP_SYSTEM_OF_MEASUREMENT.get();808 String currentSOM = SystemOfMeasurement.PROP_SYSTEM_OF_MEASUREMENT.get(); 810 809 for (JMenuItem item : somItems) { 811 810 item.setSelected(item.getText().equals(currentSOM)); … … 919 918 public void mouseClicked(MouseEvent e) { 920 919 if (!e.isPopupTrigger() && e.getButton() == MouseEvent.BUTTON1) { 921 String som = ProjectionPreference.PROP_SYSTEM_OF_MEASUREMENT.get();920 String som = SystemOfMeasurement.PROP_SYSTEM_OF_MEASUREMENT.get(); 922 921 String newsom = soms.get((soms.indexOf(som)+1) % soms.size()); 923 922 updateSystemOfMeasurement(newsom); 
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r12486 r12674 273 273 274 274 private static String projectionChoice; 275 275 276 276 private static final StringProperty PROP_PROJECTION_DEFAULT = new StringProperty("projection.default", mercator.getId()); 277 277 private static final StringProperty PROP_COORDINATES = new StringProperty("coordinates", null); 278 278 private static final CollectionProperty PROP_SUB_PROJECTION_DEFAULT = new CollectionProperty("projection.default.sub", null); 279 public static final StringProperty PROP_SYSTEM_OF_MEASUREMENT = new StringProperty("system_of_measurement", "Metric");280 279 private static final String[] unitsValues = ALL_SYSTEMS.keySet().toArray(new String[ALL_SYSTEMS.size()]); 281 280 private static final String[] unitsValuesTr = new String[unitsValues.length]; … … 339 338 340 339 for (int i = 0; i < unitsValues.length; ++i) { 341 if (unitsValues[i].equals( PROP_SYSTEM_OF_MEASUREMENT.get())) {340 if (unitsValues[i].equals(SystemOfMeasurement.PROP_SYSTEM_OF_MEASUREMENT.get())) { 342 341 unitsCombo.setSelectedIndex(i); 343 342 break;
Note: See TracChangeset
for help on using the changeset viewer.