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.

70 lines
2.2 KiB

2 years ago
package com.fr.plugin.pielinecomb.data;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.extended.chart.AbstractExtendedChartTableDataPane;
import com.fr.extended.chart.ExtendedCustomFieldComboBoxPane;
import com.fr.extended.chart.UIComboBoxWithNone;
/**
* @author duan.jingliang
* @date 2022/10/19
*/
public class LineTableDataPane extends AbstractExtendedChartTableDataPane<LineDataConfig> {
private UIComboBoxWithNone category;
private UIComboBoxWithNone gridline;
private UIComboBoxWithNone regioncolor;
@Override
protected ExtendedCustomFieldComboBoxPane createExtendedCustomFieldComboBoxPane() {
return new ExtendedCustomFieldComboBoxPane(){
@Override
protected boolean valueComboBoxHasNone() {
return true;
}
};
}
@Override
protected String[] fieldLabels() {
return new String[]{
Toolkit.i18nText("Plugin-Pielinecomb-category"),
Toolkit.i18nText("Plugin-Pielinecomb-gridline"),
Toolkit.i18nText("Plugin-Pielinecomb-regioncolor")
};
}
@Override
protected UIComboBox[] filedComboBoxes() {
if (this.category == null) {
this.category = new UIComboBoxWithNone();
}
if (this.gridline == null) {
this.gridline = new UIComboBoxWithNone();
}
if (this.regioncolor == null) {
this.regioncolor = new UIComboBoxWithNone();
}
return new UIComboBox[]{
category, gridline, regioncolor
};
}
@Override
protected void populate(LineDataConfig dataConfig) {
populateField(this.category, dataConfig.getCategory());
populateField(this.gridline, dataConfig.getGridline());
populateField(this.regioncolor, dataConfig.getRegioncolor());
}
@Override
protected LineDataConfig update() {
LineDataConfig dataConfig = new LineDataConfig();
updateField(this.category, dataConfig.getCategory());
updateField(this.gridline, dataConfig.getGridline());
updateField(this.regioncolor, dataConfig.getRegioncolor());
return dataConfig;
}
}