source: josm/trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java@ 2474

Last change on this file since 2474 was 2343, checked in by Gubaer, 14 years ago

fixed #3792: NPE when deleting the data layer while the deletion tool is active

File size: 1.0 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;
5import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
6
7import java.awt.event.ActionEvent;
8import java.awt.event.KeyEvent;
9
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.tools.Shortcut;
12
13public final class ZoomOutAction extends JosmAction {
14
15 public ZoomOutAction() {
16 super(tr("Zoom Out"), "dialogs/zoomout", tr("Zoom Out"),
17 Shortcut.registerShortcut("view:zoomout", tr("View: {0}", tr("Zoom Out")), KeyEvent.VK_MINUS, Shortcut.GROUP_DIRECT), true);
18 putValue("help", ht("/Action/ZoomOut"));
19 }
20
21 public void actionPerformed(ActionEvent e) {
22 if (!Main.isDisplayingMapView()) return;
23 Main.map.mapView.zoomToFactor(1/0.9);
24 }
25
26 @Override
27 protected void updateEnabledState() {
28 setEnabled(
29 Main.isDisplayingMapView()
30 && Main.map.mapView.hasLayers()
31 );
32 }
33}
Note: See TracBrowser for help on using the repository browser.