Changeset 32489 in osm for applications/editors/josm/plugins/imagery-xml-bounds/src
- Timestamp:
- 2016-07-01T09:50:06+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsLayer.java
r30735 r32489 14 14 import org.openstreetmap.josm.actions.JosmAction; 15 15 import org.openstreetmap.josm.data.osm.DataSet; 16 import org.openstreetmap.josm.gui.MapView;17 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;18 16 import org.openstreetmap.josm.gui.layer.Layer; 17 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 18 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 19 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 20 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 21 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 22 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 19 23 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 20 24 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.BoundsLayerSaveAction; … … 29 33 * @author Don-vip 30 34 */ 31 public class XmlBoundsLayer extends OsmDataLayer implements LayerChangeListener, XmlBoundsConstants {35 public class XmlBoundsLayer extends OsmDataLayer implements LayerChangeListener, ActiveLayerChangeListener, XmlBoundsConstants { 32 36 33 37 @Override … … 80 84 public XmlBoundsLayer(DataSet data, String name, File associatedFile) { 81 85 super(data, name, associatedFile); 82 MapView.addLayerChangeListener(this); 86 Main.getLayerManager().addLayerChangeListener(this); 87 Main.getLayerManager().addActiveLayerChangeListener(this); 83 88 } 84 89 … … 99 104 100 105 @Override 101 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 106 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 107 Layer newLayer = Main.getLayerManager().getActiveLayer(); 108 Layer oldLayer = e.getPreviousActiveLayer(); 102 109 if (newLayer == this && !(oldLayer instanceof XmlBoundsLayer)) { 103 110 for (JosmAction action : ACTIONS_TO_DISABLE) { … … 113 120 114 121 @Override 115 public void layer Added(Layer newLayer) {122 public void layerOrderChanged(LayerOrderChangeEvent e) { 116 123 // Do nothing 117 124 } 118 125 119 126 @Override 120 public void layerRemoved(Layer oldLayer) { 121 if (Main.main.getEditLayer() instanceof XmlBoundsLayer) { 127 public void layerAdded(LayerAddEvent e) { 128 // Do nothing 129 } 130 131 @Override 132 public void layerRemoving(LayerRemoveEvent e) { 133 if (Main.getLayerManager().getEditLayer() instanceof XmlBoundsLayer) { 122 134 for (JosmAction action : ACTIONS_TO_DISABLE) { 123 135 action.setEnabled(false); -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/EditEntriesAction.java
r30735 r32489 60 60 @Override 61 61 public void run() { 62 Main. main.addLayer(layer);62 Main.getLayerManager().addLayer(layer); 63 63 layer.onPostLoadFromFile(); 64 64 } -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsImporter.java
r30735 r32489 74 74 tr("Open Imagery XML file"), JOptionPane.INFORMATION_MESSAGE); 75 75 } 76 Main. main.addLayer(layer);76 Main.getLayerManager().addLayer(layer); 77 77 layer.onPostLoadFromFile(); 78 78 }
Note:
See TracChangeset
for help on using the changeset viewer.