Changeset 2550 in josm
- Timestamp:
- 2009-11-29T14:44:17+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java
r2343 r2550 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;6 6 7 7 import java.awt.event.ActionEvent; 8 8 import java.awt.event.KeyEvent; 9 10 import javax.swing.JComponent; 11 import javax.swing.KeyStroke; 9 12 10 13 import org.openstreetmap.josm.Main; … … 14 17 15 18 public ZoomInAction() { 16 super(tr("Zoom In"), "dialogs/zoomin", tr("Zoom In"), 17 Shortcut.registerShortcut("view:zoomin", tr("View: {0}", tr("Zoom In")), KeyEvent.VK_PLUS, Shortcut.GROUP_DIRECT), true); 19 super( 20 tr("Zoom In"), 21 "dialogs/zoomin", 22 tr("Zoom In"), 23 Shortcut.registerShortcut("view:zoomin", tr("View: {0}", tr("Zoom In")),KeyEvent.VK_PLUS, Shortcut.GROUP_DIRECT), 24 true 25 ); 18 26 putValue("help", ht("/Action/ZoomIn")); 27 // make numpad + behave like + (action is already registred) 28 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD,0), tr("Zoom In")); 19 29 } 20 30 21 31 public void actionPerformed(ActionEvent e) { 32 Object name = Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).get(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, 0)); 33 Main.contentPane.getActionMap().put(name, this); 34 22 35 if (!Main.isDisplayingMapView()) return; 23 36 Main.map.mapView.zoomToFactor(0.9); -
trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java
r2343 r2550 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;6 6 7 7 import java.awt.event.ActionEvent; 8 8 import java.awt.event.KeyEvent; 9 10 import javax.swing.JComponent; 11 import javax.swing.KeyStroke; 9 12 10 13 import org.openstreetmap.josm.Main; … … 17 20 Shortcut.registerShortcut("view:zoomout", tr("View: {0}", tr("Zoom Out")), KeyEvent.VK_MINUS, Shortcut.GROUP_DIRECT), true); 18 21 putValue("help", ht("/Action/ZoomOut")); 22 // make numpad - behave like - 23 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT,0), tr("Zoom Out")); 19 24 } 20 25
Note:
See TracChangeset
for help on using the changeset viewer.