Changeset 34554 in osm
- Timestamp:
- 2018-08-18T20:13:39+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/routing
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routing/build.xml
r33891 r34554 5 5 <property name="commit.message" value="added one-way support in roundabouts"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 2987"/>7 <property name="plugin.main.version" value="14153"/> 8 8 9 9 <!-- -
applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingProfile.java
r32768 r34554 6 6 7 7 import org.apache.log4j.Logger; 8 import org.openstreetmap.josm. Main;8 import org.openstreetmap.josm.data.Preferences; 9 9 10 10 … … 77 77 this.name = name; 78 78 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"); 80 80 for (String key:prefs.keySet()) { 81 81 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 21 21 22 22 import org.apache.log4j.Logger; 23 import org.openstreetmap.josm.Main;24 23 import org.openstreetmap.josm.actions.RenameLayerAction; 25 24 import org.openstreetmap.josm.data.Bounds; … … 35 34 import org.openstreetmap.josm.gui.layer.Layer; 36 35 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 36 import org.openstreetmap.josm.spi.preferences.Config; 37 37 import org.openstreetmap.josm.tools.ColorHelper; 38 38 import org.openstreetmap.josm.tools.ImageProvider; … … 214 214 215 215 // 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); 217 217 if (widthString.length() == 0) { 218 218 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); 220 220 } 221 221 int width = Integer.parseInt(widthString); -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java
r33794 r34554 27 27 28 28 import org.apache.log4j.Logger; 29 import org.openstreetmap.josm. Main;29 import org.openstreetmap.josm.data.Preferences; 30 30 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 31 31 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 32 import org.openstreetmap.josm.spi.preferences.Config; 32 33 import org.openstreetmap.josm.tools.GBC; 33 34 … … 156 157 String origValue = orig.get(key); 157 158 if (origValue == null || !origValue.equals(value)) 158 Main.pref.put(key, value);159 Config.getPref().put(key, value); 159 160 orig.remove(key); // processed. 160 161 } 161 162 } 162 163 for (Entry<String, String> e : orig.entrySet()) { 163 Main.pref.put(e.getKey(), null);164 Config.getPref().put(e.getKey(), null); 164 165 } 165 166 return false; … … 189 190 190 191 private void readPreferences() { 191 orig = Main.pref.getAllPrefix("routing.profile.default.speed");192 orig = Preferences.main().getAllPrefix("routing.profile.default.speed"); 192 193 if (orig.size() == 0) { // defaults 193 194 logger.debug("Loading Default Preferences."); 194 195 for (OsmWayTypes owt : OsmWayTypes.values()) { 195 Main.pref.putInt("routing.profile.default.speed."196 Config.getPref().putInt("routing.profile.default.speed." 196 197 + owt.getTag(), owt.getSpeed()); 197 198 } 198 orig = Main.pref.getAllPrefix("routing.profile.default.speed");199 orig = Preferences.main().getAllPrefix("routing.profile.default.speed"); 199 200 } else logger.debug("Default preferences already exist."); 200 201 }
Note:
See TracChangeset
for help on using the changeset viewer.