Last change
on this file since 11650 was 10436, checked in by Don-vip, 8 years ago |
see #13001 - replace calls to Main.main.[add|remove]Layer by Main.getLayerManager().[add|remove]Layer
|
-
Property svn:eol-style
set to
native
|
File size:
1.0 KB
|
Rev | Line | |
---|
[6380] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
[626] | 2 | package org.openstreetmap.josm.actions;
|
---|
| 3 |
|
---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
[2323] | 5 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
[626] | 6 |
|
---|
| 7 | import java.awt.event.ActionEvent;
|
---|
| 8 | import java.awt.event.KeyEvent;
|
---|
| 9 |
|
---|
| 10 | import org.openstreetmap.josm.Main;
|
---|
| 11 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
| 12 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
[1084] | 13 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
[626] | 14 |
|
---|
[6509] | 15 | /**
|
---|
| 16 | * Creates a blank new OSM data layer.
|
---|
| 17 | * @since 169
|
---|
| 18 | */
|
---|
[626] | 19 | public class NewAction extends JosmAction {
|
---|
| 20 |
|
---|
[6509] | 21 | /**
|
---|
| 22 | * Constructs a {@code NewAction}.
|
---|
| 23 | */
|
---|
[1169] | 24 | public NewAction() {
|
---|
[3260] | 25 | super(tr("New Layer"), "new", tr("Create a new map layer."),
|
---|
[4982] | 26 | Shortcut.registerShortcut("system:new", tr("File: {0}", tr("New Layer")), KeyEvent.VK_N, Shortcut.CTRL), true);
|
---|
[3753] | 27 | putValue("help", ht("/Action/NewLayer"));
|
---|
[1169] | 28 | }
|
---|
[626] | 29 |
|
---|
[6084] | 30 | @Override
|
---|
[1169] | 31 | public void actionPerformed(ActionEvent e) {
|
---|
[10436] | 32 | Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null));
|
---|
[1169] | 33 | }
|
---|
[626] | 34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.