[6380] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
[612] | 2 | package org.openstreetmap.josm.actions;
|
---|
| 3 |
|
---|
[2327] | 4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
[612] | 5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
| 6 |
|
---|
| 7 | import java.awt.event.ActionEvent;
|
---|
| 8 | import java.awt.event.KeyEvent;
|
---|
| 9 |
|
---|
| 10 | import org.openstreetmap.josm.gui.download.DownloadDialog;
|
---|
[1084] | 11 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
[612] | 12 |
|
---|
| 13 | /**
|
---|
[655] | 14 | * Action that opens a connection to the osm server and downloads map data.
|
---|
[612] | 15 | *
|
---|
| 16 | * An dialog is displayed asking the user to specify a rectangle to grab.
|
---|
| 17 | * The url and account settings from the preferences are used.
|
---|
| 18 | *
|
---|
| 19 | * @author imi
|
---|
| 20 | */
|
---|
| 21 | public class DownloadAction extends JosmAction {
|
---|
[7509] | 22 |
|
---|
[6509] | 23 | /**
|
---|
| 24 | * Constructs a new {@code DownloadAction}.
|
---|
| 25 | */
|
---|
[1169] | 26 | public DownloadAction() {
|
---|
[12652] | 27 | super(tr("Download data"), "download", tr("Download map data from a server of your choice"),
|
---|
| 28 | Shortcut.registerShortcut("file:download", tr("File: {0}", tr("Download data")), KeyEvent.VK_DOWN, Shortcut.CTRL_SHIFT),
|
---|
[11621] | 29 | true);
|
---|
[2323] | 30 | putValue("help", ht("/Action/Download"));
|
---|
[1169] | 31 | }
|
---|
[612] | 32 |
|
---|
[6084] | 33 | @Override
|
---|
[2132] | 34 | public void actionPerformed(ActionEvent e) {
|
---|
[2331] | 35 | DownloadDialog dialog = DownloadDialog.getInstance();
|
---|
[2335] | 36 | dialog.restoreSettings();
|
---|
[2331] | 37 | dialog.setVisible(true);
|
---|
[2512] | 38 | }
|
---|
[612] | 39 | }
|
---|