Changeset 9265 in josm
- Timestamp:
- 2016-01-02T18:34:21+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java
r8982 r9265 12 12 13 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 15 import org.openstreetmap.josm.gui.MenuScroller; 15 16 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 17 import org.openstreetmap.josm.tools.Predicate; 18 import org.openstreetmap.josm.tools.Utils; 16 19 17 20 /** … … 93 96 } 94 97 98 public static Collection<TaggingPreset> getMatchingPresets(final OsmPrimitive primitive) { 99 return Utils.filter(getTaggingPresets(), new Predicate<TaggingPreset>() { 100 @Override 101 public boolean evaluate(TaggingPreset object) { 102 return object.evaluate(primitive); 103 } 104 }); 105 } 106 95 107 /** 96 108 * Adds a list of tagging presets to the current list. -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r9253 r9265 65 65 import org.openstreetmap.josm.gui.mappaint.Range; 66 66 import org.openstreetmap.josm.gui.mappaint.StyleCache.StyleList; 67 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 68 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 67 69 import org.openstreetmap.josm.io.CachedFile; 68 70 import org.openstreetmap.josm.plugins.PluginHandler; … … 1331 1333 return new ImageIcon(image); 1332 1334 } 1335 } 1336 } 1337 } 1338 1339 // Check if the presets have icons for nodes/relations. 1340 if (!OsmPrimitiveType.WAY.equals(primitive.getType())) { 1341 for (final TaggingPreset preset : TaggingPresets.getMatchingPresets(primitive)) { 1342 if (preset.getIcon() != null) { 1343 return preset.getIcon(); 1333 1344 } 1334 1345 }
Note:
See TracChangeset
for help on using the changeset viewer.