Changeset 16179 in josm for trunk/src/org
- Timestamp:
- 2020-03-21T10:38:57+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/tagging/presets
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java
r16080 r16179 36 36 37 37 // cache the parsing of types using a LRU cache 38 private static final Map<String, Set<TaggingPresetType>> TYPE_CACHE = new LruCache<>(16); ;38 private static final Map<String, Set<TaggingPresetType>> TYPE_CACHE = new LruCache<>(16); 39 39 40 40 protected void initAutoCompletionField(AutoCompletingTextField field, String... key) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
r16069 r16179 245 245 if (all.contains(tp)) { 246 246 lastmenuOriginal = tp; 247 java.util.Optional<TaggingPreset> val = all.stream().filter(tp::equals).findFirst(); 248 if (val.isPresent()) 249 tp = (TaggingPresetMenu) val.get(); 247 tp = (TaggingPresetMenu) all.stream().filter(tp::equals).findFirst().orElse(tp); 250 248 lastmenuOriginal.group = null; 251 249 } else { … … 435 433 } 436 434 435 /** 436 * Returns the zip file where the icons are located 437 * @return the zip file where the icons are located 438 */ 437 439 public static File getZipIcons() { 438 440 return zipIcons; -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
r16045 r16179 345 345 Collections.sort(result); 346 346 return result; 347 348 } 349 347 } 348 349 /** 350 * Clears the selector. 351 */ 350 352 public void clear() { 351 353 classifications.clear(); 352 354 } 353 355 356 /** 357 * Loads a given collection of presets. 358 * @param presets presets collection 359 */ 354 360 public void loadPresets(Collection<TaggingPreset> presets) { 355 361 for (TaggingPreset preset : presets) { … … 395 401 } 396 402 403 /** 404 * Initializes the selector with a given collection of presets. 405 * @param presets presets collection 406 */ 397 407 public void init(Collection<TaggingPreset> presets) { 398 408 classifications.clear(); … … 442 452 } 443 453 454 /** 455 * Selects a given preset. 456 * @param p preset to select 457 */ 444 458 public synchronized void setSelectedPreset(TaggingPreset p) { 445 459 lsResult.setSelectedValue(p, true); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r16089 r16179 547 547 } 548 548 549 /** 550 * Sets whether the last value is used as default. 551 * @param v Using "force" (2) enforces this behaviour also for already tagged objects. Default is "false" (0). 552 */ 549 553 public void setUse_last_as_default(String v) { // NOPMD 550 554 if ("force".equals(v)) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java
r16042 r16179 40 40 */ 41 41 public static class Role { 42 /** Presets types expected for this role */ 42 43 public Set<TaggingPresetType> types; // NOSONAR 43 44 /** Role name used in a relation */ … … 58 59 private short count; 59 60 61 /** 62 * Sets the presets types expected for this role. 63 * @param types comma-separated set of expected types 64 * @throws SAXException if an unknown type is detected 65 */ 60 66 public void setType(String types) throws SAXException { 61 67 this.types = getType(types); 62 68 } 63 69 70 /** 71 * Sets wether this role is required at least once in the relation. 72 * @param str "required" or "optional" 73 * @throws SAXException if str is neither "required" or "optional" 74 */ 64 75 public void setRequisite(String str) throws SAXException { 65 76 if ("required".equals(str)) { … … 69 80 } 70 81 82 /** 83 * Sets wether the role name is a regular expression. 84 * @param str "true" or "false" 85 * @throws SAXException if str is neither "true" or "false" 86 */ 71 87 public void setRegexp(String str) throws SAXException { 72 88 if ("true".equals(str)) { … … 76 92 } 77 93 94 /** 95 * Sets an expression (cf. search dialog) for objects of this role 96 * @param memberExpression an expression (cf. search dialog) for objects of this role 97 * @throws SAXException in case of parsing error 98 */ 78 99 public void setMember_expression(String memberExpression) throws SAXException { 79 100 try { … … 88 109 } 89 110 111 /** 112 * Sets how often must the element appear. 113 * @param count how often must the element appear 114 */ 90 115 public void setCount(String count) { 91 116 this.count = Short.parseShort(count); … … 122 147 } 123 148 149 /** 150 * Adds this role to the given panel. 151 * @param p panel where to add this role 152 * @return {@code true} 153 */ 124 154 public boolean addToPanel(JPanel p) { 125 155 String cstring;
Note:
See TracChangeset
for help on using the changeset viewer.