source: subversion/applications/editors/josm/plugins/gpxfilter/src/gpxfilter/AddEGpxLayerAction.java

Last change on this file was 33885, checked in by donvip, 17 months ago

update to JOSM 12643

File size: 1.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package gpxfilter;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7import java.awt.event.KeyEvent;
8
9import org.openstreetmap.josm.actions.JosmAction;
10import org.openstreetmap.josm.gui.MainApplication;
11import org.openstreetmap.josm.tools.Shortcut;
12
13@SuppressWarnings("serial")
14public class AddEGpxLayerAction extends JosmAction {
15
16    public AddEGpxLayerAction() {
17        super(tr("Add EGPX layer"), (String) null, tr("Add EGPX layer"),
18            Shortcut.registerShortcut("gpxfilter:egpx", tr("Tool: {0}", tr("Add EGPX layer")),
19                 KeyEvent.VK_X, Shortcut.ALT_SHIFT),
20            true, "gpxfilter/addegpxlayer", true);
21    }
22
23    @Override
24    protected void updateEnabledState() {
25        setEnabled(getLayerManager().getEditDataSet() != null);
26    }
27
28    @Override
29    public void actionPerformed(ActionEvent arg0) {
30        getLayerManager().addLayer(new EGpxLayer(MainApplication.getMap().mapView.getRealBounds()));
31    }
32}
Note: See TracBrowser for help on using the repository browser.