Ignore:
Timestamp:
2022-01-25T01:04:25+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #21767 - Update deprecated functions in opendata (patch by taylor.smock)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/SimpleDataSetHandler.java

    r34661 r35899  
    1616
    1717import org.openstreetmap.josm.data.osm.IPrimitive;
     18import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1819import org.openstreetmap.josm.data.osm.Tag;
    1920import org.openstreetmap.josm.data.projection.Projection;
    20 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    2121import org.openstreetmap.josm.plugins.opendata.core.OdConstants;
    2222import org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi;
     23import org.openstreetmap.josm.tools.ImageResource;
     24import org.openstreetmap.josm.tools.OsmPrimitiveImageProvider;
    2325
    2426public abstract class SimpleDataSetHandler extends AbstractDataSetHandler {
     
    4547            tag = new Tag(relevantTag);
    4648        }
    47         setMenuIcon(MapPaintStyles.getNodeIcon(tag));
     49        OsmPrimitiveImageProvider.getResource(tag.getKey(), tag.getValue(), OsmPrimitiveType.NODE)
     50                .map(ImageResource::getImageIcon).ifPresent(this::setMenuIcon);
    4851    }
    4952
Note: See TracChangeset for help on using the changeset viewer.