Changeset 33830 in osm
- Timestamp:
- 2017-11-17T21:25:12+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsLayer.java
r33493 r33830 11 11 import javax.swing.Icon; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.actions.JosmAction; 15 14 import org.openstreetmap.josm.data.osm.DataSet; 15 import org.openstreetmap.josm.gui.MainApplication; 16 16 import org.openstreetmap.josm.gui.layer.Layer; 17 17 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; … … 56 56 57 57 private static final JosmAction[] ACTIONS_TO_DISABLE = new JosmAction[] { 58 Main .main.menu.download,59 Main .main.menu.downloadPrimitive,60 Main .main.menu.downloadReferrers,61 Main .main.menu.upload,62 Main .main.menu.uploadSelection,63 Main .main.menu.update,64 Main .main.menu.updateModified,65 Main .main.menu.updateSelection,66 Main .main.menu.openLocation58 MainApplication.getMenu().download, 59 MainApplication.getMenu().downloadPrimitive, 60 MainApplication.getMenu().downloadReferrers, 61 MainApplication.getMenu().upload, 62 MainApplication.getMenu().uploadSelection, 63 MainApplication.getMenu().update, 64 MainApplication.getMenu().updateModified, 65 MainApplication.getMenu().updateSelection, 66 MainApplication.getMenu().openLocation 67 67 }; 68 68 … … 85 85 public XmlBoundsLayer(DataSet data, String name, File associatedFile) { 86 86 super(data, name, associatedFile); 87 Main .getLayerManager().addLayerChangeListener(this);88 Main .getLayerManager().addActiveLayerChangeListener(this);87 MainApplication.getLayerManager().addLayerChangeListener(this); 88 MainApplication.getLayerManager().addActiveLayerChangeListener(this); 89 89 } 90 90 … … 106 106 @Override 107 107 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 108 Layer newLayer = Main .getLayerManager().getActiveLayer();108 Layer newLayer = MainApplication.getLayerManager().getActiveLayer(); 109 109 Layer oldLayer = e.getPreviousActiveLayer(); 110 110 if (newLayer == this && !(oldLayer instanceof XmlBoundsLayer)) { … … 132 132 @Override 133 133 public void layerRemoving(LayerRemoveEvent e) { 134 if (Main .getLayerManager().getEditLayer() instanceof XmlBoundsLayer) {134 if (MainApplication.getLayerManager().getEditLayer() instanceof XmlBoundsLayer) { 135 135 for (JosmAction action : ACTIONS_TO_DISABLE) { 136 136 action.setEnabled(false); -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java
r33496 r33830 23 23 import javax.swing.AbstractAction; 24 24 25 import org.openstreetmap.josm.Main;26 25 import org.openstreetmap.josm.data.coor.LatLon; 27 26 import org.openstreetmap.josm.data.osm.BBox; … … 37 36 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsConstants; 38 37 import org.openstreetmap.josm.tools.ImageProvider; 38 import org.openstreetmap.josm.tools.Logging; 39 39 40 40 /** … … 201 201 } 202 202 } catch(IOException e) { 203 Main.warn(e);203 Logging.warn(e); 204 204 } 205 205 StringBuilder result = new StringBuilder(256); … … 412 412 @Override 413 413 public void actionPerformed(ActionEvent e) { 414 if ( Main.isDebugEnabled()) {415 Main.debug(getXml());414 if (Logging.isDebugEnabled()) { 415 Logging.debug(getXml()); 416 416 } 417 417 } -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/EditEntriesAction.java
r33493 r33830 12 12 import javax.swing.event.ListSelectionListener; 13 13 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.actions.JosmAction; 16 15 import org.openstreetmap.josm.data.imagery.ImageryInfo; 16 import org.openstreetmap.josm.gui.MainApplication; 17 17 import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference.ImageryProvidersPanel.ImageryDefaultLayerTableModel; 18 18 import org.openstreetmap.josm.gui.util.GuiHelper; … … 55 55 XmlBoundsConverter.convertImageryEntries(entries)); 56 56 GuiHelper.runInEDT(() -> { 57 Main .getLayerManager().addLayer(layer);57 MainApplication.getLayerManager().addLayer(layer); 58 58 layer.onPostLoadFromFile(); 59 59 }); -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java
r33493 r33830 6 6 import java.util.concurrent.Future; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask; 10 9 import org.openstreetmap.josm.data.Bounds; 10 import org.openstreetmap.josm.gui.MainApplication; 11 11 import org.openstreetmap.josm.gui.layer.Layer; 12 12 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 35 35 // We need submit instead of execute so we can wait for it to finish and get the error 36 36 // message if necessary. If no one calls getErrorMessage() it just behaves like execute. 37 return Main .worker.submit(downloadTask);37 return MainApplication.worker.submit(downloadTask); 38 38 } 39 39 … … 72 72 protected int getNumDataLayers() { 73 73 int count = 0; 74 if (!Main .isDisplayingMapView()) return 0;75 for (Layer layer : Main .getLayerManager().getLayers()) {74 if (!MainApplication.isDisplayingMapView()) return 0; 75 for (Layer layer : MainApplication.getLayerManager().getLayers()) { 76 76 if (layer instanceof XmlBoundsLayer) { 77 77 count++; … … 83 83 @Override 84 84 protected OsmDataLayer getFirstDataLayer() { 85 if (!Main .isDisplayingMapView()) return null;86 for (Layer layer : Main .getLayerManager().getLayers()) {85 if (!MainApplication.isDisplayingMapView()) return null; 86 for (Layer layer : MainApplication.getLayerManager().getLayers()) { 87 87 if (layer instanceof XmlBoundsLayer) 88 88 return (XmlBoundsLayer) layer;
Note:
See TracChangeset
for help on using the changeset viewer.