Changeset 7797 in josm
- Timestamp:
- 2014-12-12T01:43:35+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r7563 r7797 22 22 import org.openstreetmap.josm.Main; 23 23 import org.openstreetmap.josm.data.coor.LatLon; 24 import org.openstreetmap.josm.data.osm.DataSet; 24 25 import org.openstreetmap.josm.data.osm.Node; 25 26 import org.openstreetmap.josm.data.osm.Tag; … … 139 140 } 140 141 142 /** 143 * Returns the node icon that would be displayed for the given tag. 144 * @param tag The tag to look an icon for 145 * @param includeDeprecatedIcon if {@code true}, the special deprecated icon will be returned if applicable 146 * @return {@code null} if no icon found, or if the icon is deprecated and not wanted 147 */ 141 148 public static ImageIcon getNodeIcon(Tag tag, boolean includeDeprecatedIcon) { 142 149 if (tag != null) { 150 DataSet ds = new DataSet(); 143 151 Node virtualNode = new Node(LatLon.ZERO); 144 152 virtualNode.put(tag.getKey(), tag.getValue()); … … 146 154 MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock(); 147 155 try { 156 // Add primitive to dataset to avoid DataIntegrityProblemException when evaluating selectors 157 ds.addPrimitive(virtualNode); 148 158 styleList = getStyles().generateStyles(virtualNode, 0.5, false).a; 159 ds.removePrimitive(virtualNode); 149 160 } finally { 150 161 MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
Note:
See TracChangeset
for help on using the changeset viewer.