From 035883fd5706786f94579d039a60fa339efbc8a4 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 1 Feb 2021 16:42:24 +0800 Subject: [PATCH 1/9] =?UTF-8?q?REPORT-47797=20=E6=9C=AC=E5=9C=B0=E5=92=8C?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E5=B7=A5=E7=A8=8B=E5=88=87=E6=8D=A2=EF=BC=8C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9C=89=E4=B8=A4=E4=B8=AA=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E6=9C=89=E4=BA=9B=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=8F=AA=E7=94=A8=E4=BA=86=5Fnormal=E5=92=8C=5Fselected?= =?UTF-8?q?=E4=B8=A4=E7=A7=8D=E5=9B=BE=E6=A0=87=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=5Fdisabled=E5=9B=BE=E6=A0=87=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E4=B9=8B=E5=89=8D=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=AF=B9=E8=B5=84=E6=BA=90=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E8=BF=9B=E8=A1=8C=E5=88=A4=E6=96=AD=EF=BC=8C?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4IOUtils=E4=B8=AD=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=B7=BB=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E6=96=AD=EF=BC=9B=E6=8A=8A=E9=80=82=E9=85=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=E6=8A=BD=E5=8F=96=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/base/svg/IconUtils.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/base/svg/IconUtils.java b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java index 45c11c60c0..4b5f1b8817 100644 --- a/designer-base/src/main/java/com/fr/base/svg/IconUtils.java +++ b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java @@ -38,9 +38,8 @@ public class IconUtils { if (IOUtils.readResource(resource) != null) { return SVGIcon.readSVGIcon(resource); } - // 适配某些插件里是_normal.png、_selected.png的情况 - String pngResource = resource.replace(ICON_SUFFIX_SVG, ICON_SUFFIX_PNG); - return IOUtils.readIcon(pngResource); + // 适配插件 + return adjustPluginsPng(resource); } return IOUtils.readIcon(resource); } @@ -48,6 +47,17 @@ public class IconUtils { return readNoSuffixResource(resource, ICON_TYPE_NORMAL); } + /** + * 适配插件中使用_normal.png、_selected.png、_disabled.png的情况 + * @param resource 图片路径 + * @return Icon + */ + private static Icon adjustPluginsPng(String resource) { + String pngResource = resource.replace(ICON_SUFFIX_SVG, ICON_SUFFIX_PNG); + // 考虑到某些插件可能只会使用三种图标中的一部分,这里做个判断,不然就会因为资源不存在而报错 + return IOUtils.readResource(pngResource) == null ? new ImageIcon() : IOUtils.readIcon(pngResource); + } + /** * 尝试读取不带扩展名的图标,svg优先,其次png,最后gif,都没读到就打印错误日志,返回空白Icon * @param resource 图片路径 From 9f56de62b6d9842a02b4488f1f2f35a138aa03f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 2 Feb 2021 10:26:09 +0800 Subject: [PATCH 2/9] =?UTF-8?q?CHART-18182=20=E6=A8=A1=E7=B3=8A=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=96=B9=E6=B3=95=E7=A7=BB=E5=8A=A8=E5=88=B0=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=20&=20CHART-18190=20=E7=82=B9=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E9=80=8F=E6=98=8E=E5=BA=A6=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MapAreaMatchPane.java | 4 ++-- .../java/com/fr/design/chartx/component/MatchAreaTable.java | 4 ++-- .../main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index a3e610460b..df68c4a436 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -6,6 +6,7 @@ import com.fr.data.TableDataSource; import com.fr.data.TableDataSourceTailor; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameTableData; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataComboBox; @@ -21,7 +22,6 @@ import com.fr.general.GeneralUtils; import com.fr.general.data.DataModel; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.map.data.MapMatchResult; -import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.script.Calculator; import com.fr.stable.StringUtils; @@ -246,7 +246,7 @@ public class MapAreaMatchPane extends BasicBeanPane { private void populateMatchData(Object[] columnData) { Set geoAreas = matchAreaTable.getItems(); - Map resultMap = ChartGEOJSONHelper.matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); + Map resultMap = GEOJSONHelper.getInstance().matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); Object[][] data = new Object[resultMap.size()][2]; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index 9dd13e77fb..4e1297dd33 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -1,8 +1,8 @@ package com.fr.design.chartx.component; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; -import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import javax.swing.AbstractCellEditor; import javax.swing.JTable; @@ -88,7 +88,7 @@ public class MatchAreaTable extends JTable { return; } int index = areaNameIndex.get(areaName); - String result = ChartGEOJSONHelper.matchArea(GeneralUtils.objectToString(areaName), items); + String result = GEOJSONHelper.getInstance().matchArea(GeneralUtils.objectToString(areaName), items, new HashMap<>()); getColumnModel().getColumn(1).getCellEditor().stopCellEditing(); this.setValueAt(result, index, 1); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java index 2d1cb2304c..a2adff77a7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java @@ -443,7 +443,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { //不透明度 private JPanel createPointAlphaPane() { - pointAlphaPane = new UINumberDragPane(0, 100); + pointAlphaPane = new UINumberDragPaneWithPercent(0, 100); return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), pointAlphaPane); } From 0309c66865c8fc34bf2eb94d612dbf2d405e71be Mon Sep 17 00:00:00 2001 From: abel Date: Tue, 2 Feb 2021 13:33:14 +0800 Subject: [PATCH 3/9] =?UTF-8?q?REPORT-47453=20=E5=92=8C=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=95=86=E9=87=8F=E4=B8=80=E4=B8=8B=EF=BC=8C=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=A1=8C=E9=BB=98=E8=AE=A4=E4=B8=8D=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/webattr/WriteToolBarPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java index 7d878659dc..25ba62708c 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java @@ -74,7 +74,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { northPane.add(GUICoreUtils.createFlowPane(new Component[]{rptShowLocationLabel, centerRadioButton, leftRadioButton}, FlowLayout.LEFT)); colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Face_Write_Current_Edit_Row_Background") + ":"); - colorBox.setSelected(true); + colorBox.setSelected(false); colorBox.addActionListener(colorListener); colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); northPane.add(GUICoreUtils.createFlowPane(new Component[]{colorBox, colorButton}, FlowLayout.LEFT)); From 67897e1a2384a3b127b0140c74b2e6badc16a05b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 3 Feb 2021 14:14:09 +0800 Subject: [PATCH 4/9] =?UTF-8?q?CHART-18127=20=E4=BF=AE=E6=94=B9=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=8F=82=E6=95=B0=E5=88=86=E9=9A=94=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/component/richText/VanChartRichEditorPane.java | 4 +++- .../src/main/resources/com/fr/design/editor/rich_editor.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java index 69c93926c5..e1b7a79c46 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java @@ -30,6 +30,8 @@ import java.util.Map; public class VanChartRichEditorPane { + private static final String PARAMS_SPLITTER = "|"; + private static final String NAME_SPACE = "Pool"; private static final String VARIABLE = "data"; @@ -163,7 +165,7 @@ public class VanChartRichEditorPane { if (paramsMap != null) { for (Map.Entry entry : paramsMap.entrySet()) { paramsStr.append(entry.getKey()).append(":").append(entry.getValue()); - paramsStr.append("-"); + paramsStr.append(PARAMS_SPLITTER); } } diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index f62d7dbb2f..967ff74a0b 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -28,7 +28,7 @@ var getDimensionIds = function (params) { var result = []; - var paramGroup = params.split("-"); + var paramGroup = params.split("|"); for (var i = 0, len = paramGroup.length; i < len; i++) { var [key, value] = paramGroup[i].split(":"); From 2a56160bbc4f47261ca9092c02062f6cf01b351b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 3 Feb 2021 15:42:43 +0800 Subject: [PATCH 5/9] =?UTF-8?q?CHART-18055=20=E4=BF=AE=E6=94=B9=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AE=B5=E6=B1=87=E6=80=BB=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/component/richText/VanChartFieldButton.java | 4 ++-- .../src/main/resources/com/fr/design/editor/rich_editor.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java index 1e76d616cc..a9caac7913 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java @@ -2,11 +2,11 @@ package com.fr.van.chart.designer.component.richText; import com.fr.base.BaseUtils; import com.fr.data.util.function.DataFunction; -import com.fr.data.util.function.NoneFunction; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.plugin.chart.base.FirstFunction; import com.fr.plugin.chart.base.format.AttrTooltipDurationFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.IntervalTimeFormat; @@ -40,7 +40,7 @@ public class VanChartFieldButton extends JPanel { private UIToggleButton fieldButton; private UIButton addButton; - private DataFunction dataFunction = new NoneFunction(); + private DataFunction dataFunction = new FirstFunction(); public VanChartFieldButton(String fieldName, AttrTooltipFormat format, VanChartFieldListener listener) { this(fieldName, format, false, false, listener); diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index 967ff74a0b..2b7677f5c0 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -44,7 +44,7 @@ var getInitContent = function (params, initParams, align) { var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); - var paramGroup = params.split("-"); + var paramGroup = params.split("|"); content = ""; From 48bb2f22445a58b09386c67c7b03bc68fcae52ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 3 Feb 2021 18:45:57 +0800 Subject: [PATCH 6/9] =?UTF-8?q?CHART-18182=20=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MapAreaMatchPane.java | 4 ++-- .../java/com/fr/design/chartx/component/MatchAreaTable.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index df68c4a436..58068d10a8 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -6,7 +6,7 @@ import com.fr.data.TableDataSource; import com.fr.data.TableDataSourceTailor; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameTableData; -import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOMatchHelper; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataComboBox; @@ -246,7 +246,7 @@ public class MapAreaMatchPane extends BasicBeanPane { private void populateMatchData(Object[] columnData) { Set geoAreas = matchAreaTable.getItems(); - Map resultMap = GEOJSONHelper.getInstance().matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); + Map resultMap = GEOMatchHelper.getInstance().matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); Object[][] data = new Object[resultMap.size()][2]; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index 4e1297dd33..cde622464f 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -1,6 +1,6 @@ package com.fr.design.chartx.component; -import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOMatchHelper; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; @@ -88,7 +88,7 @@ public class MatchAreaTable extends JTable { return; } int index = areaNameIndex.get(areaName); - String result = GEOJSONHelper.getInstance().matchArea(GeneralUtils.objectToString(areaName), items, new HashMap<>()); + String result = GEOMatchHelper.getInstance().matchArea(GeneralUtils.objectToString(areaName), items, new HashMap<>()); getColumnModel().getColumn(1).getCellEditor().stopCellEditing(); this.setValueAt(result, index, 1); } From 1803689c0b25f09977985f1a8c49c61ee6392513 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 5 Feb 2021 10:14:25 +0800 Subject: [PATCH 7/9] =?UTF-8?q?CHART-18070=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=E6=94=AF=E6=8C=81=E7=BB=84?= =?UTF-8?q?=E5=90=88=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChartOtherPane.java | 2 +- .../VanChartCustomConditionAttrPane.java | 4 ++- ...anChartCustomPlotConditionAttrTabPane.java | 21 +++++++++++ .../style/VanChartCustomPlotLabelTabPane.java | 15 ++++++++ .../VanChartCustomPlotTooltipTabPane.java | 15 ++++++++ .../custom/style/VanChartCustomStylePane.java | 11 ++++++ .../richText/VanChartRichEditorPane.java | 35 ++++++++++++++++--- .../designer/style/VanChartStylePane.java | 2 +- .../tooltip/VanChartPlotTooltipPane.java | 3 ++ 9 files changed, 101 insertions(+), 7 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java index 54c010119d..4bc363306c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java @@ -111,7 +111,7 @@ public class ChartOtherPane extends AbstractChartAttrPane { public void populateBean(Chart chart) { interactivePane.populateBean(chart); if (ChartOtherPane.this.isHaveCondition()) { - VanChartRichEditorPane.refreshFieldNames(chart); + VanChartRichEditorPane.refreshCommonChartFieldNames(chart); conditionAttrPane.populateBean(chart); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomConditionAttrPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomConditionAttrPane.java index da696fcce7..0631312c8c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomConditionAttrPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomConditionAttrPane.java @@ -39,7 +39,9 @@ public class VanChartCustomConditionAttrPane extends BasicScrollPane { layoutContentPane(); } if(conditionAttrPane != null) { - conditionAttrPane.populateBean((VanChartCustomPlot)chart.getPlot()); + conditionAttrPane.setChart(chart); + conditionAttrPane.populateBean(chart.getPlot()); + conditionAttrPane.tabChanged(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java index cc0689d9c7..4cb5c652f6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java @@ -1,11 +1,13 @@ package com.fr.van.chart.custom.other; +import com.fr.chart.chartattr.Chart; import com.fr.design.dialog.BasicPane; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.van.chart.custom.component.VanChartCustomPlotTabPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import com.fr.van.chart.designer.other.VanChartConditionAttrPane; import javax.swing.JPanel; @@ -16,10 +18,17 @@ import java.util.List; * Created by Fangjie on 2016/4/28. */ public class VanChartCustomPlotConditionAttrTabPane extends VanChartCustomPlotTabPane { + + private Chart chart; + public VanChartCustomPlotConditionAttrTabPane(VanChartCustomPlot plot, BasicPane parent) { super(plot, parent); } + public void setChart(Chart chart) { + this.chart = chart; + } + @Override protected void initTabTitle() { List customPlotList = plot.getCustomPlotList(); @@ -73,6 +82,18 @@ public class VanChartCustomPlotConditionAttrTabPane extends VanChartCustomPlotTa } } + protected void tabChanged() { + List customPlotList = plot.getCustomPlotList(); + int index = getSelectedIndex(); + + if (customPlotList.size() > index && paneList.size() > index) { + VanChartPlot chartPlot = customPlotList.get(index); + + CustomPlotType plotType = CustomPlotFactory.getCustomType(chartPlot); + VanChartRichEditorPane.refreshCustomChartTableFieldNames(chart, plotType); + } + } + @Override public VanChartCustomPlot updateBean() { return null; diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotLabelTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotLabelTabPane.java index 04b94ef5c1..ed1dd63ff0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotLabelTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotLabelTabPane.java @@ -68,6 +68,21 @@ public class VanChartCustomPlotLabelTabPane extends VanChartCustomPlotTabPane customPlotList = plot.getCustomPlotList(); + int index = getSelectedIndex(); + + if (customPlotList.size() > index && paneList.size() > index) { + VanChartPlot chartPlot = customPlotList.get(index); + VanChartPlotLabelPane labelPane = (VanChartPlotLabelPane)paneList.get(index); + VanChartCustomStylePane stylePane = (VanChartCustomStylePane)labelPane.getParentPane(); + + if (stylePane != null) { + stylePane.refreshTableFieldNames(chartPlot); + } + } + } + @Override public VanChartCustomPlot updateBean() { return null; diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotTooltipTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotTooltipTabPane.java index 8595e84515..8cb4f49208 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotTooltipTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotTooltipTabPane.java @@ -67,6 +67,21 @@ public class VanChartCustomPlotTooltipTabPane extends VanChartCustomPlotTabPane< } } + protected void tabChanged() { + List customPlotList = plot.getCustomPlotList(); + int index = getSelectedIndex(); + + if (customPlotList.size() > index && paneList.size() > index) { + VanChartPlot chartPlot = customPlotList.get(index); + VanChartPlotTooltipPane tooltipPane = (VanChartPlotTooltipPane)paneList.get(index); + VanChartCustomStylePane stylePane = (VanChartCustomStylePane)tooltipPane.getParentPane(); + + if (stylePane != null) { + stylePane.refreshTableFieldNames(chartPlot); + } + } + } + @Override public VanChartCustomPlot updateBean() { return null; diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomStylePane.java index fcfdc64de5..a01cbf1cb5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomStylePane.java @@ -5,8 +5,11 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; +import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.VanChartCustomPlot; +import com.fr.plugin.chart.custom.type.CustomPlotType; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import com.fr.van.chart.designer.style.VanChartStylePane; import java.util.List; @@ -68,4 +71,12 @@ public class VanChartCustomStylePane extends VanChartStylePane { CustomPlotFactory.dataSheetSynchronization((VanChartCustomPlot) collection.getSelectedChart().getPlot()); } + public void refreshTableFieldNames(VanChartPlot plot) { + CustomPlotType plotType = CustomPlotFactory.getCustomType(plot); + VanChartRichEditorPane.refreshCustomChartTableFieldNames(getChart(), plotType); + } + + public void refreshTableFieldNames() { + + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java index e1b7a79c46..312c24e84b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java @@ -16,6 +16,8 @@ import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipRichText; +import com.fr.plugin.chart.custom.CustomDefinition; +import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.type.TextAlign; import com.fr.stable.StringUtils; import com.fr.van.chart.designer.PlotFactory; @@ -48,21 +50,46 @@ public class VanChartRichEditorPane { return fieldNames; } - public static void refreshFieldNames(Chart chart) { - VanChartRichEditorPane.fieldNames = null; - + // 更新普通图表中指定plot的数据集字段 + public static void refreshCommonChartFieldNames(Chart chart) { if (chart == null) { return; } Plot plot = chart.getPlot(); - if (plot == null || !PlotFactory.plotSupportAddTableField(plot)) { + if (plot == null) { + return; + } + + VanChartRichEditorPane.fieldNames = null; + + if (!PlotFactory.plotSupportAddTableField(plot)) { return; } TopDefinitionProvider definition = chart.getFilterDefinition(); + VanChartRichEditorPane.refreshFieldNames(definition); + } + + // 更新组合图表中指定plot的数据集字段 + public static void refreshCustomChartTableFieldNames(Chart chart, CustomPlotType plotType) { + if (chart == null || plotType == null) { + return; + } + + VanChartRichEditorPane.fieldNames = null; + TopDefinitionProvider filterDefinition = chart.getFilterDefinition(); + + if (filterDefinition instanceof CustomDefinition) { + CustomDefinition customDefinition = (CustomDefinition) filterDefinition; + Map definitionProviderMap = customDefinition.getDefinitionProviderMap(); + VanChartRichEditorPane.refreshFieldNames(definitionProviderMap.get(plotType)); + } + } + // 更新富文本数据集字段 + public static void refreshFieldNames(TopDefinitionProvider definition) { if (definition == null) { return; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java index bb8df99fdb..53619765c7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java @@ -78,6 +78,6 @@ public class VanChartStylePane extends ChartStylePane { } public void refreshTableFieldNames() { - VanChartRichEditorPane.refreshFieldNames(getChart()); + VanChartRichEditorPane.refreshCommonChartFieldNames(getChart()); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java index aa86fb9a73..5f76337d67 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java @@ -98,6 +98,9 @@ public class VanChartPlotTooltipPane extends BasicPane { return components; } + public VanChartStylePane getParentPane() { + return parent; + } protected void initTooltipContentPane(Plot plot){ tooltipContentPane = PlotFactory.createPlotTooltipContentPane(plot, parent, VanChartPlotTooltipPane.this); From 6793b5bbd683e8e80483846165654d53d37aba88 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 5 Feb 2021 11:09:02 +0800 Subject: [PATCH 8/9] merge code --- .../java/com/fr/design/chartx/component/MapAreaMatchPane.java | 4 ++-- .../java/com/fr/design/chartx/component/MatchAreaTable.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index df68c4a436..58068d10a8 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -6,7 +6,7 @@ import com.fr.data.TableDataSource; import com.fr.data.TableDataSourceTailor; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameTableData; -import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOMatchHelper; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataComboBox; @@ -246,7 +246,7 @@ public class MapAreaMatchPane extends BasicBeanPane { private void populateMatchData(Object[] columnData) { Set geoAreas = matchAreaTable.getItems(); - Map resultMap = GEOJSONHelper.getInstance().matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); + Map resultMap = GEOMatchHelper.getInstance().matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); Object[][] data = new Object[resultMap.size()][2]; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index 4e1297dd33..cde622464f 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -1,6 +1,6 @@ package com.fr.design.chartx.component; -import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOMatchHelper; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; @@ -88,7 +88,7 @@ public class MatchAreaTable extends JTable { return; } int index = areaNameIndex.get(areaName); - String result = GEOJSONHelper.getInstance().matchArea(GeneralUtils.objectToString(areaName), items, new HashMap<>()); + String result = GEOMatchHelper.getInstance().matchArea(GeneralUtils.objectToString(areaName), items, new HashMap<>()); getColumnModel().getColumn(1).getCellEditor().stopCellEditing(); this.setValueAt(result, index, 1); } From 9ae87be65372a77383a0b6ada37701bfbcf15ca0 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 5 Feb 2021 16:04:14 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/component/richText/VanChartFieldButton.java | 7 +++++-- .../designer/component/richText/VanChartFieldListPane.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java index a9caac7913..ba3925501b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java @@ -28,7 +28,7 @@ public class VanChartFieldButton extends JPanel { private static final Icon ADD_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"); private static final int W = 200; - private static final int H = 28; + private static final int H = 24; private final String fieldName; private final String fieldId; @@ -146,6 +146,9 @@ public class VanChartFieldButton extends JPanel { listener.addSelectedField(fieldName, fieldId); } }); + + fieldButton.setBorderPaintedOnlyWhenPressed(true); + addButton.setBorderPaintedOnlyWhenPressed(true); } private JPanel getContentPane() { @@ -160,7 +163,7 @@ public class VanChartFieldButton extends JPanel { double[] rowSize = {p}; double[] columnSize = {e, d}; - JPanel content = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 5, 0); + JPanel content = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0); content.setPreferredSize(new Dimension(W, H)); return content; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java index 61d7cfb257..02a62de3b6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java @@ -114,7 +114,7 @@ public class VanChartFieldListPane extends JPanel { addDefaultFieldButton(fieldPane); fieldPane.setPreferredSize(new Dimension(FIELD_ADD_W, getDefaultFieldButtonList().size() * FIELD_ADD_H)); - fieldPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); + fieldPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 0)); return fieldPane; }