Rev | Line | |
---|
[770] | 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 |
|
---|
| 6 | import java.awt.event.ActionEvent;
|
---|
| 7 | import java.awt.event.KeyEvent;
|
---|
| 8 |
|
---|
| 9 | import org.openstreetmap.josm.Main;
|
---|
[1854] | 10 | import org.openstreetmap.josm.gui.layer.Layer;
|
---|
[1084] | 11 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
[770] | 12 |
|
---|
| 13 | public 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.