Changeset 1222 in josm for trunk/src/org
- Timestamp:
- 2009-01-09T11:34:51+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/audio/AudioBackAction.java
r1181 r1222 20 20 super(tr("Back"), "audio-back", tr("Jump back."), 21 21 Shortcut.registerShortcut("audio:back", tr("Audio: {0}", tr("Back")), KeyEvent.VK_F6, Shortcut.GROUP_DIRECT), true); 22 amount = -Main.pref.getDouble("audio.forwardbackamount", 10.0);22 amount = -Main.pref.getDouble("audio.forwardbackamount","10.0"); 23 23 this.putValue("help", "Action/Back"); 24 24 } -
trunk/src/org/openstreetmap/josm/actions/audio/AudioFwdAction.java
r1181 r1222 20 20 super(tr("Forward"), "audio-fwd", tr("Jump forward"), 21 21 Shortcut.registerShortcut("audio:forward", tr("Audio: {0}", tr("Forward")), KeyEvent.VK_F7, Shortcut.GROUP_DIRECT), true); 22 amount = Main.pref.getDouble("audio.forwardbackamount", 10.0);22 amount = Main.pref.getDouble("audio.forwardbackamount","10.0"); 23 23 } 24 24 -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r1221 r1222 23 23 24 24 import org.openstreetmap.josm.Main; 25 import org.openstreetmap.josm.actions.AboutAction; 25 26 import org.openstreetmap.josm.gui.preferences.ProxyPreferences; 26 27 import org.openstreetmap.josm.tools.ColorHelper; … … 236 237 else 237 238 properties.put(key, value); 238 save(); 239 String s = defaults.get(key); 240 if(s == null || !s.equals(value)) 241 save(); 239 242 firePreferenceChanged(key, value); 240 243 return true; … … 265 268 */ 266 269 public void save() { 270 /* currently unused, but may help to fix configuration issues in future */ 271 properties.put("josm.version", AboutAction.getVersionString()); 267 272 try { 268 273 setSystemProperties(); 269 274 final PrintWriter out = new PrintWriter(new FileWriter(getPreferencesDir() + "preferences"), false); 270 275 for (final Entry<String, String> e : properties.entrySet()) { 271 out.println(e.getKey() + "=" + e.getValue()); 276 String s = defaults.get(e.getKey()); 277 /* don't save default values */ 278 if(s == null || !s.equals(e.getValue())) 279 out.println(e.getKey() + "=" + e.getValue()); 272 280 } 273 281 out.close(); … … 300 308 public final void resetToDefault() { 301 309 properties.clear(); 302 properties.put("projection", "org.openstreetmap.josm.data.projection.Epsg4326"); 303 properties.put("draw.segment.direction", "true"); 304 properties.put("draw.wireframe", "false"); 305 properties.put("layerlist.visible", "true"); 306 properties.put("propertiesdialog.visible", "true"); 307 properties.put("selectionlist.visible", "true"); 308 properties.put("commandstack.visible", "true"); 309 properties.put("osm-server.url", "http://www.openstreetmap.org/api"); 310 put("layerlist.visible", true); 311 put("propertiesdialog.visible", true); 312 put("selectionlist.visible", true); 313 put("commandstack.visible", true); 314 put("osm-server.url", "http://www.openstreetmap.org/api"); 310 315 if (System.getProperty("os.name").toUpperCase().indexOf("WINDOWS") == -1) { 311 p roperties.put("laf", "javax.swing.plaf.metal.MetalLookAndFeel");316 put("laf", "javax.swing.plaf.metal.MetalLookAndFeel"); 312 317 } else { 313 p roperties.put("laf", "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");318 put("laf", "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); 314 319 } 315 320 save(); … … 425 430 } 426 431 return def; 432 } 433 434 synchronized public double getDouble(String key, String def) { 435 putDefault(key, def); 436 String v = get(key); 437 try { 438 return Double.parseDouble(v == null ? def : v); 439 } catch(NumberFormatException e) { 440 // fall out 441 } 442 return 0.0; 427 443 } 428 444 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1221 r1222 98 98 99 99 protected void getSettings(Boolean virtual) { 100 showDirectionArrow = Main.pref.getBoolean("draw.segment.direction" );100 showDirectionArrow = Main.pref.getBoolean("draw.segment.direction", true); 101 101 showRelevantDirectionsOnly = Main.pref.getBoolean("draw.segment.relevant_directions_only", true); 102 showOrderNumber = Main.pref.getBoolean("draw.segment.order_number" );102 showOrderNumber = Main.pref.getBoolean("draw.segment.order_number", false); 103 103 selectedNodeRadius = Main.pref.getInteger("mappaint.node.selected-size", 5) / 2; 104 104 selectedNodeSize = selectedNodeRadius * 2; -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r1219 r1222 246 246 add(presetsMenu, KeyEvent.VK_P, "presets"); 247 247 248 if (!Main.pref.getBoolean("audio.menuinvisible" )) {248 if (!Main.pref.getBoolean("audio.menuinvisible", false)) { 249 249 add(audioMenu, audioPlayPause); 250 250 add(audioMenu, audioNext); -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r1169 r1222 49 49 { 50 50 int i = colString.indexOf("#"); 51 String colorString;51 Color ret; 52 52 if(i < 0) // name only 53 colorString = Main.pref.get("color.mappaint."+styleName+"."+colString);53 ret = Main.pref.getColor("mappaint."+styleName+"."+colString, Color.red); 54 54 else if(i == 0) // value only 55 colorString = colString;55 ret = ColorHelper.html2color(colString); 56 56 else // value and name 57 colorString = Main.pref.get("color.mappaint."+styleName+"."+colString.substring(0,i), colString.substring(i)); 58 return ColorHelper.html2color(colorString); 57 ret = Main.pref.getColor("mappaint."+styleName+"."+colString.substring(0,i), 58 ColorHelper.html2color(colString.substring(i))); 59 return ret; 59 60 } 60 61 -
trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
r1216 r1222 126 126 }); 127 127 directionHint.setToolTipText(tr("Draw direction hints for way segments.")); 128 directionHint.setSelected(Main.pref.getBoolean("draw.segment.direction" ));128 directionHint.setSelected(Main.pref.getBoolean("draw.segment.direction", true)); 129 129 panel.add(directionHint, GBC.eop().insets(20,0,0,0)); 130 130 … … 137 137 // segment order number 138 138 segmentOrderNumber.setToolTipText(tr("Draw the order numbers of all segments within their way.")); 139 segmentOrderNumber.setSelected(Main.pref.getBoolean("draw.segment.order_number" ));139 segmentOrderNumber.setSelected(Main.pref.getBoolean("draw.segment.order_number", false)); 140 140 panel.add(segmentOrderNumber, GBC.eop().insets(20,0,0,0)); 141 141 142 142 // antialiasing 143 143 useAntialiasing.setToolTipText(tr("Apply antialiasing to the map view resulting in a smoother appearance.")); 144 useAntialiasing.setSelected(Main.pref.getBoolean("mappaint.use-antialiasing" ));144 useAntialiasing.setSelected(Main.pref.getBoolean("mappaint.use-antialiasing", false)); 145 145 panel.add(useAntialiasing, GBC.eop().insets(20,0,0,0)); 146 146 -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r1169 r1222 51 51 } 52 52 53 if ( Boolean.parseBoolean(Main.pref.get("osm-server.use-compression", "true")))53 if (Main.pref.getBoolean("osm-server.use-compression", true)) 54 54 activeConnection.setRequestProperty("Accept-Encoding", "gzip, deflate"); 55 55
Note:
See TracChangeset
for help on using the changeset viewer.