Changeset 16269 in josm for trunk/scripts
- Timestamp:
- 2020-04-12T14:55:05+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/TagInfoExtract.java
r16234 r16269 268 268 : Collections.emptyList(); 269 269 for (String value : values) { 270 final Set<TagInfoTag.Type> types = preset.types == null ? Collections.emptySet() : preset.types.stream() 271 .map(it -> TaggingPresetType.CLOSEDWAY.equals(it) 272 ? TagInfoTag.Type.AREA 273 : TaggingPresetType.MULTIPOLYGON.equals(it) 274 ? TagInfoTag.Type.RELATION 275 : TagInfoTag.Type.valueOf(it.toString())) 276 .collect(Collectors.toCollection(() -> EnumSet.noneOf(TagInfoTag.Type.class))); 270 final Set<TagInfoTag.Type> types = TagInfoTag.Type.forPresetTypes(preset.types); 277 271 tags.add(new TagInfoTag(descriptionPrefix + preset.getName(), item.key, value, types, 278 272 addImages && preset.iconName != null ? options.findImageUrl(preset.iconName) : null)); … … 563 557 564 558 enum Type { 565 NODE, WAY, AREA, RELATION 559 NODE, WAY, AREA, RELATION; 560 561 static TagInfoTag.Type forPresetType(TaggingPresetType type) { 562 switch (type) { 563 case CLOSEDWAY: 564 return AREA; 565 case MULTIPOLYGON: 566 return RELATION; 567 default: 568 return valueOf(type.toString()); 569 } 570 } 571 572 static Set<TagInfoTag.Type> forPresetTypes(Set<TaggingPresetType> types) { 573 if (types == null) { 574 return Collections.emptySet(); 575 } 576 return types.stream() 577 .map(Type::forPresetType) 578 .collect(Collectors.toCollection(() -> EnumSet.noneOf(Type.class))); 579 } 566 580 } 567 581 }
Note:
See TracChangeset
for help on using the changeset viewer.