Changeset 34554 in osm


Ignore:
Timestamp:
2018-08-18T20:13:39+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/routing
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/routing/build.xml

    r33891 r34554  
    55    <property name="commit.message" value="added one-way support in roundabouts"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="12987"/>
     7    <property name="plugin.main.version" value="14153"/>
    88
    99    <!--
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingProfile.java

    r32768 r34554  
    66
    77import org.apache.log4j.Logger;
    8 import org.openstreetmap.josm.Main;
     8import org.openstreetmap.josm.data.Preferences;
    99
    1010
     
    7777        this.name = name;
    7878        waySpeeds = new HashMap<>();
    79         Map<String, String> prefs = Main.pref.getAllPrefix("routing.profile."+name+".speed");
     79        Map<String, String> prefs = Preferences.main().getAllPrefix("routing.profile."+name+".speed");
    8080        for (String key:prefs.keySet()) {
    8181            waySpeeds.put((key.split("\\.")[4]), Double.valueOf(prefs.get(key)));
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java

    r34054 r34554  
    2121
    2222import org.apache.log4j.Logger;
    23 import org.openstreetmap.josm.Main;
    2423import org.openstreetmap.josm.actions.RenameLayerAction;
    2524import org.openstreetmap.josm.data.Bounds;
     
    3534import org.openstreetmap.josm.gui.layer.Layer;
    3635import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     36import org.openstreetmap.josm.spi.preferences.Config;
    3737import org.openstreetmap.josm.tools.ColorHelper;
    3838import org.openstreetmap.josm.tools.ImageProvider;
     
    214214
    215215        // Get path stroke width from preferences
    216         String widthString = Main.pref.get(PreferencesKeys.KEY_ROUTE_WIDTH.key);
     216        String widthString = Config.getPref().get(PreferencesKeys.KEY_ROUTE_WIDTH.key);
    217217        if (widthString.length() == 0) {
    218218            widthString = "2";                        /* I think 2 is better  */
    219             // FIXME add after good width is found: Main.pref.put(KEY_ROUTE_WIDTH, widthString);
     219            // FIXME add after good width is found: Config.getPref().put(KEY_ROUTE_WIDTH, widthString);
    220220        }
    221221        int width = Integer.parseInt(widthString);
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java

    r33794 r34554  
    2727
    2828import org.apache.log4j.Logger;
    29 import org.openstreetmap.josm.Main;
     29import org.openstreetmap.josm.data.Preferences;
    3030import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
    3131import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     32import org.openstreetmap.josm.spi.preferences.Config;
    3233import org.openstreetmap.josm.tools.GBC;
    3334
     
    156157                String origValue = orig.get(key);
    157158                if (origValue == null || !origValue.equals(value))
    158                     Main.pref.put(key, value);
     159                    Config.getPref().put(key, value);
    159160                orig.remove(key); // processed.
    160161            }
    161162        }
    162163        for (Entry<String, String> e : orig.entrySet()) {
    163             Main.pref.put(e.getKey(), null);
     164            Config.getPref().put(e.getKey(), null);
    164165        }
    165166        return false;
     
    189190
    190191    private void readPreferences() {
    191         orig = Main.pref.getAllPrefix("routing.profile.default.speed");
     192        orig = Preferences.main().getAllPrefix("routing.profile.default.speed");
    192193        if (orig.size() == 0) { // defaults
    193194            logger.debug("Loading Default Preferences.");
    194195            for (OsmWayTypes owt : OsmWayTypes.values()) {
    195                 Main.pref.putInt("routing.profile.default.speed."
     196                Config.getPref().putInt("routing.profile.default.speed."
    196197                        + owt.getTag(), owt.getSpeed());
    197198            }
    198             orig = Main.pref.getAllPrefix("routing.profile.default.speed");
     199            orig = Preferences.main().getAllPrefix("routing.profile.default.speed");
    199200        } else logger.debug("Default preferences already exist.");
    200201    }
Note: See TracChangeset for help on using the changeset viewer.