Changeset 4086 in osm for applications/editors


Ignore:
Timestamp:
2007-08-11T19:07:23+02:00 (17 years ago)
Author:
frsantos
Message:

Fixing deprecated Layer listeners code

Location:
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java

    r4023 r4086  
    1717import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    1818import org.openstreetmap.josm.gui.MapView;
    19 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    2019import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
    2120import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
    2221import org.openstreetmap.josm.gui.layer.Layer;
     22import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
    2323import org.openstreetmap.josm.plugins.validator.util.Bag;
    2424import org.openstreetmap.josm.tools.ImageProvider;
     
    3838    {
    3939                super(name);
    40         Main.map.mapView.addLayerChangeListener(this);
     40        Layer.listeners.add(this);
    4141        }
    4242
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java

    r4023 r4086  
    1414import org.openstreetmap.josm.actions.UploadAction.UploadHook;
    1515import org.openstreetmap.josm.gui.MapFrame;
    16 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    1716import org.openstreetmap.josm.gui.layer.Layer;
    1817import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     18import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
    1919import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    2020import org.openstreetmap.josm.plugins.Plugin;
     
    8282                newFrame.addToggleDialog(validationDialog);
    8383            Main.main.addLayer(new ErrorLayer(tr("Validation errors")));
    84             Main.map.mapView.addLayerChangeListener(this);
     84            Layer.listeners.add(this);
    8585                }
    8686                else
    87             oldFrame.mapView.removeLayerChangeListener(this);
     87            Layer.listeners.remove(this);
    8888       
    8989        // Add/Remove the upload hook
Note: See TracChangeset for help on using the changeset viewer.