Browse Source

整理数据集数据

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
2525b1f62d
  1. 53
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  2. 32
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java
  3. 34
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java
  5. 123
      designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotDataContentPaneHelp.java
  6. 196
      designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java
  7. 20
      designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDetailedDataSeriesPane.java
  8. 72
      designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java
  9. 143
      designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableSeriesTypeUsePane.java

53
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java

@ -7,13 +7,13 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.TopDefinition; import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane; import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane;
import com.fr.design.mainframe.chart.gui.style.ThirdTabPane; import com.fr.design.mainframe.chart.gui.style.ThirdTabPane;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -50,6 +50,11 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
this.isNeedPresent = true; this.isNeedPresent = true;
} }
public ChartDataFilterPane(Plot plot, ChartDataPane parent, boolean isNeedPresent) {
super(plot, parent);
this.isNeedPresent = isNeedPresent;
}
protected void initTabPane() { protected void initTabPane() {
super.initTabPane(); super.initTabPane();
tabPane.setPreferredSize(new Dimension(221, 25)); tabPane.setPreferredSize(new Dimension(221, 25));
@ -109,7 +114,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
* @return 返回标题. * @return 返回标题.
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"); return Toolkit.i18nText("Fine-Design_Chart_Data_Filter");
} }
/** /**
@ -144,12 +149,17 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
} }
public void populateBean(ChartCollection collection, boolean isNeedPresent) { public void populateBean(ChartCollection collection, boolean isNeedPresent) {
relayoutPane(isNeedPresent); TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition();
populateDefinition(topDefinition, isNeedPresent);
}
public void populateDefinition(TopDefinitionProvider topDefinition, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
if (categoryPane != null) { if (categoryPane != null) {
categoryPane.populateBean(collection.getSelectedChart().getFilterDefinition()); categoryPane.populateBean(topDefinition);
} }
if (seriesPane != null) { if (seriesPane != null) {
seriesPane.populateBean(collection.getSelectedChart().getFilterDefinition()); seriesPane.populateBean(topDefinition);
} }
checkBoxUse(); checkBoxUse();
} }
@ -165,11 +175,16 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
* 保存界面数据筛选. * 保存界面数据筛选.
*/ */
public void updateBean(ChartCollection collection) { public void updateBean(ChartCollection collection) {
TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition();
updateDefinition(topDefinition);
}
public void updateDefinition(TopDefinitionProvider topDefinition) {
if (categoryPane != null) { if (categoryPane != null) {
categoryPane.updateBean(collection.getSelectedChart().getFilterDefinition()); categoryPane.updateBean(topDefinition);
} }
if (seriesPane != null) { if (seriesPane != null) {
seriesPane.updateBean(collection.getSelectedChart().getFilterDefinition()); seriesPane.updateBean(topDefinition);
} }
} }
@ -222,13 +237,13 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
} }
protected JPanel initOtherPane() { protected JPanel initOtherPane() {
onlyPreData = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
JPanel panel1 = new JPanel(new BorderLayout()); JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout()); JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(onlyPreData, BorderLayout.NORTH); panel1.add(onlyPreData, BorderLayout.NORTH);
preDataNum = new UITextField(); preDataNum = new UITextField();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Records_Num")); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
combineOther.setSelected(true); combineOther.setSelected(true);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -244,7 +259,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
//默认不显示 //默认不显示
preDataNumPane.setVisible(false); preDataNumPane.setVisible(false);
panel1.add(preDataNumPane, BorderLayout.CENTER); panel1.add(preDataNumPane, BorderLayout.CENTER);
notShowNull = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate")); notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate"));
panel2.add(notShowNull, BorderLayout.NORTH); panel2.add(notShowNull, BorderLayout.NORTH);
onlyPreData.addChangeListener(new ChangeListener() { onlyPreData.addChangeListener(new ChangeListener() {
@ -258,7 +273,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
fire(); fire();
} }
}; };
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present); presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present);
panel2.add(presentPane, BorderLayout.SOUTH); panel2.add(presentPane, BorderLayout.SOUTH);
double[] column = {f}; double[] column = {f};
@ -281,7 +296,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
* 界面标题 "分类" * 界面标题 "分类"
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category"); return Toolkit.i18nText("Fine-Design_Chart_Style_Category");
} }
/** /**
@ -397,13 +412,13 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected JPanel initOtherPane() { protected JPanel initOtherPane() {
onlyPreData = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
JPanel panel1 = new JPanel(new BorderLayout()); JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout()); JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(onlyPreData, BorderLayout.NORTH); panel1.add(onlyPreData, BorderLayout.NORTH);
preDataNum = new UITextField(); preDataNum = new UITextField();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Records_Num")); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
combineOther.setSelected(true); combineOther.setSelected(true);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -419,7 +434,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
//默认不显示 //默认不显示
preDataNumPane.setVisible(false); preDataNumPane.setVisible(false);
panel1.add(preDataNumPane, BorderLayout.CENTER); panel1.add(preDataNumPane, BorderLayout.CENTER);
notShowNull = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series")); notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series"));
panel2.add(notShowNull, BorderLayout.NORTH); panel2.add(notShowNull, BorderLayout.NORTH);
onlyPreData.addChangeListener(new ChangeListener() { onlyPreData.addChangeListener(new ChangeListener() {
@ -433,7 +448,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
fire(); fire();
} }
}; };
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present); presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present);
panel2.add(presentPane, BorderLayout.SOUTH); panel2.add(presentPane, BorderLayout.SOUTH);
double[] column = {f}; double[] column = {f};
@ -457,7 +472,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
* 界面标题 * 界面标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series"); return Toolkit.i18nText("Fine-Design_Chart_Series");
} }
/** /**

32
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java

@ -14,6 +14,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itable.UITable; import com.fr.design.gui.itable.UITable;
import com.fr.design.gui.itable.UITableEditor; import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; 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.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
@ -40,8 +41,15 @@ import java.util.List;
* @version 创建时间2012-12-26 下午04:39:46 * @version 创建时间2012-12-26 下午04:39:46
*/ */
public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollection> { public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollection> {
private static final String[] HEADS = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Field_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")}; private static final String[] HEADS = {
private static final String[] HEADS_NO_SUMMARY = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Field_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")}; Toolkit.i18nText("Fine-Design_Chart_Field_Name"),
Toolkit.i18nText("Fine-Design_Chart_Series_Name"),
Toolkit.i18nText("Fine-Design_Chart_Summary_Method")};
private static final String[] HEADS_NO_SUMMARY = {
Toolkit.i18nText("Fine-Design_Chart_Field_Name"),
Toolkit.i18nText("Fine-Design_Chart_Series_Name")};
private UICorrelationPane seriesDataPane; private UICorrelationPane seriesDataPane;
private List<String> field = new ArrayList<String>(); private List<String> field = new ArrayList<String>();
private JPanel centerPane; private JPanel centerPane;
@ -62,7 +70,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
return new ActionListener() { return new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String[] blank =heads.length == 3?new String[]{StringUtils.EMPTY, StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")}: String[] blank = heads.length == 3 ? new String[]{StringUtils.EMPTY, StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Chart_Use_None")} :
new String[]{StringUtils.EMPTY, StringUtils.EMPTY}; new String[]{StringUtils.EMPTY, StringUtils.EMPTY};
tablePane.addLine(blank); tablePane.addLine(blank);
fireTargetChanged(); fireTargetChanged();
@ -121,7 +129,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
* @return 标题 * @return 标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name");
} }
/** /**
@ -186,9 +194,13 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
} }
} }
public void populateBean(ChartCollection collection,boolean isNeedSummary){ public void populateBean(ChartCollection collection, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition();
populateDefinition(topDefinition, isNeedSummary);
}
public void populateDefinition(TopDefinitionProvider topDefinition, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
if (topDefinition instanceof MoreNameCDDefinition) { if (topDefinition instanceof MoreNameCDDefinition) {
MoreNameCDDefinition moreDefinition = (MoreNameCDDefinition) topDefinition; MoreNameCDDefinition moreDefinition = (MoreNameCDDefinition) topDefinition;
ChartSummaryColumn[] chartSummaryColumnArray = moreDefinition.getChartSummaryColumn(); ChartSummaryColumn[] chartSummaryColumnArray = moreDefinition.getChartSummaryColumn();
@ -221,6 +233,11 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
*/ */
public void updateBean(ChartCollection collection) { public void updateBean(ChartCollection collection) {
TopDefinitionProvider normalDefinition = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider normalDefinition = collection.getSelectedChart().getFilterDefinition();
MoreNameCDDefinition moreDefinition = updateDefinition(normalDefinition);
collection.getSelectedChart().setFilterDefinition(moreDefinition);
}
public MoreNameCDDefinition updateDefinition(TopDefinitionProvider normalDefinition) {
MoreNameCDDefinition moreDefinition = null; MoreNameCDDefinition moreDefinition = null;
if (normalDefinition instanceof MoreNameCDDefinition) { if (normalDefinition instanceof MoreNameCDDefinition) {
moreDefinition = (MoreNameCDDefinition) normalDefinition; moreDefinition = (MoreNameCDDefinition) normalDefinition;
@ -242,7 +259,8 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
} }
} }
moreDefinition.setChartSummaryColumn(dataArray); moreDefinition.setChartSummaryColumn(dataArray);
collection.getSelectedChart().setFilterDefinition(moreDefinition);
return moreDefinition;
} }
/** /**

34
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java

@ -8,6 +8,7 @@ import com.fr.data.util.function.NoneFunction;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; 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.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
@ -79,11 +80,11 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
UILabel Label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")); UILabel Label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
Label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); Label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Value")); UILabel Label2 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
Label2.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); Label2.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label3 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")); UILabel Label3 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
Label3.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); Label3.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
Component[][] components = getUseComponent(Label1, Label2, Label3); Component[][] components = getUseComponent(Label1, Label2, Label3);
@ -93,16 +94,16 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
private void initCenterPaneWithOutCaculateSummary(){ private void initCenterPaneWithOutCaculateSummary() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p, p, p};
UILabel Label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")); UILabel Label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
Label1.setPreferredSize(new Dimension(75, 20)); Label1.setPreferredSize(new Dimension(75, 20));
UILabel Label2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Value")); UILabel Label2 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
Label2.setPreferredSize(new Dimension(75, 20)); Label2.setPreferredSize(new Dimension(75, 20));
UILabel Label3 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")); UILabel Label3 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
Label3.setPreferredSize(new Dimension(75, 20)); Label3.setPreferredSize(new Dimension(75, 20));
Component[][] components = getUseComponentWithOutSummary(Label1, Label2, Label3); Component[][] components = getUseComponentWithOutSummary(Label1, Label2, Label3);
@ -199,7 +200,7 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
* @return 界面标题 * @return 界面标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Value"); return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Value");
} }
/** /**
@ -226,9 +227,14 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
} }
} }
public void populateBean(ChartCollection ob , boolean isNeedSummary){ public void populateBean(ChartCollection ob, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
TopDefinitionProvider topDefinition = ob.getSelectedChart().getFilterDefinition(); TopDefinitionProvider topDefinition = ob.getSelectedChart().getFilterDefinition();
populateDefinition(topDefinition, isNeedSummary);
}
public void populateDefinition(TopDefinitionProvider topDefinition, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
if (topDefinition instanceof OneValueCDDefinition) { if (topDefinition instanceof OneValueCDDefinition) {
OneValueCDDefinition oneDefinition = (OneValueCDDefinition) topDefinition; OneValueCDDefinition oneDefinition = (OneValueCDDefinition) topDefinition;
seriesName.setEditable(true); seriesName.setEditable(true);
@ -256,6 +262,11 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
* 保存界面内容 字段值 * 保存界面内容 字段值
*/ */
public void updateBean(ChartCollection collection) { public void updateBean(ChartCollection collection) {
OneValueCDDefinition oneDefinition = updateDefinition();
collection.getSelectedChart().setFilterDefinition(oneDefinition);
}
public OneValueCDDefinition updateDefinition() {
OneValueCDDefinition oneDefinition = createOneValueCDDefinition(); OneValueCDDefinition oneDefinition = createOneValueCDDefinition();
String seriesName = (String) this.seriesName.getSelectedItem(); String seriesName = (String) this.seriesName.getSelectedItem();
@ -267,7 +278,8 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
}else{ }else{
oneDefinition.setDataFunction(new NoneFunction()); oneDefinition.setDataFunction(new NoneFunction());
} }
collection.getSelectedChart().setFilterDefinition(oneDefinition);
return oneDefinition;
} }
protected OneValueCDDefinition createOneValueCDDefinition(){ protected OneValueCDDefinition createOneValueCDDefinition(){

2
designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java

@ -46,7 +46,7 @@ public class BoxIndependentVanChartInterface extends AbstractIndependentVanChart
} }
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return new BoxPlotTableDataContentPane(parent); return new BoxPlotTableDataContentPane(plot, parent);
} }
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {

123
designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotDataContentPaneHelp.java

@ -0,0 +1,123 @@
package com.fr.van.chart.box.data;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.chart.chartdata.TableDataDefinition;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.box.data.VanBoxTableDefinitionHelper;
import com.fr.plugin.chart.box.data.VanBoxTableResultDefinition;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.ComboBoxModel;
public class BoxPlotDataContentPaneHelp {
public static void populateDataScreeningPane(ChartDataFilterPane dataScreeningPane, ChartCollection collection) {
NormalTableDataDefinition detailedDefinition = VanBoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);
VanBoxTableResultDefinition resultDefinition = VanBoxTableDefinitionHelper.getBoxTableResultDefinition(collection);
if (detailedDefinition != null) {
dataScreeningPane.populateDefinition(detailedDefinition, false);
} else if (resultDefinition != null) {
dataScreeningPane.populateDefinition(resultDefinition, false);
}
}
public static void updateDataScreeningPane(ChartDataFilterPane dataScreeningPane, ChartCollection collection) {
NormalTableDataDefinition detailedDefinition = VanBoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);
VanBoxTableResultDefinition resultDefinition = VanBoxTableDefinitionHelper.getBoxTableResultDefinition(collection);
if (detailedDefinition != null) {
dataScreeningPane.updateDefinition(detailedDefinition);
}
if (resultDefinition != null) {
dataScreeningPane.updateDefinition(resultDefinition);
}
}
public static void updateCategoryPane(UIComboBox categoryCombox, ChartCollection collection, boolean isDetailed) {
Object categoryName = categoryCombox.getSelectedItem();
TableDataDefinition dataDefinition;
if (isDetailed) {
dataDefinition = VanBoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);
if (dataDefinition == null) {
return;
}
if (ArrayUtils.contains(ChartConstants.getNoneKeys(), categoryName)) {
((NormalTableDataDefinition) dataDefinition).setCategoryName(StringUtils.EMPTY);
} else {
((NormalTableDataDefinition) dataDefinition).setCategoryName(categoryName == null ? null : categoryName.toString());
}
} else {
dataDefinition = VanBoxTableDefinitionHelper.getBoxTableResultDefinition(collection);
if (dataDefinition == null) {
return;
}
if (ArrayUtils.contains(ChartConstants.getNoneKeys(), categoryName)) {
((VanBoxTableResultDefinition) dataDefinition).setCategoryName(StringUtils.EMPTY);
} else {
((VanBoxTableResultDefinition) dataDefinition).setCategoryName(categoryName == null ? null : categoryName.toString());
}
}
}
public static void populateCategoryPane(UIComboBox categoryCombox, ChartCollection collection, boolean isDetailed) {
TableDataDefinition data;
if (isDetailed) {
data = VanBoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);
if (data == null) {
categoryCombox.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} else {
populateCategoryItem(categoryCombox, ((NormalTableDataDefinition) data).getCategoryName());
}
} else {
data = VanBoxTableDefinitionHelper.getBoxTableResultDefinition(collection);
if (data == null) {
categoryCombox.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} else {
populateCategoryItem(categoryCombox, ((VanBoxTableResultDefinition) data).getCategoryName());
}
}
}
public static void populateCategoryItem(UIComboBox categoryCombox, Object item) {
if (ComparatorUtils.equals(item, StringUtils.EMPTY)) {
categoryCombox.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} else if (!boxItemsContainsObject(categoryCombox, item)) {
categoryCombox.setSelectedItem(null);
} else {
categoryCombox.setSelectedItem(item);
}
}
public static boolean boxItemsContainsObject(UIComboBox box, Object item) {
if (box == null) {
return false;
}
ComboBoxModel dataModel = box.getModel();
for (int i = 0; i < dataModel.getSize(); i++) {
if (ComparatorUtils.equals(dataModel.getElementAt(i), item)) {
return true;
}
}
return false;
}
}

