Changeset 33567 in osm for applications/editors/josm/plugins/openvisible/src
- Timestamp:
- 2017-08-27T20:18:01+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisibleAction.java
r32463 r33567 23 23 import org.openstreetmap.josm.data.coor.LatLon; 24 24 import org.openstreetmap.josm.data.osm.DataSet; 25 import org.openstreetmap.josm.gui.MainApplication; 25 26 import org.openstreetmap.josm.gui.MapView; 27 import org.openstreetmap.josm.gui.io.importexport.GpxImporter; 28 import org.openstreetmap.josm.gui.io.importexport.OsmImporter; 26 29 import org.openstreetmap.josm.gui.layer.GpxLayer; 27 30 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 28 31 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 29 32 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 30 import org.openstreetmap.josm.io.GpxImporter;31 33 import org.openstreetmap.josm.io.GpxReader; 32 34 import org.openstreetmap.josm.io.IllegalDataException; 33 import org.openstreetmap.josm.io.OsmImporter;34 35 import org.openstreetmap.josm.io.OsmReader; 35 36 import org.openstreetmap.josm.tools.Shortcut; … … 55 56 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 56 57 */ 58 @Override 57 59 public void actionPerformed(ActionEvent e) { 58 if( Main.map == null || Main.map.mapView == null) {60 if(!MainApplication.isDisplayingMapView()) { 59 61 JOptionPane.showMessageDialog(Main.parent, tr("No view open - cannot determine boundaries!")); 60 62 return; 61 63 } 62 MapView view = Main .map.mapView;64 MapView view = MainApplication.getMap().mapView; 63 65 Rectangle bounds = view.getBounds(); 64 66 LatLon bottomLeft = view.getLatLon(bounds.x, bounds.y + bounds.height); … … 109 111 DataSet dataSet = OsmReader.parseDataSet(new FileInputStream(file), NullProgressMonitor.INSTANCE); 110 112 OsmDataLayer layer = new OsmDataLayer(dataSet, fn, file); 111 Main .getLayerManager().addLayer(layer);113 MainApplication.getLayerManager().addLayer(layer); 112 114 } 113 115 else … … 131 133 r.getGpxData().storageFile = file; 132 134 GpxLayer gpxLayer = new GpxLayer(r.getGpxData(), fn); 133 Main .getLayerManager().addLayer(gpxLayer);134 Main .getLayerManager().addLayer(new MarkerLayer(r.getGpxData(), tr("Markers from {0}", fn), file, gpxLayer));135 MainApplication.getLayerManager().addLayer(gpxLayer); 136 MainApplication.getLayerManager().addLayer(new MarkerLayer(r.getGpxData(), tr("Markers from {0}", fn), file, gpxLayer)); 135 137 136 138 } else { -
applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisiblePlugin.java
r29778 r33567 4 4 package at.dallermassl.josm.plugin.openvisible; 5 5 6 import org.openstreetmap.josm. Main;6 import org.openstreetmap.josm.gui.MainApplication; 7 7 import org.openstreetmap.josm.gui.MainMenu; 8 8 import org.openstreetmap.josm.plugins.Plugin; … … 17 17 public OpenVisiblePlugin(PluginInformation info) { 18 18 super(info); 19 MainMenu.add(Main .main.menu.gpsMenu, new OpenVisibleAction());19 MainMenu.add(MainApplication.getMenu().gpsMenu, new OpenVisibleAction()); 20 20 } 21 21
Note:
See TracChangeset
for help on using the changeset viewer.