Changeset 33925 in osm


Ignore:
Timestamp:
2017-11-28T00:51:00+01:00 (7 years ago)
Author:
donvip
Message:

fix deprecation warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorLayer.java

    r33793 r33925  
    5353import org.openstreetmap.josm.data.coor.LatLon;
    5454import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     55import org.openstreetmap.josm.gui.MainApplication;
    5556import org.openstreetmap.josm.gui.MapView;
    5657import org.openstreetmap.josm.gui.layer.Layer;
    5758import org.openstreetmap.josm.plugins.osminspector.gui.OsmInspectorDialog;
    5859import org.openstreetmap.josm.tools.ImageProvider;
     60import org.openstreetmap.josm.tools.Logging;
    5961
    6062import com.vividsolutions.jts.geom.Envelope;
     
    6264import com.vividsolutions.jts.io.ParseException;
    6365
    64 @SuppressWarnings({ "deprecation"})
    6566public class OsmInspectorLayer extends Layer {
    6667
     
    366367                        setGeometry(selectGeomType, typeName);
    367368
    368                         Main.info("Osm Inspector Features size: " + features.size());
     369                        Logging.info("Osm Inspector Features size: " + features.size());
    369370                        Style style = createDefaultStyle(idx, selectedFeatures);
    370371
     
    410411                selectGeomType.add(GeomType.POINT);
    411412
    412                 ProgressMonitor monitor = new ProgressMonitor(Main.map.mapView,
     413                ProgressMonitor monitor = new ProgressMonitor(MainApplication.getMap().mapView,
    413414                                "Loading features", "", 0, 100);
    414415
     
    422423                        setGeometry(selectGeomType, typeName);
    423424
    424                         Main.info("Osm Inspector Features size: " + features.size());
     425                        Logging.info("Osm Inspector Features size: " + features.size());
    425426
    426427                        OSMIFeatureTracker tracker = arrFeatures.get(idx - layerOffset);
     
    512513
    513514        private void setGeometry(ArrayList<GeomType> selectedTypes, String typename) {
    514             Main.info("Passed type is" + typename);
     515            Logging.info("Passed type is" + typename);
    515516                if (typename.compareTo("duplicate_ways") == 0) {
    516517                        geometryType = GeomType.LINE;
     
    577578        public void updateView() {
    578579                this.dialog.revalidate();
    579                 Main.map.mapView.revalidate();
    580                 Main.map.repaint();
     580                invalidate();
    581581        }
    582582
    583583        public void selectFeatures(int x, int y) {
    584584                int pixelDelta = 2;
    585                 LatLon clickUL = Main.map.mapView.getLatLon(x - pixelDelta, y
     585                LatLon clickUL = MainApplication.getMap().mapView.getLatLon(x - pixelDelta, y
    586586                                - pixelDelta);
    587                 LatLon clickLR = Main.map.mapView.getLatLon(x + pixelDelta, y
     587                LatLon clickLR = MainApplication.getMap().mapView.getLatLon(x + pixelDelta, y
    588588                                + pixelDelta);
    589589
     
    618618                                try (FeatureIterator<SimpleFeature> iter = selectedFeatures.features()) {
    619619   
    620                                 Main.info("Selected features " + selectedFeatures.size());
     620                                Logging.info("Selected features " + selectedFeatures.size());
    621621   
    622622                                while (iter.hasNext()) {
     
    630630                                content.addLayer(new FeatureLayer(features, style));
    631631                        } catch (IOException e) {
    632                                 Main.error(e);
     632                                Logging.error(e);
    633633                        }
    634634                }
     
    638638
    639639        public void selectFeatures(LatLon center) {
    640                 Point point = Main.map.mapView.getPoint(center);
     640                Point point = MainApplication.getMap().mapView.getPoint(center);
    641641                selectFeatures(point.x, point.y);
    642642        }
Note: See TracChangeset for help on using the changeset viewer.