Changeset 15668 in josm for trunk/src


Ignore:
Timestamp:
2020-01-10T00:02:42+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #18540 - use correct primitive icons in validator dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/util/NameVisitor.java

    r13939 r15668  
    99import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
    1010import org.openstreetmap.josm.data.osm.Node;
     11import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1112import org.openstreetmap.josm.data.osm.Relation;
    1213import org.openstreetmap.josm.data.osm.Way;
     
    4142    public Icon icon;
    4243
    43     private static final Icon nodeIcon = ImageProvider.get("data", "node");
    44     private static final Icon wayIcon = ImageProvider.get("data", "way");
    45     private static final Icon relIcon = ImageProvider.get("data", "relation");
     44    protected void setIcon(OsmPrimitive p) {
     45        icon = ImageProvider.get(p.getDisplayType());
     46    }
    4647
    4748    /**
     
    5152    public void visit(Node n) {
    5253        name = n.getDisplayName(DefaultNameFormatter.getInstance());
    53         icon = nodeIcon;
     54        setIcon(n);
    5455        className = "node";
    5556        classNamePlural = trn("node", "nodes", 2);
     
    6364    public void visit(Way w) {
    6465        name = w.getDisplayName(DefaultNameFormatter.getInstance());
    65         icon = wayIcon;
     66        setIcon(w);
    6667        className = "way";
    6768        classNamePlural = trn("way", "ways", 2);
     
    7172    public void visit(Relation e) {
    7273        name = e.getDisplayName(DefaultNameFormatter.getInstance());
    73         icon = relIcon;
     74        setIcon(e);
    7475        className = "relation";
    7576        classNamePlural = trn("relation", "relations", 2);
Note: See TracChangeset for help on using the changeset viewer.