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
RevLine 
[770]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;
[1854]10import org.openstreetmap.josm.gui.layer.Layer;
[1084]11import org.openstreetmap.josm.tools.Shortcut;
[770]12
13public final class ZoomInAction extends JosmAction {
14
[1169]15 public ZoomInAction() {
[1218]16 super(tr("Zoom In"), "dialogs/zoomin", tr("Zoom In"),
[1820]17 Shortcut.registerShortcut("view:zoomin", tr("View: {0}", tr("Zoom In")), KeyEvent.VK_PLUS, Shortcut.GROUP_DIRECT), true);
[1169]18 }
[770]19
[1169]20 public void actionPerformed(ActionEvent e) {
[1087]21 if (Main.map == null) return;
[1722]22 Main.map.mapView.zoomToFactor(0.9);
[1169]23 }
[1854]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
[770]34}
Note: See TracBrowser for help on using the repository browser.