Browse Source

CHART-4027 代码质量 chartCount和swichState是一件事情,所以swichState不需要

persist/11.0
shine 5 years ago
parent
commit
1071b66fe7
  1. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  2. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.chart.gui;
import com.fr.base.BaseUtils;
import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.beans.BasicBeanPane;
@ -187,12 +186,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private void calculateMultiChartMode() {
//设置切换功能是否可用
editingCollection.getChangeConfigAttr().setEnable(changeEnable());
//多图表切换模式
if (editingCollection.getChartCount() > 1) {
editingCollection.setState(SwitchState.CHANGE);
} else {
editingCollection.setState(SwitchState.DEFAULT);
}
}
/**
@ -363,7 +356,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private void checkConfigButtonVisible() {
addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChartProvider().getID()));
//新建一个collection
if (editingCollection.getState() == SwitchState.DEFAULT && editingCollection.getSelectedChartProvider() != null) {
if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChartProvider() != null) {
//Chart 不支持图表切换
configButton.setVisible(supportChange());
}

3
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.chart.gui;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
@ -218,7 +217,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
//第一步就是重构cards
cards.clear();
if (enabledChart) {
if (collection.getState() == SwitchState.DEFAULT) {
if (collection.getChartCount() == 1) {
addAllCards();
} else {
addOnePriorityCards(priority);

Loading…
Cancel
Save