196
designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java

@ -1,40 +1,65 @@
package com.fr.van.chart.box.data; package com.fr.van.chart.box.data;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.box.data.VanBoxTableDefinition;
import com.fr.plugin.chart.box.data.VanBoxTableDefinitionHelper;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List; import java.util.List;
public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane {
private UIButtonGroup dataType; private UIButtonGroup dataType;
private JPanel detailedDataPane; private UIComboBox categoryCombox;
private JPanel resultDataPane;
public BoxPlotTableDataContentPane(ChartDataPane parent) { private BoxPlotTableSeriesTypeUsePane seriesTypeComboxPane;
private BoxPlotTableResultDataSeriesPane resultDataSeriesPane;
private ChartDataFilterPane dataScreeningPane;
private ChartDataPane parent;
private Plot initplot;
public BoxPlotTableDataContentPane(Plot plot, ChartDataPane parent) {
this.initplot = plot;
this.parent = parent;
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(createDataTypePane(), BorderLayout.NORTH); this.add(createTypeAndCategoryPane(), BorderLayout.NORTH);
this.add(createDetailDataPane(parent), BorderLayout.CENTER); this.add(createSeriesPane(), BorderLayout.CENTER);
this.add(createResultDataPane(parent), BorderLayout.SOUTH); this.add(createFilterPane(), BorderLayout.SOUTH);
initDataTypeListener(); initDataTypeListener();
checkDataPaneVisible();
} }
private JPanel createDataTypePane() { private JPanel createTypeAndCategoryPane() {
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Type")); UILabel buttonLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Type"));
UILabel comboBoxLabel = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category"));
buttonLabel.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
comboBoxLabel.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
String[] names = new String[]{ String[] names = new String[]{
Toolkit.i18nText("Fine-Design_Chart_Detailed_Data"), Toolkit.i18nText("Fine-Design_Chart_Detailed_Data"),
@ -42,34 +67,50 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane {
}; };
dataType = new UIButtonGroup(names); dataType = new UIButtonGroup(names);
categoryCombox = new UIComboBox();
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
dataType.setPreferredSize(new Dimension(100, 20));
categoryCombox.setPreferredSize(new Dimension(100, 20));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] column = {p, f}; double[] column = {p, COMPONENT_WIDTH};
double[] row = {p, p}; double[] row = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{buttonLabel, dataType},
new Component[]{label, dataType}, new Component[]{comboBoxLabel, categoryCombox}
new Component[]{null, null}
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); JPanel pane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column);
pane.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
return pane;
} }
private JPanel createDetailDataPane(ChartDataPane parent) { private JPanel createSeriesPane() {
detailedDataPane = new BoxPlotTableDetailedDataSeriesPane(parent); seriesTypeComboxPane = new BoxPlotTableSeriesTypeUsePane();
resultDataSeriesPane = new BoxPlotTableResultDataSeriesPane();
return detailedDataPane; JPanel pane = new JPanel(new BorderLayout(4, 0));
}
private JPanel createResultDataPane(ChartDataPane parent) { pane.add(seriesTypeComboxPane, BorderLayout.CENTER);
resultDataPane = new BoxPlotTableResultDataSeriesPane(parent); pane.add(resultDataSeriesPane, BorderLayout.SOUTH);
return resultDataPane; return pane;
} }
private JPanel createFilterPane() {
dataScreeningPane = new ChartDataFilterPane(initplot, parent, false);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
JPanel panel = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane);
panel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
return panel;
}
private void initDataTypeListener() { private void initDataTypeListener() {
dataType.addActionListener(new ActionListener() { dataType.addActionListener(new ActionListener() {
@ -77,65 +118,124 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane {
checkDataPaneVisible(); checkDataPaneVisible();
} }
}); });
categoryCombox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
checkSeriseUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox);
}
});
} }
private void checkDataPaneVisible() { private void checkDataPaneVisible() {
if (detailedDataPane != null) { if (seriesTypeComboxPane != null) {
detailedDataPane.setVisible(dataType.getSelectedIndex() == 0); seriesTypeComboxPane.setVisible(dataType.getSelectedIndex() == 0);
} }
if (resultDataPane != null) { if (resultDataSeriesPane != null) {
resultDataPane.setVisible(dataType.getSelectedIndex() == 1); resultDataSeriesPane.setVisible(dataType.getSelectedIndex() == 1);
} }
} }
public void checkBoxUse(boolean hasUse) { public void checkBoxUse(boolean hasUse) {
if (dataType.getSelectedIndex() == 0 && detailedDataPane != null) { categoryCombox.setEnabled(hasUse);
((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).checkBoxUse(hasUse);
if (dataType.getSelectedIndex() == 0 && seriesTypeComboxPane != null) {
seriesTypeComboxPane.checkBoxUse(hasUse);
}
if (dataType.getSelectedIndex() == 1 && resultDataSeriesPane != null) {
resultDataSeriesPane.checkBoxUse(hasUse);
}
dataScreeningPane.checkBoxUse();
}
private void checkSeriseUse(boolean hasUse) {
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.checkBoxUse(hasUse && categoryCombox.getSelectedItem() != null);
} }
if (dataType.getSelectedIndex() == 1 && resultDataPane != null) { }
((BoxPlotTableResultDataSeriesPane) resultDataPane).checkBoxUse(hasUse);
private void makeToolTipUse(UIComboBox comBox) {
if (comBox.getSelectedItem() != null) {
comBox.setToolTipText(comBox.getSelectedItem().toString());
} else {
comBox.setToolTipText(null);
} }
} }
protected void refreshBoxListWithSelectTableData(List list) { protected void refreshBoxListWithSelectTableData(List list) {
if (dataType.getSelectedIndex() == 0 && detailedDataPane != null) { refreshBoxItems(categoryCombox, list);
((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).refreshBoxListWithSelectTableData(list);
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.refreshBoxListWithSelectTableData(list);
} }
if (dataType.getSelectedIndex() == 1 && resultDataPane != null) { if (resultDataSeriesPane != null) {
((BoxPlotTableResultDataSeriesPane) resultDataPane).refreshBoxListWithSelectTableData(list); resultDataSeriesPane.refreshBoxListWithSelectTableData(list);
} }
} }
public void clearAllBoxList() { public void clearAllBoxList() {
if (dataType.getSelectedIndex() == 0 && detailedDataPane != null) { clearBoxItems(categoryCombox);
((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).clearAllBoxList(); categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.clearAllBoxList();
} }
if (dataType.getSelectedIndex() == 1 && resultDataPane != null) { if (resultDataSeriesPane != null) {
((BoxPlotTableResultDataSeriesPane) resultDataPane).clearAllBoxList(); resultDataSeriesPane.clearAllBoxList();
} }
} }
public void updateBean(ChartCollection collection) { public void updateBean(ChartCollection collection) {
if (dataType.getSelectedIndex() == 0 && detailedDataPane != null) { checkChartCollection(collection);
((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).updateBean(collection);
VanBoxTableDefinitionHelper.updateTableDataType(dataType.getSelectedIndex() == 0, collection);
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.updateBean(collection);
BoxPlotDataContentPaneHelp.updateCategoryPane(categoryCombox, collection, true);
}
if (resultDataSeriesPane != null) {
resultDataSeriesPane.updateBean(collection);
BoxPlotDataContentPaneHelp.updateCategoryPane(categoryCombox, collection, false);
} }
if (dataType.getSelectedIndex() == 1 && resultDataPane != null) { if (dataScreeningPane != null) {
((BoxPlotTableResultDataSeriesPane) resultDataPane).updateBean(collection); BoxPlotDataContentPaneHelp.updateDataScreeningPane(dataScreeningPane, collection);
} }
} }
public void populateBean(ChartCollection collection) { public void populateBean(ChartCollection collection) {
if (detailedDataPane != null) { checkChartCollection(collection);
((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).populateBean(collection);
dataType.setSelectedIndex(VanBoxTableDefinitionHelper.isDetailedTableDataType(collection) ? 0 : 1);
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.populateBean(collection);
}
if (resultDataSeriesPane != null) {
resultDataSeriesPane.populateBean(collection);
} }
if (resultDataPane != null) { if (dataType.getSelectedIndex() == 0 && categoryCombox != null) {
((BoxPlotTableResultDataSeriesPane) resultDataPane).populateBean(collection); BoxPlotDataContentPaneHelp.populateCategoryPane(categoryCombox, collection, true);
}
if (dataType.getSelectedIndex() == 1 && categoryCombox != null) {
BoxPlotDataContentPaneHelp.populateCategoryPane(categoryCombox, collection, false);
}
if (dataScreeningPane != null) {
BoxPlotDataContentPaneHelp.populateDataScreeningPane(dataScreeningPane, collection);
} }
dataType.setSelectedIndex(isDetailedDataType(collection) ? 0 : 1); checkDataPaneVisible();
} }
private boolean isDetailedDataType(ChartCollection collection) { private void checkChartCollection(ChartCollection collection) {
return true; VanBoxTableDefinition table = VanBoxTableDefinitionHelper.getBoxTableDefinition(collection);
if (table == null) {
collection.getSelectedChart().setFilterDefinition(new VanBoxTableDefinition());
}
} }
} }

