Changeset 32329 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2016-06-19T16:08:56+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/build.xml
r32054 r32329 4 4 <property name="commit.message" value="Changed constructor for Plugin"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value=" 9759"/>6 <property name="plugin.main.version" value="10279"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r32212 r32329 576 576 private static void checkLayerDuplicates(WMSLayer wmsLayer) throws DuplicateLayerException { 577 577 if (Main.map != null) { 578 for (Layer l : Main. map.mapView.getAllLayers()) {578 for (Layer l : Main.getLayerManager().getLayers()) { 579 579 if (l instanceof WMSLayer && l.getName().equals(wmsLayer.getName()) && (!l.equals(wmsLayer))) { 580 580 Main.info("Try to grab into a new layer when "+wmsLayer.getName()+" is already opened."); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r32164 r32329 456 456 public static void addWMSLayer(WMSLayer wmsLayer) { 457 457 if (Main.map != null && Main.map.mapView != null) { 458 int wmsNewLayerPos = Main. map.mapView.getAllLayers().size();459 for(Layer l : Main. map.mapView.getLayersOfType(WMSLayer.class)) {458 int wmsNewLayerPos = Main.getLayerManager().getLayers().size(); 459 for(Layer l : Main.getLayerManager().getLayersOfType(WMSLayer.class)) { 460 460 int wmsPos = Main.map.mapView.getLayerPos(l); 461 461 if (wmsPos < wmsNewLayerPos) wmsNewLayerPos = wmsPos; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
r29714 r32329 2 2 package cadastre_fr; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.marktr;6 6 7 7 import java.awt.event.ActionEvent; … … 12 12 import org.openstreetmap.josm.Main; 13 13 import org.openstreetmap.josm.actions.JosmAction; 14 import org.openstreetmap.josm.gui.layer.Layer;15 14 16 15 public class MenuActionGrabPlanImage extends JosmAction implements Runnable { … … 36 35 if (wmsLayer == null || Main.map == null || Main.map.mapView == null) return; 37 36 if (!rasterImageGeoreferencer.isRunning()) return; 38 for (Layer l : Main.map.mapView.getAllLayersAsList()) 39 if (l == wmsLayer) 40 return; 37 if (Main.getLayerManager().containsLayer(wmsLayer)) 38 return; 41 39 JOptionPane.showMessageDialog(Main.parent, tr("Georeferencing interrupted")); 42 40 rasterImageGeoreferencer.actionInterrupted(); 43 41 } 44 42 45 public void actionPerformed(ActionEvent ae) { 43 @Override 44 public void actionPerformed(ActionEvent ae) { 46 45 if (Main.map != null) { 47 46 if (CadastrePlugin.isCadastreProjection()) { … … 58 57 } 59 58 60 public void run() { 59 @Override 60 public void run() { 61 61 // wait until plan image is fully loaded and joined into one single image 62 62 boolean loadedFromCache = downloadWMSPlanImage.waitFinished(); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
r32211 r32329 69 69 // check if the selected cache is not already displayed 70 70 if (Main.map != null) { 71 for (Layer l : Main. map.mapView.getAllLayers()) {71 for (Layer l : Main.getLayerManager().getLayers()) { 72 72 if (l instanceof WMSLayer && l.getName().equals(location)) { 73 73 JOptionPane.showMessageDialog(Main.parent, tr("The location {0} is already on screen. Cache not loaded.", filename), tr("Error"), JOptionPane.ERROR_MESSAGE); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
r32060 r32329 106 106 Main.pref.put("cadastrewms.codeDepartement", codeDepartement); 107 107 if (Main.map != null) { 108 for (Layer l : Main. map.mapView.getAllLayers()) {108 for (Layer l : Main.getLayerManager().getLayers()) { 109 109 if (l instanceof WMSLayer && l.getName().equalsIgnoreCase(location)) { 110 110 return null; … … 118 118 CadastrePlugin.addWMSLayer(wmsLayer); 119 119 Main.info("Add new layer with Location:" + inputTown.getText()); 120 } else if (existingLayers != null && existingLayers.size() > 0 && Main. map.mapView.getActiveLayer() instanceof WMSLayer) {121 wmsLayer = (WMSLayer)Main. map.mapView.getActiveLayer();120 } else if (existingLayers != null && existingLayers.size() > 0 && Main.getLayerManager().getActiveLayer() instanceof WMSLayer) { 121 wmsLayer = (WMSLayer)Main.getLayerManager().getActiveLayer(); 122 122 } 123 123 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java
r29595 r32329 41 41 @Override public void enterMode() { 42 42 if (Main.map != null) { 43 if (Main. map.mapView.getActiveLayer() instanceof WMSLayer) {44 modifiedLayer = (WMSLayer)Main. map.mapView.getActiveLayer();43 if (Main.getLayerManager().getActiveLayer() instanceof WMSLayer) { 44 modifiedLayer = (WMSLayer)Main.getLayerManager().getActiveLayer(); 45 45 super.enterMode(); 46 46 Main.map.mapView.addMouseListener(this); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java
r30737 r32329 27 27 ArrayList<WMSLayer> existingWMSlayers = new ArrayList<>(); 28 28 if (Main.map != null) { 29 Layer activeLayer = Main. map.mapView.getActiveLayer();29 Layer activeLayer = Main.getLayerManager().getActiveLayer(); 30 30 if (activeLayer instanceof WMSLayer) 31 31 return (WMSLayer) activeLayer; 32 for (Layer l : Main. map.mapView.getAllLayers()) {32 for (Layer l : Main.getLayerManager().getLayers()) { 33 33 if (l instanceof WMSLayer) { 34 34 existingWMSlayers.add((WMSLayer)l); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r32211 r32329 160 160 grabThread.setGrabber(grabber); 161 161 // if it is the first layer, use the communeBBox as grab bbox (and not divided) 162 if (Main. map.mapView.getAllLayers().size() == 1 ) {162 if (Main.getLayerManager().getLayers().size() == 1 ) { 163 163 final Bounds bounds = this.getCommuneBBox().toBounds(); 164 164 GuiHelper.runInEDTAndWait(new Runnable() {
Note:
See TracChangeset
for help on using the changeset viewer.