Last change
on this file since 8308 was 6509, checked in by Don-vip, 10 years ago |
fix #9459 - initialize default center view of MapView to last download location, if any, instead of (0,0)
|
-
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.tools.I18n.tr;
|
---|
5 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
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;
|
---|
13 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * Creates a blank new OSM data layer.
|
---|
17 | * @since 169
|
---|
18 | */
|
---|
19 | public class NewAction extends JosmAction {
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Constructs a {@code NewAction}.
|
---|
23 | */
|
---|
24 | public NewAction() {
|
---|
25 | super(tr("New Layer"), "new", tr("Create a new map layer."),
|
---|
26 | Shortcut.registerShortcut("system:new", tr("File: {0}", tr("New Layer")), KeyEvent.VK_N, Shortcut.CTRL), true);
|
---|
27 | putValue("help", ht("/Action/NewLayer"));
|
---|
28 | }
|
---|
29 |
|
---|
30 | @Override
|
---|
31 | public void actionPerformed(ActionEvent e) {
|
---|
32 | Main.main.addLayer(new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null));
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.