20
designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDetailedDataSeriesPane.java

@ -1,20 +0,0 @@
package com.fr.van.chart.box.data;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane;
import java.util.List;
public class BoxPlotTableDetailedDataSeriesPane extends CategoryPlotTableDataContentPane {
public BoxPlotTableDetailedDataSeriesPane(ChartDataPane parent) {
super(parent);
}
public void refreshBoxListWithSelectTableData(List list) {
refreshBoxItems(categoryCombox, list);
categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
seriesTypeComboxPane.refreshBoxListWithSelectTableData(list);
}
}

72
designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java

@ -1,18 +1,15 @@
package com.fr.van.chart.box.data; package com.fr.van.chart.box.data;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.box.VanChartBoxPlot;
import com.fr.plugin.chart.box.data.VanBoxTableDefinition; import com.fr.plugin.chart.box.data.VanBoxTableDefinition;
import com.fr.plugin.chart.box.data.VanBoxTableDefinitionHelper;
import com.fr.plugin.chart.box.data.VanBoxTableResultDefinition;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -28,23 +25,23 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
private UIComboBox seriesName; private UIComboBox seriesName;
private UIComboBox max; private UIComboBox max;
private UIComboBox q3;
private UIComboBox median; private UIComboBox median;
private UIComboBox q1;
private UIComboBox min; private UIComboBox min;
private ChartDataFilterPane dataScreeningPane; public BoxPlotTableResultDataSeriesPane() {
public BoxPlotTableResultDataSeriesPane(ChartDataPane parent) {
initComboxSize(); initComboxSize();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(createDataSeriesPane(), BorderLayout.CENTER);
this.add(createCenterPane(), BorderLayout.CENTER);
this.add(createSouthPane(parent), BorderLayout.SOUTH);
seriesName.addItemListener(tooltipListener); seriesName.addItemListener(tooltipListener);
max.addItemListener(tooltipListener); max.addItemListener(tooltipListener);
q3.addItemListener(tooltipListener);
median.addItemListener(tooltipListener); median.addItemListener(tooltipListener);
q1.addItemListener(tooltipListener);
min.addItemListener(tooltipListener); min.addItemListener(tooltipListener);
} }
@ -53,27 +50,33 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
seriesName = new UIComboBox(); seriesName = new UIComboBox();
max = new UIComboBox(); max = new UIComboBox();
q3 = new UIComboBox();
median = new UIComboBox(); median = new UIComboBox();
q1 = new UIComboBox();
min = new UIComboBox(); min = new UIComboBox();
seriesName.setPreferredSize(preferredSize); seriesName.setPreferredSize(preferredSize);
max.setPreferredSize(preferredSize); max.setPreferredSize(preferredSize);
q3.setPreferredSize(preferredSize);
median.setPreferredSize(preferredSize); median.setPreferredSize(preferredSize);
q1.setPreferredSize(preferredSize);
min.setPreferredSize(preferredSize); min.setPreferredSize(preferredSize);
} }
private JPanel createCenterPane() { private JPanel createDataSeriesPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] column = {f, COMPONENT_WIDTH}; double[] column = {f, COMPONENT_WIDTH};
double[] row = {p, p, p, p}; double[] row = {p, p, p, p, p, p};
Component[][] components_north = new Component[][]{ Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name")), seriesName}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name")), seriesName},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Max")), max}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Max")), max},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Q3")), q3},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Median")), median}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Median")), median},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Max")), min}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Q1")), q1},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Min")), min},
}; };
JPanel center = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, row, column); JPanel center = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, row, column);
@ -82,60 +85,54 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
return center; return center;
} }
private JPanel createSouthPane(ChartDataPane parent) {
dataScreeningPane = new ChartDataFilterPane(new VanChartBoxPlot(), parent);
JPanel south = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), dataScreeningPane);
south.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
return south;
}
public void checkBoxUse(boolean hasUse) { public void checkBoxUse(boolean hasUse) {
} }
protected void refreshBoxListWithSelectTableData(List list) { protected void refreshBoxListWithSelectTableData(List list) {
refreshBoxItems(seriesName, list); refreshBoxItems(seriesName, list);
refreshBoxItems(max, list); refreshBoxItems(max, list);
refreshBoxItems(q3, list);
refreshBoxItems(median, list); refreshBoxItems(median, list);
refreshBoxItems(q1, list);
refreshBoxItems(min, list); refreshBoxItems(min, list);
} }
public void clearAllBoxList() { public void clearAllBoxList() {
clearBoxItems(seriesName); clearBoxItems(seriesName);
clearBoxItems(max); clearBoxItems(max);
clearBoxItems(q3);
clearBoxItems(median); clearBoxItems(median);
clearBoxItems(q1);
clearBoxItems(min); clearBoxItems(min);
} }
public void populateBean(ChartCollection collection) { public void populateBean(ChartCollection collection) {
super.populateBean(collection); super.populateBean(collection);
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); VanBoxTableResultDefinition definition = VanBoxTableDefinitionHelper.getBoxTableResultDefinition(collection);
if (!(top instanceof VanBoxTableDefinition)) { if (definition == null) {
return; return;
} }
VanBoxTableDefinition definition = (VanBoxTableDefinition) top;
combineCustomEditValue(seriesName, definition.getSeriesName()); combineCustomEditValue(seriesName, definition.getSeriesName());
combineCustomEditValue(max, definition.getMax()); combineCustomEditValue(max, definition.getMax());
combineCustomEditValue(q3, definition.getQ3());
combineCustomEditValue(median, definition.getMedian()); combineCustomEditValue(median, definition.getMedian());
combineCustomEditValue(median, definition.getMin()); combineCustomEditValue(q1, definition.getQ1());
combineCustomEditValue(min, definition.getMin());
dataScreeningPane.populateBean(collection);
} }
@Override
public void updateBean(ChartCollection collection) { public void updateBean(ChartCollection collection) {
VanBoxTableDefinition definition = new VanBoxTableDefinition(); VanBoxTableDefinition table = VanBoxTableDefinitionHelper.getBoxTableDefinition(collection);
collection.getSelectedChart().setFilterDefinition(definition); VanBoxTableResultDefinition definition = new VanBoxTableResultDefinition();
Object resultName = seriesName.getSelectedItem(); Object resultName = seriesName.getSelectedItem();
Object resultMax = max.getSelectedItem(); Object resultMax = max.getSelectedItem();
Object resultQ3 = q3.getSelectedItem();
Object resultMedian = median.getSelectedItem(); Object resultMedian = median.getSelectedItem();
Object resultQ1 = q1.getSelectedItem();
Object resultMin = min.getSelectedItem(); Object resultMin = min.getSelectedItem();
if (resultName == null || ArrayUtils.contains(ChartConstants.getNoneKeys(), resultName)) { if (resultName == null || ArrayUtils.contains(ChartConstants.getNoneKeys(), resultName)) {
@ -147,17 +144,22 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa
if (resultMax != null) { if (resultMax != null) {
definition.setMax(resultMax.toString()); definition.setMax(resultMax.toString());
} }
if (resultQ3 != null) {
definition.setQ3(resultQ3.toString());
}
if (resultMedian != null) { if (resultMedian != null) {
definition.setMedian(resultMedian.toString()); definition.setMedian(resultMedian.toString());
} }
if (resultQ1 != null) {
definition.setQ1(resultQ1.toString());
}
if (resultMin != null) { if (resultMin != null) {
definition.setMin(resultMin.toString()); definition.setMin(resultMin.toString());
} }
dataScreeningPane.updateBean(collection); table.setResultDefinition(definition);
} }
public void redoLayoutPane() { public void redoLayoutPane() {
dataScreeningPane.relayoutPane(this.isNeedSummaryCaculateMethod());
} }
} }

