Changeset 14864 in josm


Ignore:
Timestamp:
2019-03-09T19:09:07+01:00 (11 months ago)
Author:
GerdP
Message:

simplify code, no need to duplicate the EnumMap created in ImageProvider in r14331

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java

    r10216 r14864  
    55
    66import java.awt.Component;
    7 import java.util.EnumMap;
    8 import java.util.Map;
    97
    10 import javax.swing.ImageIcon;
    118import javax.swing.JLabel;
    129import javax.swing.JTable;
    1310import javax.swing.table.TableCellRenderer;
    1411
    15 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1612import org.openstreetmap.josm.data.osm.RelationMemberData;
    1713import org.openstreetmap.josm.gui.history.TwoColumnDiff.Item;
     
    2521public class RelationMemberListTableCellRenderer extends JLabel implements TableCellRenderer {
    2622
    27     private final transient Map<OsmPrimitiveType, ImageIcon> icons;
    28 
    2923    /**
    3024     * Constructs a new {@code RelationMemberListTableCellRenderer}.
     
    3226    public RelationMemberListTableCellRenderer() {
    3327        setOpaque(true);
    34         icons = new EnumMap<>(OsmPrimitiveType.class);
    35         icons.put(OsmPrimitiveType.NODE, ImageProvider.get("data", "node"));
    36         icons.put(OsmPrimitiveType.WAY, ImageProvider.get("data", "way"));
    37         icons.put(OsmPrimitiveType.RELATION, ImageProvider.get("data", "relation"));
    3828    }
    3929
     
    4232            setIcon(null);
    4333        } else {
    44             setIcon(icons.get(member.getMemberType()));
     34            setIcon(ImageProvider.get(member.getMemberType()));
    4535        }
    4636    }
Note: See TracChangeset for help on using the changeset viewer.