From d9c42530dbcf7377c7c5311ab1e56bd95949e86a Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Fri, 25 Oct 2019 10:41:20 +0800 Subject: [PATCH] =?UTF-8?q?CHART-4248=20=E6=BC=8F=E6=96=97=E3=80=81?= =?UTF-8?q?=E5=A4=9A=E5=B1=82=E9=A5=BC=E5=9B=BE=E3=80=81=E8=AF=8D=E4=BA=91?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fields/diff/FunnelCellDataFieldsPane.java | 55 ++++++++++++++++++ .../fields/diff/FunnelDataSetFieldsPane.java | 57 +++++++++++++++++++ .../diff/MultiPieDataSetFieldsPane.java | 2 + .../design/chartx/impl/AbstractDataPane.java | 6 +- .../FunnelIndependentVanChartInterface.java | 14 +++++ .../MultiPieIndependentVanChartInterface.java | 24 +++++--- ...WordCloudIndependentVanChartInterface.java | 23 +++++--- 7 files changed, 160 insertions(+), 21 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelCellDataFieldsPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelCellDataFieldsPane.java new file mode 100644 index 000000000..de5677744 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelCellDataFieldsPane.java @@ -0,0 +1,55 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; +import com.fr.design.chartx.component.CategorySeriesFilterPane; +import com.fr.design.formula.TinyFormulaPane; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/** + * Created by Wim on 2019/10/23. + */ +public class FunnelCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesValuePane { + + private CategorySeriesFilterPane filterPane; + + @Override + protected void initComponents() { + filterPane = new CategorySeriesFilterPane(); + + JPanel northPane = new JPanel(new BorderLayout(0, 6)); + northPane.add(createCenterPane(), BorderLayout.CENTER); + northPane.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 8)); + + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); + this.add(filterPane, BorderLayout.CENTER); + } + + @Override + protected String[] fieldLabels() { + return new String[0]; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + return new TinyFormulaPane[0]; + } + + @Override + public MultiCategoryColumnFieldCollection updateBean() { + MultiCategoryColumnFieldCollection fieldCollection = new MultiCategoryColumnFieldCollection(); + updateSeriesValuePane(fieldCollection); + filterPane.updateMultiCategoryFieldCollection(fieldCollection); + return fieldCollection; + } + + @Override + public void populateBean(MultiCategoryColumnFieldCollection ob) { + populateSeriesValuePane(ob); + filterPane.populateMultiCategoryFieldCollection(ob); + } + +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java new file mode 100644 index 000000000..0f94683bf --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java @@ -0,0 +1,57 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; +import com.fr.design.chartx.component.CategorySeriesFilterPane; +import com.fr.design.gui.icombobox.UIComboBox; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import java.awt.BorderLayout; + +/** + * Created by Wim on 2019/10/23. + */ +public class FunnelDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane { + + + private CategorySeriesFilterPane filterPane; + + @Override + protected void initComponents() { + filterPane = new CategorySeriesFilterPane(); + + JPanel northPane = new JPanel(new BorderLayout(0, 6)); + northPane.add(new JSeparator(), BorderLayout.CENTER); + northPane.add(createCenterPane(), BorderLayout.SOUTH); + northPane.setBorder(BorderFactory.createEmptyBorder(4, 24, 0, 15)); + + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); + this.add(filterPane, BorderLayout.CENTER); + } + + @Override + protected String[] fieldLabels() { + return new String[0]; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + return new UIComboBox[0]; + } + + @Override + public MultiCategoryColumnFieldCollection updateBean() { + MultiCategoryColumnFieldCollection collection = new MultiCategoryColumnFieldCollection(); + updateSeriesValuePane(collection); + filterPane.updateMultiCategoryFieldCollection(collection); + return collection; + } + + @Override + public void populateBean(MultiCategoryColumnFieldCollection ob) { + populateSeriesValuePane(ob); + filterPane.populateMultiCategoryFieldCollection(ob); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiPieDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiPieDataSetFieldsPane.java index 2a299ba6e..da783cfe2 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiPieDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiPieDataSetFieldsPane.java @@ -77,6 +77,7 @@ public class MultiPieDataSetFieldsPane extends AbstractDataSetFieldsPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ return new VanChartMultiPieSeriesPane(parent, plot); diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java index ac5250632..9c771ddac 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java @@ -3,11 +3,16 @@ package com.fr.van.chart.wordcloud.designer; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.chartx.fields.diff.WordCloudCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.WordCloudDataSetFieldsPane; +import com.fr.design.chartx.impl.AbstractDataPane; +import com.fr.design.chartx.single.SingleDataPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.AbstractChartAttrPane; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; @@ -93,13 +98,13 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa return new AbstractChartAttrPane[]{stylePane, otherPane}; } -// @Override -// public ChartDataPane getChartDataPane(AttributeChangeListener listener) { -// return new AbstractDataPane(listener) { -// @Override -// protected SingleDataPane createSingleDataPane() { -// return new SingleDataPane(new WordCloudDataSetFieldsPane(), new WordCloudCellDataFieldsPane()); -// } -// }; -// } + @Override + public ChartDataPane getChartDataPane(AttributeChangeListener listener) { + return new AbstractDataPane(listener) { + @Override + protected SingleDataPane createSingleDataPane() { + return new SingleDataPane(new WordCloudDataSetFieldsPane(), new WordCloudCellDataFieldsPane()); + } + }; + } }