Changeset 13939 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2018-06-17T14:10:35+02:00 (16 months ago)
Author:
Don-vip
Message:

improve performance of validator visiting call

File:
1 edited

Legend:

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

    r12809 r13939  
    4141    public Icon icon;
    4242
     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");
     46
    4347    /**
    4448     * If the node has a name-key or id-key, this is displayed. If not, (lat,lon) is displayed.
     
    4751    public void visit(Node n) {
    4852        name = n.getDisplayName(DefaultNameFormatter.getInstance());
    49         icon = ImageProvider.get("data", "node");
     53        icon = nodeIcon;
    5054        className = "node";
    5155        classNamePlural = trn("node", "nodes", 2);
     
    5963    public void visit(Way w) {
    6064        name = w.getDisplayName(DefaultNameFormatter.getInstance());
    61         icon = ImageProvider.get("data", "way");
     65        icon = wayIcon;
    6266        className = "way";
    6367        classNamePlural = trn("way", "ways", 2);
     
    6771    public void visit(Relation e) {
    6872        name = e.getDisplayName(DefaultNameFormatter.getInstance());
    69         icon = ImageProvider.get("data", "relation");
     73        icon = relIcon;
    7074        className = "relation";
    7175        classNamePlural = trn("relation", "relations", 2);
Note: See TracChangeset for help on using the changeset viewer.