source: osm/applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java@ 12321

Last change on this file since 12321 was 12187, checked in by stoecker, 16 years ago

fixed some warnings, added new shortcur handling

File size: 955 bytes
Line 
1package wmsplugin;
2
3import static org.openstreetmap.josm.tools.I18n.tr;
4
5import java.awt.event.ActionEvent;
6
7import org.openstreetmap.josm.Main;
8import org.openstreetmap.josm.actions.JosmAction;
9import org.openstreetmap.josm.gui.MapView;
10import org.openstreetmap.josm.gui.layer.Layer;
11import org.openstreetmap.josm.data.Bounds;
12
13public class WMSDownloadAction extends JosmAction {
14
15 private WMSInfo info;
16
17 public WMSDownloadAction(WMSInfo info) {
18 super(info.name, "wmsmenu", tr("Download WMS tile from {0}",info.name), null, false);
19 this.info = info;
20 }
21
22 public void actionPerformed(ActionEvent e) {
23 System.out.println(info.url);
24
25 WMSLayer wmsLayer = new WMSLayer(info.name, info.url);
26 Main.main.addLayer(wmsLayer);
27 }
28
29 public static WMSLayer getLayer(WMSInfo info) {
30 // FIXME: move this to WMSPlugin/WMSInfo/preferences.
31 WMSLayer wmsLayer = new WMSLayer(info.name, info.url);
32 Main.main.addLayer(wmsLayer);
33 return wmsLayer;
34 }
35};
Note: See TracBrowser for help on using the repository browser.