From b44b3b3585b74b9dc808362fc36def3e686eea5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 8 Jul 2020 10:02:56 +0800 Subject: [PATCH] =?UTF-8?q?CHART-14346=20=E6=82=AC=E6=B5=AE=E7=AA=97?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=BB=84=E5=90=88=E5=9B=BE=E4=B8=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E9=80=89=E6=8B=A9=E5=8D=95=E5=85=83=E6=A0=BC=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...VanChartCustomPlotDataContentsTabPane.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java index 6dbe9577c..184bc2b11 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java @@ -34,13 +34,15 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab } public void setSupportCellData(boolean supportCellData) { - this.supportCellData = supportCellData; + for (JPanel jPanel : paneList) { + ((VanChartDataPane) jPanel).setSupportCellData(supportCellData); + } } @Override protected void initTabTitle() { - if (plot == null){ + if (plot == null) { return; } @@ -60,7 +62,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab @Override protected List initPaneList() { - if (plot == null){ + if (plot == null) { return null; } @@ -68,10 +70,9 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < customPlotList.size(); i++){ + for (int i = 0; i < customPlotList.size(); i++) { //根据不同的plot创建不同的数据配置界面 ChartDataPane contentPane = new VanChartDataPane(listener); - contentPane.setSupportCellData(supportCellData); paneList.add(contentPane); } @@ -79,15 +80,15 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab } @Override - public void populateBean(ChartCollection chartCollection){ + public void populateBean(ChartCollection chartCollection) { plot = (VanChartCustomPlot) chartCollection.getSelectedChart().getPlot(); - if (paneList == null){ + if (paneList == null) { paneList = initPaneList(); } - if (paneList != null){ + if (paneList != null) { try { @@ -105,14 +106,14 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider dataDefinition = null; if (definition != null && definition instanceof CustomDefinition) { - Map definitionProviderMap = ((CustomDefinition)definition).getDefinitionProviderMap(); + Map definitionProviderMap = ((CustomDefinition) definition).getDefinitionProviderMap(); dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i))); } cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition); ((ChartDataPane) paneList.get(i)).populate(cloneCollection); } - }catch (Exception e){ + } catch (Exception e) { return; } } @@ -124,8 +125,8 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab } @Override - public void updateBean(ChartCollection collection){ - if (paneList == null || plot == null){ + public void updateBean(ChartCollection collection) { + if (paneList == null || plot == null) { return; } try { @@ -158,7 +159,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab customDefinition.setDefinitionProviderMap(definitionMap); collection.getSelectedChart().setFilterDefinition(customDefinition); - }catch (Exception e){ + } catch (Exception e) { return; } } @@ -180,10 +181,11 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab /** * 返回绑定的属性事件. - * @param listener 增加监听 + * + * @param listener 增加监听 */ public void addAttributeChangeListener(AttributeChangeListener listener) { - for (int i = 0; i < paneList.size(); i++){ + for (int i = 0; i < paneList.size(); i++) { ((ChartDataPane) paneList.get(i)).addAttributeChangeListener(listener); } }