Ignore:
Timestamp:
2017-08-27T17:29:32+02:00 (2 years ago)
Author:
Don-vip
Message:

see #15182 - move PROP_SYSTEM_OF_MEASUREMENT from gui.preferences.ProjectionPreferences to data.SystemOfMeasurment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java

    r12542 r12674  
    1313
    1414import org.openstreetmap.josm.Main;
    15 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
     15import org.openstreetmap.josm.data.preferences.StringProperty;
    1616
    1717/**
    1818 * A system of units used to express length and area measurements.
    1919 * <p>
    20  * This class also manages one globally set system of measurement stored in the {@link ProjectionPreference}
     20 * This class also manages one globally set system of measurement stored in the {@code ProjectionPreference}
    2121 * @since 3406 (creation)
    2222 * @since 6992 (extraction in this package)
    2323 */
    2424public 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");
    2531
    2632    /**
     
    116122     */
    117123    public static SystemOfMeasurement getSystemOfMeasurement() {
    118         return Optional.ofNullable(SystemOfMeasurement.ALL_SYSTEMS.get(ProjectionPreference.PROP_SYSTEM_OF_MEASUREMENT.get()))
     124        return Optional.ofNullable(SystemOfMeasurement.ALL_SYSTEMS.get(PROP_SYSTEM_OF_MEASUREMENT.get()))
    119125                .orElse(SystemOfMeasurement.METRIC);
    120126    }
     
    130136            throw new IllegalArgumentException("Invalid system of measurement: "+somKey);
    131137        }
    132         String oldKey = ProjectionPreference.PROP_SYSTEM_OF_MEASUREMENT.get();
    133         if (ProjectionPreference.PROP_SYSTEM_OF_MEASUREMENT.put(somKey)) {
     138        String oldKey = PROP_SYSTEM_OF_MEASUREMENT.get();
     139        if (PROP_SYSTEM_OF_MEASUREMENT.put(somKey)) {
    134140            fireSoMChanged(oldKey, somKey);
    135141        }
Note: See TracChangeset for help on using the changeset viewer.