Changeset 32447 in osm for applications/editors


Ignore:
Timestamp:
2016-06-29T21:16:08+02:00 (9 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

Location:
applications/editors/josm/plugins/NanoLog/src/nanolog
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPanel.java

    r32329 r32447  
    1414
    1515import org.openstreetmap.josm.Main;
    16 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    1716import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
    1817import org.openstreetmap.josm.gui.layer.Layer;
     18import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     19import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
     20import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
     21import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
    1922
    2023/**
     
    4447
    4548    @Override
    46     public void activeLayerChange( Layer oldLayer, Layer newLayer ) {
    47         // todo
     49    public void layerOrderChanged(LayerOrderChangeEvent e) {
    4850    }
    4951
    5052    @Override
    51     public void layerAdded( Layer newLayer ) {
    52         if( newLayer instanceof NanoLogLayer )
    53             ((NanoLogLayer)newLayer).addListener(this);
     53    public void layerAdded(LayerAddEvent e) {
     54        Layer newLayer = e.getAddedLayer();
     55        if (newLayer instanceof NanoLogLayer )
     56            ((NanoLogLayer) newLayer).addListener(this);
    5457        updateMarkers();
    5558    }
    5659
    5760    @Override
    58     public void layerRemoved( Layer oldLayer ) {
     61    public void layerRemoving(LayerRemoveEvent e) {
    5962        updateMarkers();
    6063    }
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPlugin.java

    r31981 r32447  
    11package nanolog;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
    46import java.io.IOException;
    57import java.util.List;
     8
    69import javax.swing.JFileChooser;
    710import javax.swing.JOptionPane;
     11
    812import org.openstreetmap.josm.Main;
    913import org.openstreetmap.josm.actions.JosmAction;
    1014import org.openstreetmap.josm.gui.MapFrame;
    11 import org.openstreetmap.josm.gui.MapView;
    1215import org.openstreetmap.josm.plugins.Plugin;
    1316import org.openstreetmap.josm.plugins.PluginInformation;
    14 import static org.openstreetmap.josm.tools.I18n.tr;
    1517
    1618/**
     
    3032            NanoLogPanel panel = new NanoLogPanel();
    3133            newFrame.addToggleDialog(panel);
    32             MapView.addLayerChangeListener(panel);
     34            Main.getLayerManager().addLayerChangeListener(panel);
    3335        }
    3436    }
     
    4749                    if( !entries.isEmpty() ) {
    4850                        NanoLogLayer layer = new NanoLogLayer(entries);
    49                         Main.main.addLayer(layer);
     51                        Main.getLayerManager().addLayer(layer);
    5052                        layer.setupListeners();
    5153                    }
Note: See TracChangeset for help on using the changeset viewer.