source: josm/src/org/openstreetmap/josm/actions/NewAction.java@ 178

Last change on this file since 178 was 178, checked in by imi, 18 years ago
  • fixed display of tooltip shortcuts
  • added icon=... to annotation presets
  • added support for putting annotation presets in the toolbar
File size: 652 bytes
Line 
1package org.openstreetmap.josm.actions;
2
3import static org.openstreetmap.josm.tools.I18n.tr;
4
5import java.awt.event.ActionEvent;
6import java.awt.event.InputEvent;
7import java.awt.event.KeyEvent;
8
9import org.openstreetmap.josm.Main;
10
11public class NewAction extends JosmAction {
12
13 public NewAction() {
14 super(tr("New"), "new", tr("Create a new map."), KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK, true);
15 }
16
17 public void actionPerformed(ActionEvent e) {
18 if (Main.breakBecauseUnsavedChanges())
19 return;
20 if (Main.map != null)
21 Main.main.removeLayer(Main.main.editLayer());
22 Main.main.editLayer(); // create new if empty
23 }
24}
Note: See TracBrowser for help on using the repository browser.