|
|
@ -1,6 +1,6 @@ |
|
|
|
package com.fr.van.chart.map.designer.type; |
|
|
|
package com.fr.van.chart.map.designer.type; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.decision.webservice.v10.map.WMSFactory; |
|
|
|
import com.fr.decision.webservice.v10.map.MapEditService; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.event.UIObserver; |
|
|
|
import com.fr.design.event.UIObserver; |
|
|
|
import com.fr.design.event.UIObserverListener; |
|
|
|
import com.fr.design.event.UIObserverListener; |
|
|
@ -11,7 +11,6 @@ import com.fr.design.gui.itextarea.UITextArea; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.general.http.HttpClient; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.GisLayer; |
|
|
|
import com.fr.plugin.chart.base.GisLayer; |
|
|
|
import com.fr.plugin.chart.map.layer.WMSLayer; |
|
|
|
import com.fr.plugin.chart.map.layer.WMSLayer; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
@ -85,21 +84,13 @@ public class WMSLayerPane extends JPanel implements UIObserver { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
|
|
|
|
new SwingWorker<Void, Double>() { |
|
|
|
new SwingWorker<Void, Double>() { |
|
|
|
private java.util.List<WMSLayer> list = new ArrayList<>(); |
|
|
|
private List<WMSLayer> list = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected Void doInBackground() { |
|
|
|
protected Void doInBackground() { |
|
|
|
HttpClient httpClient = new HttpClient(wmsUrl.getText() + "service=WMS&request=GetCapabilities"); |
|
|
|
List<String> wmsNames = MapEditService.getInstance().getWMSNames(wmsUrl.getText()); |
|
|
|
httpClient.asGet(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!httpClient.isServerAlive()) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String res = httpClient.getResponseText(); |
|
|
|
|
|
|
|
List<String> layers = WMSFactory.readLayers(res); |
|
|
|
|
|
|
|
list.clear(); |
|
|
|
list.clear(); |
|
|
|
for (String layer : layers) { |
|
|
|
for (String layer : wmsNames) { |
|
|
|
list.add(new WMSLayer(layer, false)); |
|
|
|
list.add(new WMSLayer(layer, false)); |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -108,9 +99,8 @@ public class WMSLayerPane extends JPanel implements UIObserver { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void done() { |
|
|
|
protected void done() { |
|
|
|
connectButton.setText(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); |
|
|
|
connectButton.setText(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); |
|
|
|
if (list != null && list.size() > 0) { |
|
|
|
|
|
|
|
resetWMSLayerPane(list); |
|
|
|
resetWMSLayerPane(list); |
|
|
|
} else { |
|
|
|
if (list == null || list.isEmpty()) { |
|
|
|
FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Chart_Invalid_WMS")); |
|
|
|
FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Chart_Invalid_WMS")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|