Changeset 5169 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-04-05T17:29:22+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5164 r5169 1692 1692 } 1693 1693 1694 public boolean typeMatches(Collection<PresetType> t) { 1695 return t == null || types == null || types.containsAll(t); 1696 } 1697 1694 1698 public boolean matches(Collection<PresetType> t, Map<String, String> tags, boolean onlyShowable) { 1695 1699 if (onlyShowable && !isShowable()) { 1696 1700 return false; 1697 } else if ( t != null && types != null && !types.containsAll(t)) {1701 } else if (!typeMatches(t)) { 1698 1702 return false; 1699 1703 } -
trunk/src/org/openstreetmap/josm/tools/TaggingPresetNameTemplateList.java
r5163 r5169 2 2 package org.openstreetmap.josm.tools; 3 3 4 import java.util.EnumSet; 4 import java.util.Collection; 5 import java.util.Collections; 5 6 import java.util.LinkedList; 6 7 import java.util.List; … … 39 40 40 41 for (TaggingPreset t : presetsWithPattern) { 41 if (t.matches(EnumSet.of(PresetType.forPrimitive(primitive)), primitive.getKeys(), false)) { 42 return t; 42 Collection<PresetType> type = Collections.singleton(PresetType.forPrimitive(primitive)); 43 if (t.typeMatches(type)) { 44 if (t.nameTemplateFilter != null) { 45 if (t.nameTemplateFilter.match(primitive)) 46 return t; 47 else { 48 continue; 49 } 50 } else if (t.matches(type, primitive.getKeys(), false)) { 51 return t; 52 } 43 53 } 44 54 }
Note:
See TracChangeset
for help on using the changeset viewer.