Changeset 8020 in josm


Ignore:
Timestamp:
2015-02-09T13:57:33+01:00 (9 years ago)
Author:
bastiK
Message:

see #11090 - make sure modifications to the current MapFrame are done when loading plugin at runtime

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r8015 r8020  
    15661566     * Registers a new {@code MapFrameListener} that will be notified of MapFrame changes
    15671567     * @param listener The MapFrameListener
     1568     * @param fireWhenMapViewPresent If true, will fire an initial mapFrameInitialized event
     1569     * when the MapFrame is present. Otherwise will only fire when the MapFrame is created
     1570     * or destroyed.
     1571     * @return {@code true} if the listeners collection changed as a result of the call
     1572     */
     1573    public static boolean addMapFrameListener(MapFrameListener listener, boolean fireWhenMapViewPresent) {
     1574        boolean changed = listener != null ? mapFrameListeners.add(listener) : false;
     1575        if (fireWhenMapViewPresent && changed && map != null) {
     1576            listener.mapFrameInitialized(null, map);
     1577        }
     1578        return changed;
     1579    }
     1580
     1581    /**
     1582     * Registers a new {@code MapFrameListener} that will be notified of MapFrame changes
     1583     * @param listener The MapFrameListener
    15681584     * @return {@code true} if the listeners collection changed as a result of the call
    15691585     * @since 5957
    15701586     */
    15711587    public static boolean addMapFrameListener(MapFrameListener listener) {
    1572         return listener != null ? mapFrameListeners.add(listener) : false;
     1588        return addMapFrameListener(listener, false);
    15731589    }
    15741590
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r8017 r8020  
    614614                PluginProxy pluginProxy = plugin.load(klass);
    615615                pluginList.add(pluginProxy);
    616                 Main.addMapFrameListener(pluginProxy);
     616                Main.addMapFrameListener(pluginProxy, true);
    617617            }
    618618            msg = null;
Note: See TracChangeset for help on using the changeset viewer.