Browse Source

Merge pull request #503 in DESIGN/design from ~QINGHUI.LIU/design:release/10.0 to release/10.0

* commit 'c3fc7be77cfde08fb878fefc316e206ca904f254':
  完善数据界面
  为“值”下拉框添加选项“无”的判断条件
  为说明信息和值下拉框添加选项“无”
final/10.0
Qinghui.Liu 6 years ago
parent
commit
45c71af2cb
  1. 13
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java
  2. 28
      designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java

13
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java

@ -10,14 +10,13 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.general.GeneralUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.Arrays;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
/**
* Created by shine on 2018/3/2.
@ -54,7 +53,7 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
this.add(panel, BorderLayout.NORTH);
if (hasCustomFieldPane()) {
customFieldComboBoxPane = new ExtendedCustomFieldComboBoxPane();
customFieldComboBoxPane = new ExtendedCustomFieldComboBoxPane(hasNoneItem());
this.add(customFieldComboBoxPane, BorderLayout.CENTER);
}
@ -69,6 +68,10 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
return false;
}
protected boolean hasNoneItem() {
return false;
}
protected Component[] fieldComponents() {
return filedComboBoxes();
}

28
designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java

@ -11,16 +11,12 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITable;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper;
import com.fr.stable.StringUtils;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
@ -30,6 +26,10 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
/**
* Created by shine on 2018/9/12.
@ -38,10 +38,17 @@ public class ExtendedCustomFieldComboBoxPane extends UIComboBoxPane<AbstractData
private static final String[] HEADS = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Field_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")};
private UseFieldValuePane useFieldValuePane;
private boolean hasNoneItem = false;
private CustomFieldNamePane customFieldNamePane;
private List<String> fieldList = new ArrayList<String>();
public ExtendedCustomFieldComboBoxPane(boolean hasNoneItem) {
this.hasNoneItem = hasNoneItem;
}
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(0, 6));
@ -119,6 +126,11 @@ public class ExtendedCustomFieldComboBoxPane extends UIComboBoxPane<AbstractData
series = new UIComboBox();
value = new UIComboBox();
if (hasNoneItem) {
value.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
}
function = new CalculateComboBox();
Component[][] components = new Component[][]{
@ -146,11 +158,17 @@ public class ExtendedCustomFieldComboBoxPane extends UIComboBoxPane<AbstractData
public void clearAllBoxList() {
DataPaneHelper.clearBoxItems(series);
DataPaneHelper.clearBoxItems(value);
if (hasNoneItem) {
value.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
}
}
public void refreshBoxListWithSelectTableData(List columnNameList) {
DataPaneHelper.refreshBoxItems(series, columnNameList);
DataPaneHelper.refreshBoxItems(value, columnNameList);
if (hasNoneItem) {
value.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
}
}
@Override

Loading…
Cancel
Save