From 7795fd6fbb264d7908fb0209796b2670554795b9 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 11 Nov 2024 19:20:41 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-137630=20feat:=20=E4=B8=9C=E5=8C=BA?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8Tab=E5=88=87=E6=8D=A2=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChartOtherPane.java | 6 +++++- .../mainframe/chart/gui/ChartStylePane.java | 15 ++++++++++----- 2 files changed, 15 insertions(+), 6 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 36bc56d6b8..db6a6387dd 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 @@ -17,6 +17,7 @@ import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import javax.swing.JPanel; +import javax.swing.SwingUtilities; import java.util.ArrayList; import java.util.List; import java.awt.BorderLayout; @@ -114,7 +115,10 @@ public class ChartOtherPane extends AbstractChartAttrPane { if (ChartOtherPane.this.isHaveCondition()) { VanChartRichEditorPane.refreshCommonChartFieldNames(chart); ColSelectedWithSummaryMethodEditor.refreshCommonChartFieldNames(chart); - conditionAttrPane.populateBean(chart); + SwingUtilities.invokeLater(() -> { + conditionAttrPane.populateBean(chart); + initListener(conditionAttrPane); + }); } } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartStylePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartStylePane.java index 242cd98bae..2ff5a79f3e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartStylePane.java @@ -30,6 +30,7 @@ public class ChartStylePane extends AbstractChartAttrPane { private Chart chart; private AttributeChangeListener listener; private BasicPane chartAxisPane; + private boolean chartStyleInitialized = false; protected Chart getChart() { return chart; @@ -64,11 +65,15 @@ public class ChartStylePane extends AbstractChartAttrPane { @Override public void populate(ChartCollection collection) { this.chart = collection.getSelectedChart(); - this.remove(leftContentPane); - initContentPane(); - this.removeAttributeChangeListener(); - stylePane.populateBean(chart); - this.addAttributeChangeListener(listener); + // 子组件布局初始化,只在第一次进入的时候绘制 + if (!chartStyleInitialized) { + this.remove(leftContentPane); + initContentPane(); + this.removeAttributeChangeListener(); + this.addAttributeChangeListener(listener); + this.initAllListeners(); + chartStyleInitialized = true; + } this.initAllListeners(); }