source: josm/trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java@ 2112

Last change on this file since 2112 was 1895, checked in by Gubaer, 15 years ago

new: only one list of layers managed by MapView. LayerListDialog is an adapter to this list.
improved delete confirmation for multi layer delete
various bug fixes in the new LayerListDialog

File size: 955 bytes
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;
8
9import org.openstreetmap.josm.Main;
10import org.openstreetmap.josm.tools.Shortcut;
11
12public final class ZoomInAction extends JosmAction {
13
14 public ZoomInAction() {
15 super(tr("Zoom In"), "dialogs/zoomin", tr("Zoom In"),
16 Shortcut.registerShortcut("view:zoomin", tr("View: {0}", tr("Zoom In")), KeyEvent.VK_PLUS, Shortcut.GROUP_DIRECT), true);
17 }
18
19 public void actionPerformed(ActionEvent e) {
20 if (Main.map == null) return;
21 Main.map.mapView.zoomToFactor(0.9);
22 }
23
24 @Override
25 protected void updateEnabledState() {
26 setEnabled(
27 Main.map != null
28 && Main.map.mapView != null
29 && Main.map.mapView.hasLayers()
30 );
31 }
32
33}
Note: See TracBrowser for help on using the repository browser.