|
Last change
on this file was 16505, checked in by GerdP, 6 years ago |
|
see #19296: Actions should avoid to install listeners which are not needed
tbc
|
-
Property svn:eol-style
set to
native
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file.
|
|---|
| 2 | package org.openstreetmap.josm.actions;
|
|---|
| 3 |
|
|---|
| 4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
|---|
| 5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
|---|
| 6 |
|
|---|
| 7 | import java.awt.event.ActionEvent;
|
|---|
| 8 | import java.awt.event.KeyEvent;
|
|---|
| 9 |
|
|---|
| 10 | import org.openstreetmap.josm.data.osm.DataSet;
|
|---|
| 11 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
|---|
| 12 | import org.openstreetmap.josm.tools.Shortcut;
|
|---|
| 13 |
|
|---|
| 14 | /**
|
|---|
| 15 | * Creates a blank new OSM data layer.
|
|---|
| 16 | * @since 169
|
|---|
| 17 | */
|
|---|
| 18 | public class NewAction extends JosmAction {
|
|---|
| 19 |
|
|---|
| 20 | /**
|
|---|
| 21 | * Constructs a {@code NewAction}.
|
|---|
| 22 | */
|
|---|
| 23 | public NewAction() {
|
|---|
| 24 | super(tr("New Layer"), "new", tr("Create a new map layer."),
|
|---|
| 25 | Shortcut.registerShortcut("system:new", tr("File: {0}", tr("New Layer")), KeyEvent.VK_N, Shortcut.CTRL), true, false);
|
|---|
| 26 | setHelpId(ht("/Action/NewLayer"));
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | @Override
|
|---|
| 30 | public void actionPerformed(ActionEvent e) {
|
|---|
| 31 | getLayerManager().addLayer(new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null));
|
|---|
| 32 | }
|
|---|
| 33 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.