forked from fanruan/design
zheng
6 years ago
7 changed files with 177 additions and 41 deletions
@ -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()); |
||||
} |
||||
} |
@ -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()); |
||||
} |
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.fr.design.chartx.fields.diff; |
||||
|
||||
import com.fr.chartx.data.field.diff.WordCloudColumnFieldCollection; |
||||
import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; |
||||
import com.fr.design.formula.TinyFormulaPane; |
||||
import com.fr.design.gui.itextfield.UITextField; |
||||
import com.fr.design.i18n.Toolkit; |
||||
|
||||
import java.awt.Component; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/18. |
||||
*/ |
||||
public class WordCloudCellDataFieldsPane extends AbstractCellDataFieldsPane<WordCloudColumnFieldCollection> { |
||||
|
||||
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; |
||||
} |
||||
} |
@ -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<WordCloudColumnFieldCollection> { |
||||
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; |
||||
} |
||||
} |
Loading…
Reference in new issue