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

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

fixed #3091: zoom to selection on gpx load only

File size: 1016 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.gui.layer.Layer;
11import org.openstreetmap.josm.tools.Shortcut;
12
13public final class ZoomInAction extends JosmAction {
14
15 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);
18 }
19
20 public void actionPerformed(ActionEvent e) {
21 if (Main.map == null) return;
22 Main.map.mapView.zoomToFactor(0.9);
23 }
24
25 @Override
26 protected void updateEnabledState() {
27 setEnabled(
28 Main.map != null
29 && Main.map.mapView != null
30 && Main.map.mapView.getAllLayers().size() > 0
31 );
32 }
33
34}
Note: See TracBrowser for help on using the repository browser.