Browse Source

Merge pull request #1334 in DESIGN/design from ~BJORN/design:feature/10.0 to feature/10.0

* commit 'dae083df05923e34670ae74bdf4f0c92f560e9e4':
  CHART-11265
  CHART-11265
  CHART-11265
  CHART-11265 数据集配置多分类根据轴类型判断灰化 && CHART-11446 下拉框增加了默认无的选项,系列删除了对汇总方式和系列名使用的灰化
research/11.0
Bjorn 5 years ago
parent
commit
3ed2bff6d2
  1. 5
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java
  2. 25
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java
  3. 3
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java
  4. 6
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java
  5. 4
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java
  6. 3
      designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java
  7. 5
      designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java
  8. 33
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java

5
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java

@ -22,11 +22,11 @@ import com.fr.stable.StringUtils;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
/**
* Created by shine on 2018/9/12.
@ -171,7 +171,6 @@ public abstract class AbstractCustomFieldComboBoxPane<T> extends UIComboBoxPane<
public void checkBoxUse(boolean hasUse) {
series.setEnabled(hasUse);
value.setEnabled(hasUse);
function.setEnabled(hasUse);
}
public void clearAllBoxList() {

25
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java

@ -34,6 +34,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
private List<T> categoryComponentList = new ArrayList<T>();
private boolean categoryAxis = true;
protected abstract T createFirstFieldComponent();
@ -43,6 +44,16 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
protected abstract void updateField(T component, ColumnField field);
public void setCategoryAxis(boolean categoryAxis) {
this.categoryAxis = categoryAxis;
if(!categoryAxis){
addButton.setEnabled(false);
for (JComponent component : categoryComponentList) {
component.setEnabled(false);
}
}
}
public AbstractMultiComponentPane() {
UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category"));
@ -126,7 +137,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
}
private boolean canAdd() {
return categoryComponentList.size() < 2;
return categoryComponentList.size() < 2 && categoryAxis;
}
public List<T> componentList() {
@ -169,7 +180,15 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
}
}
public void checkEnable(boolean hasUse){
addButton.setEnabled(hasUse);
public void checkEnable(boolean hasUse) {
//增加按钮是否灰化要根据是否选择了数据源,是否分类轴,分类数量是否超标三个判断
boolean buttonUse = hasUse && categoryAxis && categoryComponentList.size() < 2;
//额外的分类是否灰化根据是否选择了数据源,是否分类轴判断
boolean categoryUse = hasUse && categoryAxis;
addButton.setEnabled(buttonUse);
for (JComponent component : categoryComponentList) {
component.setEnabled(categoryUse);
}
}
}

3
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java

@ -20,7 +20,6 @@ import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Label;
/**
* Created by shine on 2019/07/18.
@ -110,7 +109,7 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
}
};
JPanel presentPane = new JPanel(new BorderLayout(30, 0));
presentPane.add(new Label(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")), BorderLayout.WEST);
presentPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")), BorderLayout.WEST);
presentPane.add(present,BorderLayout.CENTER);
presentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));

6
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java

@ -8,8 +8,8 @@ import com.fr.design.formula.TinyFormulaPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.List;
import java.awt.BorderLayout;
/**
* Created by shine on 2019/4/12.
@ -72,4 +72,8 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
return fieldCollection;
}
public void setCategoryAxis(boolean categoryAxis){
multiCategoryPane.setCategoryAxis(categoryAxis);
}
}

4
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java

@ -86,4 +86,8 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
return columnFieldCollection;
}
public void setCategoryAxis(boolean categoryAxis){
multiCategoryPane.setCategoryAxis(categoryAxis);
}
}

3
designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java

@ -103,11 +103,12 @@ public class DataSetPane extends FurtherBasicBeanPane<DataSetDefinition> {
}
refreshBoxList();
checkBoxUse();
tableDataPane.populateBean(ob.getNameTableData());
dataSetFieldsPane.populateBean(ob.getColumnFieldCollection());
checkBoxUse();
}
@Override

5
designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

@ -14,6 +14,11 @@ public class UIComboBoxWithNone extends UIComboBox {
return Toolkit.i18nText("Fine-Design_Chart_Use_None");
}
public UIComboBoxWithNone() {
super();
addDefaultItem();
}
@Override
public void refreshBoxItems(List list) {
super.refreshBoxItems(list);

33
designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java

@ -1,6 +1,7 @@
package com.fr.van.chart.vanchart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
@ -14,7 +15,13 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.type.AxisType;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.data.VanChartMoreCateReportDataContentPane;
import com.fr.van.chart.designer.data.VanChartMoreCateTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
@ -68,9 +75,33 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
MultiCategoryDataSetFieldsPane multiCategoryDataSetFieldsPane;
MultiCategoryCellDataFieldsPane multiCategoryCellDataFieldsPane;
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
multiCategoryDataSetFieldsPane = new MultiCategoryDataSetFieldsPane();
multiCategoryCellDataFieldsPane = new MultiCategoryCellDataFieldsPane();
return new SingleDataPane(multiCategoryDataSetFieldsPane, multiCategoryCellDataFieldsPane);
}
@Override
public void populate(ChartCollection collection) {
super.populate(collection);
VanChart vanChart = this.getVanChart();
if (vanChart == null) {
return;
}
VanChartRectanglePlot plot = vanChart.getPlot();
VanChartAxis axis = plot.getDefaultXAxis();
if (plot instanceof VanChartColumnPlot
&& ((VanChartColumnPlot) plot).isBar()) {
axis = plot.getDefaultYAxis();
}
multiCategoryDataSetFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY));
multiCategoryCellDataFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY));
}
};
}

Loading…
Cancel
Save