扩展图表示例。
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.

78 lines
2.1 KiB

7 years ago
package com.fr.plugin.demo;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itextfield.UITextField;
7 years ago
import com.fr.extended.chart.AbstractExtendedChartTableDataPane;
import java.awt.Component;
7 years ago
/**
* Created by shine on 2018/3/24.
*/
public class DemoTableDataPane extends AbstractExtendedChartTableDataPane<DemoDataConfig>{
private UIComboBox xComboBox;
private UITextField targetName;
7 years ago
private UIComboBox yComboBox;
private UIComboBox zComboBox;
@Override
7 years ago
protected String[] fieldLabels() {
7 years ago
return new String[]{
"X轴",
"指标名",
7 years ago
"Y轴",
"Z轴"
};
}
@Override
protected Component[] fieldComponents() {
if (xComboBox == null) {
xComboBox = new UIComboBox();
targetName = new UITextField();
yComboBox = new UIComboBox();
zComboBox = new UIComboBox();
}
return new Component[]{
xComboBox,
targetName,
yComboBox,
zComboBox
};
}
7 years ago
@Override
protected UIComboBox[] filedComboBoxes() {
if (xComboBox == null) {
xComboBox = new UIComboBox();
yComboBox = new UIComboBox();
zComboBox = new UIComboBox();
}
return new UIComboBox[]{
xComboBox,
yComboBox,
zComboBox
};
}
@Override
protected void populate(DemoDataConfig dataConf) {
populateField(xComboBox, dataConf.getX());
targetName.setText(dataConf.getTargetName());
7 years ago
populateField(yComboBox, dataConf.getY());
populateField(zComboBox, dataConf.getZ());
}
@Override
protected DemoDataConfig update() {
DemoDataConfig dataConfig = new DemoDataConfig();
updateField(xComboBox, dataConfig.getX());
dataConfig.setTargetName(targetName.getText());
7 years ago
updateField(yComboBox, dataConfig.getY());
updateField(zComboBox, dataConfig.getZ());
return dataConfig;
}
}