Changeset 35795 in osm for applications/editors
- Timestamp:
- 2021-07-18T22:04:10+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/IndoorSweeplineWizardAction.java
r34521 r35795 12 12 import org.openstreetmap.josm.gui.MainApplication; 13 13 import org.openstreetmap.josm.gui.layer.Layer; 14 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;15 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;16 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;17 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;18 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;19 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;20 14 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 15 22 public class IndoorSweeplineWizardAction extends JosmAction implements LayerChangeListener, ActiveLayerChangeListener{16 public class IndoorSweeplineWizardAction extends JosmAction { 23 17 24 18 public IndoorSweeplineWizardAction() { 25 19 super(tr("Concourse wizard ..."), null, 26 20 tr("Opens up a wizard to create a concourse"), null, false); 27 MainApplication.getLayerManager().addLayerChangeListener(this);28 21 } 29 22 30 23 @Override 31 24 public void actionPerformed(ActionEvent event) { 25 Layer layer = MainApplication.getLayerManager().getActiveLayer(); 32 26 if (layer == null) 33 27 JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(MainApplication.getMainFrame()), … … 46 40 ProjectionRegistry.getProjection().eastNorth2latlon(MainApplication.getMap().mapView.getCenter())); 47 41 } 48 49 @Override50 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {51 layer = MainApplication.getLayerManager().getActiveLayer();52 }53 54 @Override55 public void layerOrderChanged(LayerOrderChangeEvent e) {56 }57 58 @Override59 public void layerAdded(LayerAddEvent e) {60 }61 62 @Override63 public void layerRemoving(LayerRemoveEvent e) {64 if (layer == e.getRemovedLayer())65 layer = null;66 }67 68 private Layer layer;69 42 }
Note:
See TracChangeset
for help on using the changeset viewer.