From f92697c91e16df1caf1596cd1a24b81ad08fba4b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 1 Aug 2020 16:40:51 +0800 Subject: [PATCH] =?UTF-8?q?CHART-14744=20=E7=AE=B1=E5=9E=8B=E5=9B=BE?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=95=B0=E6=8D=AE=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CategoryPlotReportDataContentPane.java | 41 ++++-- .../box/BoxIndependentVanChartInterface.java | 4 +- .../data/BoxPlotReportDataContentPane.java | 11 -- .../BoxPlotReportResultDataSeriesPane.java | 4 - .../report/BoxPlotReportDataContentPane.java | 137 ++++++++++++++++++ .../BoxPlotReportDetailedDataSeriesPane.java | 38 +++++ .../BoxPlotReportResultDataSeriesPane.java | 133 +++++++++++++++++ .../report/BoxReportDefinitionHelper.java | 58 ++++++++ .../table/BoxPlotTableDataContentPane.java | 19 +-- 9 files changed, 402 insertions(+), 43 deletions(-) delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDetailedDataSeriesPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportResultDataSeriesPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxReportDefinitionHelper.java diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java index 298ee49370..55eec3a7fc 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java @@ -8,6 +8,7 @@ import com.fr.chart.chartdata.NormalReportDataDefinition; import com.fr.chart.chartdata.SeriesDefinition; import com.fr.design.formula.TinyFormulaPane; 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.ChartDataFilterPane; @@ -27,35 +28,35 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent protected TinyFormulaPane categoryName; protected ChartDataFilterPane filterPane; - + public CategoryPlotReportDataContentPane(){ - + } public CategoryPlotReportDataContentPane(ChartDataPane parent) { initEveryPane(); - categoryName = initCategoryBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Name")); + categoryName = initCategoryBox(Toolkit.i18nText("Fine-Design_Chart_Category_Name")); categoryName.setPreferredSize(new Dimension(246,30)); categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,7)); this.add(categoryName, "0,0,2,0"); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane); panel.setBorder(getSidesBorder()); filterPane.setBorder(getFilterPaneBorder()); this.add(panel, "0,6,2,4"); } - + protected TinyFormulaPane initCategoryBox(final String leftLabel) { TinyFormulaPane categoryName = new TinyFormulaPane() { @Override protected void initLayout() { this.setLayout(new BorderLayout(4, 0)); - + if(StringUtils.isNotEmpty(leftLabel)) { - UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Name")); + UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Category_Name")); label1.setPreferredSize(new Dimension(75, 20)); this.add(label1, BorderLayout.WEST); } - + formulaTextField.setPreferredSize(new Dimension(100, 20)); this.add(formulaTextField, BorderLayout.CENTER); this.add(formulaTextFieldButton, BorderLayout.EAST); @@ -84,15 +85,15 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent checkBoxUse(); } }); - + return categoryName; } @Override protected String[] columnNames() { return new String[]{ - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Value") + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Value") }; } @@ -100,6 +101,10 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent checkBoxUse(); TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition(); + populateDefinition(definition); + } + + public void populateDefinition(TopDefinitionProvider definition) { if (definition instanceof NormalReportDataDefinition) { NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition; if (reportDefinition.getCategoryName() != null) { @@ -110,20 +115,25 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent populateList(list); } } - + seriesPane.doLayout(); } - filterPane.populateBean(collection); + filterPane.populateDefinition(definition, true); } public void updateBean(ChartCollection collection) { collection.getSelectedChart().setFilterDefinition(new NormalReportDataDefinition()); TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition(); + updateDefinition(definition); + } + + public void updateDefinition(TopDefinitionProvider definition) { + if (definition instanceof NormalReportDataDefinition) { NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition; - + reportDefinition.setCategoryName(canBeFormula(categoryName.getUITextField().getText())); List list = updateList(); @@ -136,6 +146,7 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent reportDefinition.add(sd); } } - filterPane.updateBean(collection); + + filterPane.updateDefinition(definition); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java index cb08abcbd1..e7981599fa 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java @@ -13,7 +13,7 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.van.chart.box.data.BoxPlotReportDataContentPane; +import com.fr.van.chart.box.data.report.BoxPlotReportDataContentPane; import com.fr.van.chart.box.data.table.BoxPlotTableDataContentPane; import com.fr.van.chart.designer.other.VanChartInteractivePane; import com.fr.van.chart.designer.other.VanChartOtherPane; @@ -50,7 +50,7 @@ public class BoxIndependentVanChartInterface extends AbstractIndependentVanChart } public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { - return new BoxPlotReportDataContentPane(parent); + return new BoxPlotReportDataContentPane(plot, parent); } public AbstractChartTypePane getPlotTypePane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java deleted file mode 100644 index cce6bf9649..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java +++ /dev/null @@ -1,11 +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.report.CategoryPlotReportDataContentPane; - -public class BoxPlotReportDataContentPane extends CategoryPlotReportDataContentPane { - - public BoxPlotReportDataContentPane(ChartDataPane parent) { - super(parent); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java deleted file mode 100644 index 629c67a5f5..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.fr.van.chart.box.data; - -public class BoxPlotReportResultDataSeriesPane { -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java new file mode 100644 index 0000000000..b43af66908 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java @@ -0,0 +1,137 @@ +package com.fr.van.chart.box.data.report; + +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.ibutton.UIButtonGroup; +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.report.AbstractReportDataContentPane; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.plugin.chart.box.VanChartBoxPlot; +import com.fr.plugin.chart.box.data.VanBoxReportDefinition; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public class BoxPlotReportDataContentPane extends AbstractReportDataContentPane { + + private UIButtonGroup dataType; + + private BoxPlotReportDetailedDataSeriesPane detailedDataSeriesPane; + private BoxPlotReportResultDataSeriesPane resultDataSeriesPane; + + private Plot initplot; + + public BoxPlotReportDataContentPane(Plot plot, ChartDataPane parent) { + this.initplot = plot; + + this.setLayout(new BorderLayout()); + + this.add(createDataTypePane(), BorderLayout.NORTH); + this.add(createSeriesPane(parent), BorderLayout.CENTER); + + initDataTypeListener(); + } + + private JPanel createDataTypePane() { + JPanel pane = new JPanel(new BorderLayout(4, 0)); + pane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); + + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Type")); + label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); + + String[] names = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Detailed_Data"), + Toolkit.i18nText("Fine-Design_Chart_Result_Data") + }; + + dataType = new UIButtonGroup(names); + dataType.setPreferredSize(new Dimension(100, 20)); + + pane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{dataType, null, null, label, null})); + pane.setPreferredSize(new Dimension(246, 30)); + pane.setBorder(BorderFactory.createEmptyBorder(0, 24, 10, 15)); + + return pane; + } + + private JPanel createSeriesPane(ChartDataPane parent) { + detailedDataSeriesPane = new BoxPlotReportDetailedDataSeriesPane(parent); + resultDataSeriesPane = new BoxPlotReportResultDataSeriesPane(); + + JPanel pane = new JPanel(new BorderLayout(4, 0)); + + pane.add(resultDataSeriesPane, BorderLayout.NORTH); + pane.add(detailedDataSeriesPane, BorderLayout.CENTER); + + return pane; + } + + private void initDataTypeListener() { + dataType.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + checkDataPaneVisible(); + } + }); + } + + private void checkDataPaneVisible() { + if (detailedDataSeriesPane != null) { + detailedDataSeriesPane.setVisible(dataType.getSelectedIndex() == 0); + } + if (resultDataSeriesPane != null) { + resultDataSeriesPane.setVisible(dataType.getSelectedIndex() == 1); + } + } + + public void updateBean(ChartCollection collection) { + collection.getSelectedChart().setFilterDefinition(new VanBoxReportDefinition()); + VanBoxReportDefinition report = BoxReportDefinitionHelper.getBoxReportDefinition(collection); + + if (report != null) { + boolean isDetailed = dataType.getSelectedIndex() == 0; + + report.setDetailed(isDetailed); + ((VanChartBoxPlot) initplot).setDetailed(isDetailed); + } + if (detailedDataSeriesPane != null) { + detailedDataSeriesPane.updateBean(collection); + } + if (resultDataSeriesPane != null) { + resultDataSeriesPane.updateBean(collection); + } + } + + public void populateBean(ChartCollection collection) { + VanBoxReportDefinition report = BoxReportDefinitionHelper.getBoxReportDefinition(collection); + + if (report == null) { + dataType.setSelectedIndex(0); + checkDataPaneVisible(); + return; + } + + if (dataType != null) { + dataType.setSelectedIndex(BoxReportDefinitionHelper.isDetailedReportDataType(collection) ? 0 : 1); + } + if (detailedDataSeriesPane != null) { + detailedDataSeriesPane.populateBean(collection); + } + if (resultDataSeriesPane != null) { + resultDataSeriesPane.populateBean(collection); + } + + checkDataPaneVisible(); + } + + protected String[] columnNames() { + return new String[0]; + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDetailedDataSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDetailedDataSeriesPane.java new file mode 100644 index 0000000000..9354ae384b --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDetailedDataSeriesPane.java @@ -0,0 +1,38 @@ +package com.fr.van.chart.box.data.report; + +import com.fr.chart.chartattr.ChartCollection; +import com.fr.design.mainframe.chart.gui.ChartDataPane; +import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane; +import com.fr.plugin.chart.box.data.VanBoxReportDefinition; +import com.fr.plugin.chart.box.data.VanBoxReportDetailedDefinition; + +public class BoxPlotReportDetailedDataSeriesPane extends CategoryPlotReportDataContentPane { + + public BoxPlotReportDetailedDataSeriesPane(ChartDataPane parent) { + super(parent); + } + + public void populateBean(ChartCollection ob) { + VanBoxReportDetailedDefinition definition = BoxReportDefinitionHelper.getBoxReportDetailedDefinition(ob); + + if (definition == null) { + return; + } + + this.populateDefinition(definition); + } + + public void updateBean(ChartCollection ob) { + VanBoxReportDefinition report = BoxReportDefinitionHelper.getBoxReportDefinition(ob); + + if (report == null) { + return; + } + + VanBoxReportDetailedDefinition detailedDefinition = new VanBoxReportDetailedDefinition(); + + this.updateDefinition(detailedDefinition); + + report.setDetailedDefinition(detailedDefinition); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportResultDataSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportResultDataSeriesPane.java new file mode 100644 index 0000000000..240905c65e --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportResultDataSeriesPane.java @@ -0,0 +1,133 @@ +package com.fr.van.chart.box.data.report; + +import com.fr.chart.chartattr.ChartCollection; +import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; +import com.fr.plugin.chart.box.data.VanBoxReportDefinition; +import com.fr.plugin.chart.box.data.VanBoxReportResultDefinition; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; + +public class BoxPlotReportResultDataSeriesPane extends AbstractReportDataContentPane { + + private TinyFormulaPane category; + private TinyFormulaPane seriesName; + private TinyFormulaPane max; + private TinyFormulaPane q3; + private TinyFormulaPane median; + private TinyFormulaPane q1; + private TinyFormulaPane min; + + public BoxPlotReportResultDataSeriesPane() { + this.setLayout(new BorderLayout()); + + initContentComponents(); + + JPanel panel = createContentPane(); + + panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); + + this.add(panel, BorderLayout.CENTER); + } + + private void initContentComponents() { + + category = createTinyFormulaPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Category")); + seriesName = createTinyFormulaPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Series_Name")); + max = createTinyFormulaPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Max")); + q3 = createTinyFormulaPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Q3")); + median = createTinyFormulaPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Median")); + q1 = createTinyFormulaPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Q1")); + min = createTinyFormulaPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Min")); + } + + private JPanel createContentPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] row = {p, p, p, p, p, p, p}; + double[] col = {f}; + + Component[][] components = new Component[][]{ + new Component[]{category}, + new Component[]{seriesName}, + new Component[]{max}, + new Component[]{q3}, + new Component[]{median}, + new Component[]{q1}, + new Component[]{min} + }; + + return TableLayoutHelper.createTableLayoutPane(components, row, col); + } + + private TinyFormulaPane createTinyFormulaPaneWithTitle(final String title) { + + return new TinyFormulaPane() { + protected void initLayout() { + this.setLayout(new BorderLayout(4, 0)); + + UILabel label = new UILabel(title); + label.setPreferredSize(new Dimension(75, 20)); + this.add(label, BorderLayout.WEST); + + formulaTextField.setPreferredSize(new Dimension(100, 20)); + this.add(formulaTextField, BorderLayout.CENTER); + this.add(formulaTextFieldButton, BorderLayout.EAST); + } + }; + } + + public void populateBean(ChartCollection ob) { + VanBoxReportResultDefinition detailedDefinition = BoxReportDefinitionHelper.getBoxReportResultDefinition(ob); + + if (detailedDefinition == null) { + return; + } + + populateFormulaPane(category, detailedDefinition.getCategoryName()); + populateFormulaPane(seriesName, detailedDefinition.getSeriesName()); + populateFormulaPane(max, detailedDefinition.getMax()); + populateFormulaPane(q3, detailedDefinition.getQ3()); + populateFormulaPane(median, detailedDefinition.getMedian()); + populateFormulaPane(q1, detailedDefinition.getQ1()); + populateFormulaPane(min, detailedDefinition.getMin()); + } + + private void populateFormulaPane(TinyFormulaPane pane, Object ob) { + if (ob != null) { + pane.populateBean(ob.toString()); + } + } + + public void updateBean(ChartCollection ob) { + VanBoxReportDefinition report = BoxReportDefinitionHelper.getBoxReportDefinition(ob); + + if (report == null) { + return; + } + + VanBoxReportResultDefinition resultDefinition = new VanBoxReportResultDefinition(); + + resultDefinition.setCategoryName(canBeFormula(category.getUITextField().getText())); + resultDefinition.setSeriesName(canBeFormula(seriesName.getUITextField().getText())); + resultDefinition.setMax(canBeFormula(max.getUITextField().getText())); + resultDefinition.setQ3(canBeFormula(q3.getUITextField().getText())); + resultDefinition.setMedian(canBeFormula(median.getUITextField().getText())); + resultDefinition.setQ1(canBeFormula(q1.getUITextField().getText())); + resultDefinition.setMin(canBeFormula(min.getUITextField().getText())); + + report.setResultDefinition(resultDefinition); + } + + protected String[] columnNames() { + return new String[0]; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxReportDefinitionHelper.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxReportDefinitionHelper.java new file mode 100644 index 0000000000..28bf92fe1b --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxReportDefinitionHelper.java @@ -0,0 +1,58 @@ +package com.fr.van.chart.box.data.report; + +import com.fr.base.chart.chartdata.TopDefinitionProvider; +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.plugin.chart.box.data.VanBoxReportDefinition; +import com.fr.plugin.chart.box.data.VanBoxReportDetailedDefinition; +import com.fr.plugin.chart.box.data.VanBoxReportResultDefinition; + +public class BoxReportDefinitionHelper { + + public static VanBoxReportDefinition getBoxReportDefinition(ChartCollection collection) { + if (collection != null) { + + Chart chart = collection.getSelectedChart(); + + if (chart != null) { + TopDefinitionProvider definitionProvider = chart.getFilterDefinition(); + + if (definitionProvider instanceof VanBoxReportDefinition) { + return (VanBoxReportDefinition) definitionProvider; + } + } + } + + return null; + } + + public static VanBoxReportResultDefinition getBoxReportResultDefinition(ChartCollection collection) { + VanBoxReportDefinition report = getBoxReportDefinition(collection); + + if (report != null) { + return report.getResultDefinition(); + } + + return null; + } + + public static VanBoxReportDetailedDefinition getBoxReportDetailedDefinition(ChartCollection collection) { + VanBoxReportDefinition report = getBoxReportDefinition(collection); + + if (report != null) { + return report.getDetailedDefinition(); + } + + return null; + } + + public static boolean isDetailedReportDataType(ChartCollection collection) { + VanBoxReportDefinition report = getBoxReportDefinition(collection); + + if (report != null) { + return report.isDetailed(); + } + + return true; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java index bb17a6f2cd..cb2de668a0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java @@ -146,8 +146,7 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { } public void updateBean(ChartCollection collection) { - checkChartCollection(collection); - + collection.getSelectedChart().setFilterDefinition(new VanBoxTableDefinition()); VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection); if (table != null) { @@ -168,7 +167,13 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { } public void populateBean(ChartCollection collection) { - checkChartCollection(collection); + VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection); + + if (table == null) { + dataType.setSelectedIndex(0); + checkDataPaneVisible(); + return; + } if (dataType != null) { dataType.setSelectedIndex(BoxTableDefinitionHelper.isDetailedTableDataType(collection) ? 0 : 1); @@ -186,14 +191,6 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { checkDataPaneVisible(); } - private void checkChartCollection(ChartCollection collection) { - VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection); - - if (table == null) { - collection.getSelectedChart().setFilterDefinition(new VanBoxTableDefinition()); - } - } - private void populateDataScreeningPane(ChartDataFilterPane dataScreeningPane, ChartCollection collection) { NormalTableDataDefinition detailedDefinition = BoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);