143
designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableSeriesTypeUsePane.java

@ -0,0 +1,143 @@
package com.fr.van.chart.box.data;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.MoreNameCDDefinition;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.chart.chartdata.OneValueCDDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldNamePane;
import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldValuePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.box.data.VanBoxTableDefinition;
import com.fr.plugin.chart.box.data.VanBoxTableDefinitionHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
public class BoxPlotTableSeriesTypeUsePane extends UIComboBoxPane<ChartCollection> {
private static boolean NEED_SUMMERY = false;
private SeriesNameUseFieldValuePane nameFieldValuePane;
private SeriesNameUseFieldNamePane nameFieldNamePane;
public BoxPlotTableSeriesTypeUsePane() {
cards = initPaneList();
initComponents();
}
protected void initLayout() {
this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM));
cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
this.add(createNorthPane(), BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
}
protected UIComboBox createComboBox() {
UIComboBox uiComboBox = new UIComboBox();
UIComponentUtils.setPreferedWidth(uiComboBox, 100);
return uiComboBox;
}
private JPanel createNorthPane() {
JPanel north = new JPanel(new BorderLayout(4, 0));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"));
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
north.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label, null}));
north.setBorder(BorderFactory.createEmptyBorder(10, 24, 0, 15));
return north;
}
public void checkBoxUse(boolean hasUse) {
jcb.setEnabled(hasUse);
nameFieldValuePane.checkUse(hasUse);
}
public void refreshBoxListWithSelectTableData(List list) {
nameFieldValuePane.refreshBoxListWithSelectTableData(list);
nameFieldNamePane.refreshBoxListWithSelectTableData(list);
}
public void clearAllBoxList() {
nameFieldValuePane.clearAllBoxList();
nameFieldNamePane.clearAllBoxList();
}
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Series_Name_From");
}
protected List<FurtherBasicBeanPane<? extends ChartCollection>> initPaneList() {
nameFieldValuePane = new SeriesNameUseFieldValuePane();
nameFieldNamePane = new SeriesNameUseFieldNamePane();
nameFieldValuePane.relayoutPane(NEED_SUMMERY);
nameFieldNamePane.relayoutPane(NEED_SUMMERY);
List<FurtherBasicBeanPane<? extends ChartCollection>> paneList = new ArrayList<FurtherBasicBeanPane<? extends ChartCollection>>();
paneList.add(nameFieldValuePane);
paneList.add(nameFieldNamePane);
return paneList;
}
public void relayoutPane() {
if (jcb.getSelectedIndex() == 0) {
nameFieldValuePane.relayoutPane(NEED_SUMMERY);
} else {
nameFieldNamePane.relayoutPane(NEED_SUMMERY);
}
}
protected void comboBoxItemStateChanged() {
if (jcb.getSelectedIndex() == 0) {
nameFieldValuePane.relayoutPane(NEED_SUMMERY);
} else {
nameFieldNamePane.relayoutPane(NEED_SUMMERY);
}
}
public void populateBean(ChartCollection collection) {
NormalTableDataDefinition definition = VanBoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);
if (definition instanceof OneValueCDDefinition) {
this.setSelectedIndex(0);
nameFieldValuePane.populateDefinition(definition, NEED_SUMMERY);
} else if (definition instanceof MoreNameCDDefinition) {
this.setSelectedIndex(1);
nameFieldNamePane.populateDefinition(definition, NEED_SUMMERY);
}
}
public void updateBean(ChartCollection ob) {
VanBoxTableDefinition table = VanBoxTableDefinitionHelper.getBoxTableDefinition(ob);
NormalTableDataDefinition definition;
if (this.getSelectedIndex() == 0) {
definition = nameFieldValuePane.updateDefinition();
} else {
definition = nameFieldNamePane.updateDefinition(table.getDetailedDefinition());
}
table.setDetailedDefinition(definition);
}
}
Loading…
Cancel
Save