Browse Source

CHART-22797 修改冗余代码,将ChangeConfigPane里面关于SwitchTitle为null的冗余判断删除

feature/x
方磊 3 years ago
parent
commit
3764a4ce48
  1. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

@ -23,6 +23,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -238,18 +239,14 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
private void populateSwitchTitlePane(int chartIndex, ChartCollection collection) { private void populateSwitchTitlePane(int chartIndex, ChartCollection collection) {
Chart chart = collection.getChart(chartIndex, Chart.class); Chart chart = collection.getChart(chartIndex, Chart.class);
Object switchTitle = chart.getSwitchTitle(); Object switchTitle = chart.getSwitchTitle();
String result; String result = StringUtils.EMPTY;
if (switchTitle != null) { if (switchTitle != null) {
if (switchTitle instanceof BaseFormula) { if (switchTitle instanceof BaseFormula) {
result = ((BaseFormula) switchTitle).getContent(); result = ((BaseFormula) switchTitle).getContent();
} else { } else {
result = Utils.objectToString(switchTitle); result = Utils.objectToString(switchTitle);
} }
} else {
result = collection.getChartName(chartIndex);
chart.setSwitchTitle(result);
} }
TinyFormulaPane title = new TinyFormulaPane(); TinyFormulaPane title = new TinyFormulaPane();
title.populateBean(result); title.populateBean(result);
switchTitles.add(title); switchTitles.add(title);

Loading…
Cancel
Save