Browse Source

Pull request #15434: REPORT-137630 feat: 东区图表Tab切换性能优化

Merge in DESIGN/design from ~ZONGYU.WANG/design:fbp/feature to fbp/feature

* commit '7795fd6fbb264d7908fb0209796b2670554795b9':
  REPORT-137630 feat: 东区图表Tab切换性能优化
fbp/feature
Zongyu.Wang-王宗雨 2 weeks ago
parent
commit
3cf8cdbfbf
  1. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java
  2. 15
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartStylePane.java

6
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 com.fr.van.chart.designer.component.richText.VanChartRichEditorPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -114,7 +115,10 @@ public class ChartOtherPane extends AbstractChartAttrPane {
if (ChartOtherPane.this.isHaveCondition()) { if (ChartOtherPane.this.isHaveCondition()) {
VanChartRichEditorPane.refreshCommonChartFieldNames(chart); VanChartRichEditorPane.refreshCommonChartFieldNames(chart);
ColSelectedWithSummaryMethodEditor.refreshCommonChartFieldNames(chart); ColSelectedWithSummaryMethodEditor.refreshCommonChartFieldNames(chart);
conditionAttrPane.populateBean(chart); SwingUtilities.invokeLater(() -> {
conditionAttrPane.populateBean(chart);
initListener(conditionAttrPane);
});
} }
} }

15
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 Chart chart;
private AttributeChangeListener listener; private AttributeChangeListener listener;
private BasicPane chartAxisPane; private BasicPane chartAxisPane;
private boolean chartStyleInitialized = false;
protected Chart getChart() { protected Chart getChart() {
return chart; return chart;
@ -64,11 +65,15 @@ public class ChartStylePane extends AbstractChartAttrPane {
@Override @Override
public void populate(ChartCollection collection) { public void populate(ChartCollection collection) {
this.chart = collection.getSelectedChart(); this.chart = collection.getSelectedChart();
this.remove(leftContentPane); // 子组件布局初始化,只在第一次进入的时候绘制
initContentPane(); if (!chartStyleInitialized) {
this.removeAttributeChangeListener(); this.remove(leftContentPane);
stylePane.populateBean(chart); initContentPane();
this.addAttributeChangeListener(listener); this.removeAttributeChangeListener();
this.addAttributeChangeListener(listener);
this.initAllListeners();
chartStyleInitialized = true;
}
this.initAllListeners(); this.initAllListeners();
} }

Loading…
Cancel
Save