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(); }