Line | |
---|
1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
6 |
|
---|
7 | import java.awt.event.ActionEvent;
|
---|
8 | import java.awt.event.KeyEvent;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.Main;
|
---|
11 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
12 |
|
---|
13 | public 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 | putValue("help", ht("/Action/ZoomIn"));
|
---|
19 | }
|
---|
20 |
|
---|
21 | public void actionPerformed(ActionEvent e) {
|
---|
22 | if (Main.map == null) return;
|
---|
23 | Main.map.mapView.zoomToFactor(0.9);
|
---|
24 | }
|
---|
25 |
|
---|
26 | @Override
|
---|
27 | protected void updateEnabledState() {
|
---|
28 | setEnabled(
|
---|
29 | Main.map != null
|
---|
30 | && Main.map.mapView != null
|
---|
31 | && Main.map.mapView.hasLayers()
|
---|
32 | );
|
---|
33 | }
|
---|
34 |
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.