Browse Source

Pull request #4202: CHART-19174 feature→release

Merge in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit '3111db9207efb82849ebf23d95cf46ae09fd0a35':
  CHART-19174 设计器自定义wms带token无效问题
zheng-1641779399395
Bjorn 4 years ago
parent
commit
2a0a78ea70
  1. 20
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java

20
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java

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

Loading…
Cancel
Save