Changeset 12967 in josm


Ignore:
Timestamp:
2017-10-09T21:05:03+02:00 (2 months ago)
Author:
Don-vip
Message:

see #15273 - fix initialization of MapPaintStyles (NPE)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r12846 r12967  
    4646            "misc/deprecated.png");
    4747
     48    private static final ListenerList<MapPaintSylesUpdateListener> listeners = ListenerList.createUnchecked();
     49
     50    static {
     51        listeners.addListener(new MapPaintSylesUpdateListener() {
     52            @Override
     53            public void mapPaintStylesUpdated() {
     54                SwingUtilities.invokeLater(styles::clearCached);
     55            }
     56
     57            @Override
     58            public void mapPaintStyleEntryUpdated(int index) {
     59                mapPaintStylesUpdated();
     60            }
     61        });
     62    }
     63
    4864    private static ElemStyles styles = new ElemStyles();
    4965
     
    441457    }
    442458
    443     private static final ListenerList<MapPaintSylesUpdateListener> listeners = ListenerList.createUnchecked();
    444 
    445     static {
    446         listeners.addListener(new MapPaintSylesUpdateListener() {
    447             @Override
    448             public void mapPaintStylesUpdated() {
    449                 SwingUtilities.invokeLater(styles::clearCached);
    450             }
    451 
    452             @Override
    453             public void mapPaintStyleEntryUpdated(int index) {
    454                 mapPaintStylesUpdated();
    455             }
    456         });
    457     }
    458 
    459459    /**
    460460     * Add a listener that listens to global style changes.
Note: See TracChangeset for help on using the changeset viewer.