From b9fcc636b6cdf8ebdecedf959caee8fb714f7d0e Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 18 Jun 2019 15:38:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=8D=E4=BA=91=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=85=8D=E7=BD=AE=20=E6=9C=89=E5=8A=A9?= =?UTF-8?q?=E4=BA=8E=E7=90=86=E8=A7=A3=E8=AE=A1=E7=AE=97=E7=9A=84=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chartx/WordCloudChartDataPane.java | 20 +++++ .../chartx/WordCloundChartDataPane.java | 20 ----- .../fields/AbstractDataSetFieldsPane.java | 7 ++ .../diff/MultiCategoryDataSetFieldsPane.java | 6 -- .../diff/WordCloudCellDataFieldsPane.java | 70 ++++++++++++++++++ .../diff/WordCloudDataSetFieldsPane.java | 74 +++++++++++++++++++ ...WordCloudIndependentVanChartInterface.java | 21 ++---- 7 files changed, 177 insertions(+), 41 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/WordCloudChartDataPane.java delete mode 100644 designer-chart/src/main/java/com/fr/design/chartx/WordCloundChartDataPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudDataSetFieldsPane.java diff --git a/designer-chart/src/main/java/com/fr/design/chartx/WordCloudChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/WordCloudChartDataPane.java new file mode 100644 index 0000000000..6773081527 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/WordCloudChartDataPane.java @@ -0,0 +1,20 @@ +package com.fr.design.chartx; + +import com.fr.design.chartx.fields.diff.WordCloudCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.WordCloudDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; +import com.fr.design.gui.frpane.AttributeChangeListener; + +/** + * Created by shine on 2019/5/22. + */ +public class WordCloudChartDataPane extends MultiCategoryChartDataPane { + public WordCloudChartDataPane(AttributeChangeListener listener) { + super(listener); + } + + @Override + protected SingleDataPane createSingleDataPane() { + return new SingleDataPane(new WordCloudDataSetFieldsPane(), new WordCloudCellDataFieldsPane()); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/WordCloundChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/WordCloundChartDataPane.java deleted file mode 100644 index 2f3bd39a00..0000000000 --- a/designer-chart/src/main/java/com/fr/design/chartx/WordCloundChartDataPane.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fr.design.chartx; - -import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane; -import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane; -import com.fr.design.chartx.single.SingleDataPane; -import com.fr.design.gui.frpane.AttributeChangeListener; - -/** - * Created by shine on 2019/5/22. - */ -public class WordCloundChartDataPane extends MultiCategoryChartDataPane { - public WordCloundChartDataPane(AttributeChangeListener listener) { - super(listener); - } - - @Override - protected SingleDataPane createSingleDataPane() { - return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); - } -} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java index 84c8401c10..1b0efcd5c4 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java @@ -12,6 +12,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; import com.fr.general.GeneralUtils; +import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -139,4 +140,10 @@ public abstract class AbstractDataSetFieldsPane { + + private UITextField name; + private TinyFormulaPane wordName; + private TinyFormulaPane wordValue; + + @Override + protected void initComponents() { + name = new UITextField(); + wordName = new TinyFormulaPane(); + wordValue = new TinyFormulaPane(); + + super.initComponents(); + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Word_Name"), + Toolkit.i18nText("Fine-Design_Chart_Word_Value") + }; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + return new TinyFormulaPane[]{ + wordName, + wordValue + }; + } + + @Override + protected Component[] fieldComponents() { + return new Component[]{ + name, + wordName, + wordValue + }; + } + + @Override + public void populateBean(WordCloudColumnFieldCollection ob) { + name.setText(ob.getTargetName()); + populateField(wordName, ob.getWordName()); + populateField(wordValue, ob.getWordValue()); + } + + @Override + public WordCloudColumnFieldCollection updateBean() { + WordCloudColumnFieldCollection result = new WordCloudColumnFieldCollection(); + result.setTargetName(name.getText()); + updateField(wordName, result.getWordName()); + populateField(wordValue, result.getWordValue()); + return result; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudDataSetFieldsPane.java new file mode 100644 index 0000000000..77c529ea5a --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudDataSetFieldsPane.java @@ -0,0 +1,74 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.WordCloudColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; + +import java.awt.Component; + +/** + * Created by shine on 2019/6/18. + */ +public class WordCloudDataSetFieldsPane extends AbstractDataSetFieldsPane { + private UITextField name; + private UIComboBox wordName; + private UIComboBox wordValue; + private CalculateComboBox calculateCombox; + + @Override + protected void initComponents() { + name = new UITextField(); + wordName = new UIComboBox(); + wordValue = new UIComboBox(); + calculateCombox = new CalculateComboBox(); + + super.initComponents(); + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Word_Name"), + Toolkit.i18nText("Fine-Design_Chart_Word_Value"), + Toolkit.i18nText("Fine-Design_Chart_Summary_Method") + }; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + return new UIComboBox[]{ + wordName, + wordValue + }; + } + + @Override + protected Component[] fieldComponents() { + return new Component[]{ + name, + wordName, + wordValue, + calculateCombox + }; + } + + @Override + public void populateBean(WordCloudColumnFieldCollection ob) { + name.setText(ob.getTargetName()); + populateField(wordName, ob.getWordName()); + populateFunctionField(wordValue, calculateCombox, ob.getWordValue()); + } + + @Override + public WordCloudColumnFieldCollection updateBean() { + WordCloudColumnFieldCollection result = new WordCloudColumnFieldCollection(); + result.setTargetName(name.getText()); + updateField(wordName, result.getWordName()); + updateFunctionField(wordValue, calculateCombox, result.getWordValue()); + return result; + } +} 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 e6e89c0d93..1b270b90b7 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,23 +3,19 @@ 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.WordCloudChartDataPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.AttributeChangeListener; 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.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.plugin.chart.base.VanChartConstants; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; -import com.fr.van.chart.wordcloud.designer.data.WordCloudPlotReportDataContentPane; -import com.fr.van.chart.wordcloud.designer.data.WordCloudPlotTableDataContentPane; import com.fr.van.chart.wordcloud.designer.other.VanChartWordCloudConditionPane; import com.fr.van.chart.wordcloud.designer.style.VanChartWordCloudSeriesPane; import com.fr.van.chart.wordcloud.designer.type.VanChartWordCloudTypePane; @@ -50,16 +46,6 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa return "com/fr/design/images/form/toolbar/wordcloud.png"; } - @Override - public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { - return new WordCloudPlotReportDataContentPane(); - } - - @Override - public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { - return new WordCloudPlotTableDataContentPane(); - } - @Override public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot) { return new VanChartWordCloudSeriesPane(parent, plot); @@ -104,4 +90,9 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa public String getPlotTypeTitle4PopupWindow(){ return VanChartWordCloudTypePane.TITLE; } + + @Override + public ChartDataPane getChartDataPane(AttributeChangeListener listener) { + return new WordCloudChartDataPane(listener); + } }