source: josm/trunk/src/org/openstreetmap/josm/actions/UnselectAllAction.java@ 768

Last change on this file since 768 was 768, checked in by framm, 16 years ago
  • mappaint modifications by Joerg Henne <j.henne@…>; now supports new config options mappaint.node.selected-size and .unselected-size, .fill-selected and .fill-unselected, mappaint.segment.default-width; change in unselect_all (supports escape), new keyboard shortcuts for zoom in/out (keys + and -)
  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.actions;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7import java.awt.event.KeyEvent;
8import javax.swing.KeyStroke;
9import javax.swing.JComponent;
10
11import org.openstreetmap.josm.Main;
12
13public class UnselectAllAction extends JosmAction {
14
15 public UnselectAllAction() {
16 super(tr("Unselect All"), "unselectall", tr("Unselect all objects."),
17 KeyEvent.VK_U, 0, true);
18
19 // Add extra shortcut C-S-a
20 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
21 KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK
22 | KeyEvent.SHIFT_DOWN_MASK), tr("Unselect All"));
23
24 // Add extra shortcut ESCAPE
25 /*
26 * FIXME: this isn't optimal. In a better world the mapmode actions
27 * would be able to capture keyboard events and react accordingly. But
28 * for now this is a reasonable approximation.
29 */
30 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
31 KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
32 tr("Unselect All"));
33 }
34
35 public void actionPerformed(ActionEvent e) {
36 Main.ds.setSelected();
37 }
38}
Note: See TracBrowser for help on using the repository browser.