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 | |
---|
1 | package wmsplugin;
|
---|
2 |
|
---|
3 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
4 |
|
---|
5 | import java.awt.event.ActionEvent;
|
---|
6 |
|
---|
7 | import org.openstreetmap.josm.Main;
|
---|
8 | import org.openstreetmap.josm.actions.JosmAction;
|
---|
9 | import org.openstreetmap.josm.gui.MapView;
|
---|
10 | import org.openstreetmap.josm.gui.layer.Layer;
|
---|
11 | import org.openstreetmap.josm.data.Bounds;
|
---|
12 |
|
---|
13 | public 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.