Ignore:
Timestamp:
2009-12-12T17:51:39+01:00 (10 years ago)
Author:
Gubaer
Message:

Moved layer listener management from Layer to MapView
Made sure that listeners also unregister when they register for layer change events.

This will certainly break plugins. Plugin updates will follow later.

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

Legend:

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

    r2512 r2621  
    1010import org.openstreetmap.josm.Main;
    1111import org.openstreetmap.josm.data.osm.history.History;
     12import org.openstreetmap.josm.gui.MapView;
    1213import org.openstreetmap.josm.gui.layer.Layer;
    13 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
    1414import org.openstreetmap.josm.tools.WindowGeometry;
    1515
    16 public class HistoryBrowserDialogManager implements LayerChangeListener {
     16public class HistoryBrowserDialogManager implements MapView.LayerChangeListener {
    1717    static private HistoryBrowserDialogManager instance;
    1818    static public HistoryBrowserDialogManager getInstance() {
     
    2727    protected HistoryBrowserDialogManager() {
    2828        dialogs = new HashMap<Long, HistoryBrowserDialog>();
    29         Layer.listeners.add(this);
     29        MapView.addLayerChangeListener(this);
    3030    }
    3131
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java

    r2556 r2621  
    2929import org.openstreetmap.josm.data.osm.history.HistoryWay;
    3030import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
     31import org.openstreetmap.josm.gui.MapView;
    3132import org.openstreetmap.josm.gui.layer.DataChangeListener;
    3233import org.openstreetmap.josm.gui.layer.Layer;
    3334import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    34 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
    3535
    3636/**
     
    5959 * @see HistoryBrowser
    6060 */
    61 public class HistoryBrowserModel extends Observable implements LayerChangeListener, DataSetListener, DataChangeListener {
     61public class HistoryBrowserModel extends Observable implements MapView.LayerChangeListener, DataSetListener, DataChangeListener {
    6262
    6363    private static Logger logger = Logger.getLogger(HistoryBrowserModel.class.getName());
     
    9797            getEditLayer().listenerDataChanged.add(this);
    9898        }
    99         Layer.listeners.add(this);
    100 
     99        MapView.addLayerChangeListener(this);
    101100    }
    102101
     
    772771            getEditLayer().data.removeDataSetListener(this);
    773772        }
    774         Layer.listeners.remove(this);
    775 
     773        MapView.removeLayerChangeListener(this);
    776774    }
    777775
Note: See TracChangeset for help on using the changeset viewer.