Ignore:
Timestamp:
2016-06-30T00:16:11+02:00 (8 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

Location:
applications/editors/josm/plugins/routes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/routes/.settings/org.eclipse.jdt.ui.prefs

    r30738 r32456  
    77sp_cleanup.add_missing_methods=false
    88sp_cleanup.add_missing_nls_tags=false
    9 sp_cleanup.add_missing_override_annotations=false
    10 sp_cleanup.add_missing_override_annotations_interface_methods=false
     9sp_cleanup.add_missing_override_annotations=true
     10sp_cleanup.add_missing_override_annotations_interface_methods=true
    1111sp_cleanup.add_serial_version_id=false
    1212sp_cleanup.always_use_blocks=true
     
    1616sp_cleanup.convert_functional_interfaces=false
    1717sp_cleanup.convert_to_enhanced_for_loop=false
    18 sp_cleanup.correct_indentation=false
     18sp_cleanup.correct_indentation=true
    1919sp_cleanup.format_source_code=false
    2020sp_cleanup.format_source_code_changes_only=false
  • applications/editors/josm/plugins/routes/build.xml

    r32329 r32456  
    22<project name="routes" default="dist" basedir=".">
    33    <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
    4     <property name="plugin.main.version" value="10279"/>
     4    <property name="plugin.main.version" value="10353"/>
    55    <property name="josm" location="../../core/dist/josm-custom.jar"/>
    66    <property name="plugin.dist.dir" value="../../dist"/>
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RelationEditMode.java

    r27852 r32456  
    6262    @Override
    6363    public void mouseClicked(MouseEvent e) {
    64         if (Main.main.getCurrentDataSet() == null)
     64        if (getLayerManager().getEditDataSet() == null)
    6565            return;
    6666
    6767        Way way = Main.map.mapView.getNearestWay(e.getPoint(), OsmPrimitive.isUsablePredicate);
    68         Collection<Relation> selectedRelations = Main.main.getCurrentDataSet().getSelectedRelations();
     68        Collection<Relation> selectedRelations = getLayerManager().getEditDataSet().getSelectedRelations();
    6969
    7070        if (way != null) {
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java

    r30737 r32456  
    104104    public void paint(Graphics2D g, MapView mv, Bounds bounds) {
    105105
    106         DataSet dataset = Main.main.getCurrentDataSet();
     106        DataSet dataset = Main.getLayerManager().getEditDataSet();
    107107
    108108        if (dataset == null) {
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java

    r32329 r32456  
    1515
    1616import org.openstreetmap.josm.Main;
    17 import org.openstreetmap.josm.gui.MapView;
    18 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    1917import 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;
    2022import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2123import org.openstreetmap.josm.plugins.Plugin;
     
    3133    public RoutesPlugin(PluginInformation info) {
    3234        super(info);
    33         MapView.addLayerChangeListener(this);
     35        Main.getLayerManager().addLayerChangeListener(this);
    3436
    3537        File routesFile = new File(getPluginDir() + File.separator + "routes.xml");
     
    4042                routesFile.getParentFile().mkdir();
    4143                try (
    42                     OutputStream outputStream = new FileOutputStream(routesFile);
    43                     InputStream inputStream = Routes.class.getResourceAsStream("routes.xml");
    44                 ) {
     44                        OutputStream outputStream = new FileOutputStream(routesFile);
     45                        InputStream inputStream = Routes.class.getResourceAsStream("routes.xml");
     46                        ) {
    4547                    byte[] b = new byte[512];
    4648                    int read;
     
    8486                        isShown = true;
    8587                        SwingUtilities.invokeLater(new Runnable() {
     88                            @Override
    8689                            public void run() {
    8790                                for (RouteLayer routeLayer:routeLayers) {
    88                                     Main.main.addLayer(routeLayer);
     91                                    Main.getLayerManager().addLayer(routeLayer);
    8992                                }
    9093                            }
     
    97100                isShown = false;
    98101                SwingUtilities.invokeLater(new Runnable() {
     102                    @Override
    99103                    public void run() {
    100104                        for (RouteLayer routeLayer:routeLayers) {
    101                             Main.main.removeLayer(routeLayer);
     105                            Main.getLayerManager().removeLayer(routeLayer);
    102106                        }
    103107                    }
     
    107111    }
    108112
    109     public void layerAdded(Layer newLayer) {
     113    @Override
     114    public void layerAdded(LayerAddEvent e) {
    110115        checkLayers();
    111116    }
    112117
    113     public void layerRemoved(Layer oldLayer) {
     118    @Override
     119    public void layerRemoving(LayerRemoveEvent e) {
    114120        checkLayers();
    115121    }
     122
     123    @Override
     124    public void layerOrderChanged(LayerOrderChangeEvent e) {
     125        // Do nothing
     126    }
    116127}
Note: See TracChangeset for help on using the changeset viewer.