Changeset 27760 in osm for applications/editors/josm/plugins/routing/src/com/innovant
- Timestamp:
- 2012-02-14T21:43:28+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/routing/src/com/innovant/josm
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java
r26119 r27760 27 27 28 28 package com.innovant.josm.plugin.routing; 29 30 import static org.openstreetmap.josm.tools.I18n.marktr; 29 31 30 32 import java.awt.BasicStroke; … … 59 61 import org.openstreetmap.josm.tools.ImageProvider; 60 62 61 import com.innovant.josm.jrt.core.PreferencesKeys;62 63 import com.innovant.josm.jrt.osm.OsmEdge; 63 64 … … 69 70 */ 70 71 public class RoutingLayer extends Layer { 72 73 public enum PreferencesKeys { 74 KEY_ACTIVE_ROUTE_COLOR (marktr("routing active route")), 75 KEY_INACTIVE_ROUTE_COLOR (marktr("routing inactive route")), 76 KEY_ROUTE_WIDTH ("routing.route.width"), 77 KEY_ROUTE_SELECT ("routing.route.select"); 78 79 public final String key; 80 PreferencesKeys (String key) { 81 this.key=key; 82 } 83 84 public String getKey() {return key;}; 85 } 71 86 72 87 /** … … 240 255 // Get path stroke color from preferences 241 256 // Color is different for active and inactive layers 242 String colorString;257 Color color; 243 258 if (isActiveLayer) { 244 if (Main.pref.hasKey(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.key)) 245 colorString = Main.pref.get(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.key); 246 else { 247 colorString = ColorHelper.color2html(Color.RED); 248 Main.pref.put(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.key, colorString); 249 } 259 color = Main.pref.getColor(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.key, Color.RED); 250 260 } else { 251 if (Main.pref.hasKey(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.key)) 252 colorString = Main.pref.get(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.key); 253 else { 254 colorString = ColorHelper.color2html(Color.decode("#dd2222")); 255 Main.pref.put(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.key, colorString); 256 } 257 } 258 Color color = ColorHelper.html2color(colorString); 261 color = Main.pref.getColor(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.key, Color.decode("#dd2222")); 262 } 259 263 260 264 // Get path stroke width from preferences
Note:
See TracChangeset
for help on using the changeset viewer.