- Timestamp:
- 2019-03-03T00:09:44+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
r14759 r14823 12 12 import java.util.ArrayList; 13 13 import java.util.Collection; 14 import java.util.HashMap; 14 15 import java.util.LinkedList; 15 16 import java.util.List; 16 17 import java.util.Map; 17 import java.util.concurrent.ConcurrentHashMap;18 18 19 19 import javax.swing.ImageIcon; … … 79 79 // will make gui for it so I'm keeping it here 80 80 81 private static final Map<String, TemplateEntryProperty> CACHE = new ConcurrentHashMap<>();81 private static final Map<String, TemplateEntryProperty> CACHE = new HashMap<>(); 82 82 83 83 public static TemplateEntryProperty forMarker(String layerName) { 84 84 String key = "draw.rawgps.layer.wpt.pattern"; 85 85 if (layerName != null) { 86 return CACHE.computeIfAbsent(key + '.' + layerName, k -> new TemplateEntryProperty(k, "", forMarker(null))); 87 } else { 88 return CACHE.computeIfAbsent(key, k -> new TemplateEntryProperty(k, LABEL_PATTERN_AUTO, null)); 89 } 86 key += '.' + layerName; 87 } 88 TemplateEntryProperty result = CACHE.get(key); 89 if (result == null) { 90 String defaultValue = layerName == null ? LABEL_PATTERN_AUTO : ""; 91 TemplateEntryProperty parent = layerName == null ? null : forMarker(null); 92 result = new TemplateEntryProperty(key, defaultValue, parent); 93 CACHE.put(key, result); 94 } 95 return result; 90 96 } 91 97 … … 93 99 String key = "draw.rawgps.layer.audiowpt.pattern"; 94 100 if (layerName != null) { 95 return CACHE.computeIfAbsent(key + '.' + layerName, k -> 96 new TemplateEntryProperty(k, "", forAudioMarker(null))); 97 } else { 98 return CACHE.computeIfAbsent(key, k -> 99 new TemplateEntryProperty(k, "?{ '{name}' | '{desc}' | '{" + MARKER_FORMATTED_OFFSET + "}' }", null)); 100 } 101 key += '.' + layerName; 102 } 103 TemplateEntryProperty result = CACHE.get(key); 104 if (result == null) { 105 String defaultValue = layerName == null ? "?{ '{name}' | '{desc}' | '{" + Marker.MARKER_FORMATTED_OFFSET + "}' }" : ""; 106 TemplateEntryProperty parent = layerName == null ? null : forAudioMarker(null); 107 result = new TemplateEntryProperty(key, defaultValue, parent); 108 CACHE.put(key, result); 109 } 110 return result; 101 111 } 102 112
Note:
See TracChangeset
for help on using the changeset viewer.