source: josm/trunk/src/org/openstreetmap/josm/data/preferences/BooleanProperty.java@ 3246

Last change on this file since 3246 was 3246, checked in by jttt, 14 years ago

Add simple wrapper for preferences, add projection changed event (will be used later to replace CachedLatLon)

  • Property svn:mime-type set to text/plain
File size: 555 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.preferences;
3
4import org.openstreetmap.josm.Main;
5
6public class BooleanProperty {
7
8 private final String key;
9 private final boolean defaultValue;
10
11 public BooleanProperty(String key, boolean defaultValue) {
12 this.key = key;
13 this.defaultValue = defaultValue;
14 }
15
16 public boolean get() {
17 return Main.pref.getBoolean(key, defaultValue);
18 }
19
20 public boolean put(boolean value) {
21 return Main.pref.put(key, value);
22 }
23
24}
Note: See TracBrowser for help on using the repository browser.