You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
3.5 KiB
115 lines
3.5 KiB
7 years ago
|
package com.fr.plugin.demo.ui;
|
||
7 years ago
|
|
||
|
import com.fr.design.gui.icombobox.UIComboBox;
|
||
7 years ago
|
import com.fr.design.gui.itextfield.UITextField;
|
||
7 years ago
|
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
|
||
7 years ago
|
import com.fr.extended.chart.AbstractExtendedChartTableDataPane;
|
||
7 years ago
|
import com.fr.extended.chart.ExtendedCustomFieldComboBoxPane;
|
||
7 years ago
|
import com.fr.plugin.demo.fun.DemoDataConfig;
|
||
7 years ago
|
|
||
7 years ago
|
import java.awt.Component;
|
||
|
|
||
7 years ago
|
/**
|
||
|
* Created by shine on 2018/3/24.
|
||
|
*/
|
||
|
public class DemoTableDataPane extends AbstractExtendedChartTableDataPane<DemoDataConfig>{
|
||
|
private UIComboBox xComboBox;
|
||
7 years ago
|
private UITextField targetName;
|
||
7 years ago
|
private UIComboBox yComboBox;
|
||
|
private UIComboBox zComboBox;
|
||
|
|
||
7 years ago
|
private UIComboBox expect;
|
||
|
private CalculateComboBox expectFunction;
|
||
|
private UIComboBox actual;
|
||
|
private CalculateComboBox actualFunction;
|
||
|
|
||
7 years ago
|
// private UIComboBoxWithNone seriesName;
|
||
|
|
||
7 years ago
|
@Override
|
||
|
protected ExtendedCustomFieldComboBoxPane createExtendedCustomFieldComboBoxPane() {
|
||
|
return new ExtendedCustomFieldComboBoxPane();
|
||
|
}
|
||
7 years ago
|
|
||
7 years ago
|
@Override
|
||
7 years ago
|
protected String[] fieldLabels() {
|
||
7 years ago
|
return new String[]{
|
||
|
"X轴",
|
||
7 years ago
|
"指标名",
|
||
7 years ago
|
"Y轴",
|
||
7 years ago
|
"Z轴",
|
||
|
// "预期值",
|
||
|
// "预期汇总方式",
|
||
|
// "实际值",
|
||
|
// "实际汇总方式"
|
||
7 years ago
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
@Override
|
||
|
protected Component[] fieldComponents() {
|
||
|
if (xComboBox == null) {
|
||
|
xComboBox = new UIComboBox();
|
||
|
targetName = new UITextField();
|
||
|
yComboBox = new UIComboBox();
|
||
|
zComboBox = new UIComboBox();
|
||
7 years ago
|
expect = new UIComboBox();
|
||
|
expectFunction = new CalculateComboBox();
|
||
|
actual = new UIComboBox();
|
||
|
actualFunction = new CalculateComboBox();
|
||
7 years ago
|
}
|
||
|
return new Component[]{
|
||
|
xComboBox,
|
||
7 years ago
|
targetName,
|
||
7 years ago
|
yComboBox,
|
||
7 years ago
|
zComboBox,
|
||
7 years ago
|
expect,
|
||
|
expectFunction,
|
||
|
actual,
|
||
|
actualFunction
|
||
7 years ago
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
@Override
|
||
|
protected UIComboBox[] filedComboBoxes() {
|
||
|
if (xComboBox == null) {
|
||
|
xComboBox = new UIComboBox();
|
||
|
yComboBox = new UIComboBox();
|
||
|
zComboBox = new UIComboBox();
|
||
7 years ago
|
expect = new UIComboBox();
|
||
|
actual = new UIComboBox();
|
||
7 years ago
|
}
|
||
|
return new UIComboBox[]{
|
||
|
xComboBox,
|
||
|
yComboBox,
|
||
7 years ago
|
zComboBox,
|
||
7 years ago
|
expect,
|
||
|
actual
|
||
7 years ago
|
};
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected void populate(DemoDataConfig dataConf) {
|
||
|
populateField(xComboBox, dataConf.getX());
|
||
7 years ago
|
targetName.setText(dataConf.getTargetName());
|
||
7 years ago
|
populateField(yComboBox, dataConf.getY());
|
||
|
populateField(zComboBox, dataConf.getZ());
|
||
7 years ago
|
|
||
|
populateFunctionField(expect, expectFunction, dataConf.getExpect());
|
||
|
populateFunctionField(actual, actualFunction, dataConf.getActual());
|
||
7 years ago
|
}
|
||
|
|
||
|
@Override
|
||
|
protected DemoDataConfig update() {
|
||
|
DemoDataConfig dataConfig = new DemoDataConfig();
|
||
|
|
||
|
updateField(xComboBox, dataConfig.getX());
|
||
7 years ago
|
dataConfig.setTargetName(targetName.getText());
|
||
7 years ago
|
updateField(yComboBox, dataConfig.getY());
|
||
|
updateField(zComboBox, dataConfig.getZ());
|
||
|
|
||
7 years ago
|
updateFunctionField(expect, expectFunction, dataConfig.getExpect());
|
||
|
updateFunctionField(actual, actualFunction, dataConfig.getActual());
|
||
|
|
||
7 years ago
|
return dataConfig;
|
||
|
}
|
||
|
}
|