Changeset 30045 in osm for applications/editors/josm/plugins/buildings_tools/src/buildings_tools/ToolSettings.java
- Timestamp:
- 2013-11-07T13:37:16+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/ToolSettings.java
r28529 r30045 1 // License: GPL. For details, see LICENSE file. 1 2 package buildings_tools; 2 3 … … 13 14 import org.openstreetmap.josm.data.preferences.BooleanProperty; 14 15 15 public class ToolSettings { 16 public static BooleanProperty PROP_USE_ADDR_NODE = new BooleanProperty("buildings_tools.addrNode", false); 16 public final class ToolSettings { 17 18 private ToolSettings() { 19 // Hide default constructor for utils classes 20 } 21 22 public static final BooleanProperty PROP_USE_ADDR_NODE = new BooleanProperty("buildings_tools.addrNode", false); 17 23 private static double width = 0; 18 24 private static double lenstep = 0; 19 25 private static boolean useAddr; 20 private static final Map<String, String> tags= new HashMap<String, String>();26 private static final Map<String, String> TAGS = new HashMap<String, String>(); 21 27 private static boolean autoSelect; 22 28 … … 44 50 public static Map<String, String> getTags() { 45 51 loadTags(); 46 return tags;52 return TAGS; 47 53 } 48 54 49 55 public static void saveTags() { 50 ArrayList<String> values = new ArrayList<String>( tags.size() * 2);51 for (Entry<String, String> entry : tags.entrySet()) {56 ArrayList<String> values = new ArrayList<String>(TAGS.size() * 2); 57 for (Entry<String, String> entry : TAGS.entrySet()) { 52 58 values.add(entry.getKey()); 53 59 values.add(entry.getValue()); … … 57 63 58 64 private static void loadTags() { 59 tags.clear();65 TAGS.clear(); 60 66 Collection<String> values = Main.pref.getCollection("buildings_tools.tags", 61 Arrays.asList(new String[] { "building", "yes"}));67 Arrays.asList(new String[] {"building", "yes"})); 62 68 try { 63 69 for (Iterator<String> iterator = values.iterator(); iterator.hasNext();) { 64 tags.put(iterator.next(), iterator.next());70 TAGS.put(iterator.next(), iterator.next()); 65 71 } 66 72 } catch (NoSuchElementException e) { 73 Main.warn(e); 67 74 } 68 69 75 } 70 76
Note:
See TracChangeset
for help on using the changeset viewer.