Ignore:
Timestamp:
2010-02-14T16:47:44+01:00 (10 years ago)
Author:
jttt
Message:

Make DataChangedListener deprecated (replaced by DatasetListener), remove remaining listeners

File:
1 edited

Legend:

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

    r2850 r2985  
    3737import org.openstreetmap.josm.gui.MapView;
    3838import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    39 import org.openstreetmap.josm.gui.layer.DataChangeListener;
    4039import org.openstreetmap.josm.gui.layer.Layer;
    4140import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    6766 * @see HistoryBrowser
    6867 */
    69 public class HistoryBrowserModel extends Observable implements LayerChangeListener, DataSetListener, DataChangeListener {
     68public class HistoryBrowserModel extends Observable implements LayerChangeListener, DataSetListener {
    7069    //private static Logger logger = Logger.getLogger(HistoryBrowserModel.class.getName());
    7170
     
    102101        if (getEditLayer() != null) {
    103102            getEditLayer().data.addDataSetListener(this);
    104             getEditLayer().listenerDataChanged.add(this);
    105103        }
    106104        MapView.addLayerChangeListener(this);
     
    822820
    823821    public void dataChanged(DataChangedEvent event) {
    824         dataChanged(getEditLayer());
    825     }
    826 
    827     public void otherDatasetChange(AbstractDatasetChangedEvent event) {
    828         // Irrelevant
    829     }
    830 
    831     /* ---------------------------------------------------------------------- */
    832     /* DataChangeListener                                                     */
    833     /* ---------------------------------------------------------------------- */
    834     public void dataChanged(OsmDataLayer l) {
    835         if (l != getEditLayer()) return;
    836         OsmPrimitive primitive = l.data.getPrimitiveById(history.getId(), history.getType());
     822        OsmPrimitive primitive = event.getDataset().getPrimitiveById(history.getId(), history.getType());
    837823        HistoryOsmPrimitive latest;
    838824        if (canShowAsLatest(primitive)) {
     
    843829        setLatest(latest);
    844830        fireModelChange();
     831    }
     832
     833    public void otherDatasetChange(AbstractDatasetChangedEvent event) {
     834        // Irrelevant
    845835    }
    846836
     
    861851        OsmDataLayer l = (OsmDataLayer)newLayer;
    862852        l.data.addDataSetListener(this);
    863         l.listenerDataChanged.add(this);
    864853        OsmPrimitive primitive = l.data.getPrimitiveById(history.getId(), history.getType());
    865854        HistoryOsmPrimitive latest;
Note: See TracChangeset for help on using the changeset viewer.