From e69f6ecc6b3baeabd02a1e1afab58f659040c47b Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 3 Dec 2019 14:14:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?CHART-11779=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=20=E5=9C=B0=E5=9B=BE=E8=B5=84=E6=BA=90=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=B7=E6=96=B0=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../type/VanChartMapSourceChoosePane.java | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index bbce11d9f..b5960f1b1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -3,6 +3,8 @@ package com.fr.van.chart.map.designer.type; import com.fr.base.Parameter; import com.fr.base.Utils; import com.fr.decision.webservice.v10.map.WMSFactory; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; +import com.fr.design.constants.LayoutConstants; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.file.HistoryTemplateListPane; @@ -19,6 +21,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.general.http.HttpClient; import com.fr.plugin.chart.base.GisLayer; import com.fr.plugin.chart.base.ViewCenter; @@ -34,6 +37,7 @@ import com.fr.plugin.chart.type.ZoomLevel; import com.fr.stable.ArrayUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree; +import com.fr.workspace.WorkContext; import javax.swing.BorderFactory; import javax.swing.JOptionPane; @@ -223,17 +227,33 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { sourceTitleLabel = createSourceTitleLabel(); + boolean hasRefreshButton = !WorkContext.getCurrent().isLocal(); + + UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/control/refresh.png")); + button.setToolTipText("更新服务器地图资源文件"); + button.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + GEOJSONHelper.reset(); + GEOJSONHelper.getInstance(); + } + }); + + double p = TableLayout.PREFERRED; double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {d, e}; double[] rowSize = {p, p}; + + double[] columnSize = hasRefreshButton ? new double[]{d + 10, e - 20, 20} : new double[]{d, e}; + Component[] comps = hasRefreshButton ? new Component[]{sourceTitleLabel, sourceComboBox, button} : new Component[]{sourceTitleLabel, sourceComboBox}; + double hGap = hasRefreshButton ? 0 : TableLayout4VanChartHelper.COMPONENT_INTERVAL; Component[][] components = new Component[][]{ new Component[]{null,null}, - new Component[]{sourceTitleLabel,sourceComboBox}, + comps, }; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize, columnSize); + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, hGap, LayoutConstants.VGAP_LARGE); } private JPanel createGISLayerPane() { From c0f2fc6b886aa88975515cd25e8286c4865b578c Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 3 Dec 2019 14:16:36 +0800 Subject: [PATCH 2/3] tooltip --- .../chart/map/designer/type/VanChartMapSourceChoosePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index b5960f1b1..30627d9cf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -230,7 +230,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { boolean hasRefreshButton = !WorkContext.getCurrent().isLocal(); UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/control/refresh.png")); - button.setToolTipText("更新服务器地图资源文件"); + button.setToolTipText("refresh remote map json"); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { From 676ce66802fa0da8c42e868f1812858755848d92 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 3 Dec 2019 14:23:01 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/map/designer/type/VanChartMapSourceChoosePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index 30627d9cf..297d78166 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -17,6 +17,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; @@ -230,7 +231,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { boolean hasRefreshButton = !WorkContext.getCurrent().isLocal(); UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/control/refresh.png")); - button.setToolTipText("refresh remote map json"); + button.setToolTipText(Toolkit.i18nText("Fine-Design_Chart_Update_Remote_Map_JSON")); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) {