|
|
|
@ -40,16 +40,16 @@ import java.util.ArrayList;
|
|
|
|
|
* SpecifiedGroupAttrDialog |
|
|
|
|
*/ |
|
|
|
|
public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
|
private CardLayout cardLayout; |
|
|
|
|
private JPanel centerCardPane; |
|
|
|
|
private JPanel conditionsGroupPane; |
|
|
|
|
private FormulaGroupPane formulaGroupPane; |
|
|
|
|
private CardLayout cardLayout; |
|
|
|
|
private JPanel centerCardPane; |
|
|
|
|
private JPanel conditionsGroupPane; |
|
|
|
|
private FormulaGroupPane formulaGroupPane; |
|
|
|
|
|
|
|
|
|
private UIComboBox specifiedComboBox; |
|
|
|
|
private SpecifiedGroupControlPane specifiedControlPane; |
|
|
|
|
private UIComboBox specifiedComboBox; |
|
|
|
|
private SpecifiedGroupControlPane specifiedControlPane; |
|
|
|
|
|
|
|
|
|
//下拉选择列名需要的
|
|
|
|
|
private String[] displayNames; |
|
|
|
|
private String[] displayNames; |
|
|
|
|
|
|
|
|
|
//other pane的控件
|
|
|
|
|
private UICheckBox forceCheckBox; |
|
|
|
@ -58,14 +58,14 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
private UITextField otherTextField; |
|
|
|
|
|
|
|
|
|
public class SpecifiedGroupControlPane extends ObjectJControlPane { |
|
|
|
|
public SpecifiedGroupControlPane(String[] displayNames) { |
|
|
|
|
super(displayNames); |
|
|
|
|
this.addModNameActionListener(new ModNameActionListener() { |
|
|
|
|
public void nameModed(int index, String oldName, String newName) { |
|
|
|
|
populateSelectedValue(); |
|
|
|
|
} |
|
|
|
|
public SpecifiedGroupControlPane(String[] displayNames) { |
|
|
|
|
super(displayNames); |
|
|
|
|
this.addModNameActionListener(new ModNameActionListener() { |
|
|
|
|
public void nameModed(int index, String oldName, String newName) { |
|
|
|
|
populateSelectedValue(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public NameableCreator[] createNameableCreators() { |
|
|
|
@ -81,24 +81,24 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public SpecifiedGroupAttrPane(String[] displayNames) { |
|
|
|
|
this.displayNames = displayNames; |
|
|
|
|
this.displayNames = displayNames; |
|
|
|
|
this.initComponents(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void initComponents() { |
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
specifiedComboBox = new UIComboBox(new String[]{ |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Condition_Group"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Formula_Group") |
|
|
|
|
specifiedComboBox = new UIComboBox(new String[] { |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Condition", "Group"}), com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Formula", "Group"}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
specifiedComboBox.addItemListener(new ItemListener() { |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
if (specifiedComboBox.getSelectedIndex() == 0) { |
|
|
|
|
cardLayout.show(centerCardPane, "Condition"); |
|
|
|
|
} else { |
|
|
|
|
cardLayout.show(centerCardPane, "Formula"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
if (specifiedComboBox.getSelectedIndex() == 0) { |
|
|
|
|
cardLayout.show(centerCardPane, "Condition"); |
|
|
|
|
} else { |
|
|
|
|
cardLayout.show(centerCardPane, "Formula"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
JPanel northPane = GUICoreUtils.createFlowPane( |
|
|
|
@ -160,59 +160,59 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
* check Valid |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void checkValid() throws Exception { |
|
|
|
|
public void checkValid() throws Exception { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// denny_DS
|
|
|
|
|
// denny_DS
|
|
|
|
|
public void populate(RecordGrouper grouper) { |
|
|
|
|
if (grouper == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(grouper == null){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (grouper instanceof CustomGrouper) { |
|
|
|
|
this.specifiedComboBox.setSelectedIndex(0); |
|
|
|
|
cardLayout.show(centerCardPane, "Condition"); |
|
|
|
|
CustomGrouper customGrouper = (CustomGrouper) grouper; |
|
|
|
|
boolean force = customGrouper.isForce(); |
|
|
|
|
ConditionGroup[] conditionGroups = customGrouper.getConditionGroups(); |
|
|
|
|
boolean more = customGrouper.isMore(); |
|
|
|
|
int other = customGrouper.getOther(); |
|
|
|
|
String odisplay = customGrouper.getOtherdisplay(); |
|
|
|
|
|
|
|
|
|
this.forceCheckBox.setSelected(force); |
|
|
|
|
|
|
|
|
|
this.moreCheckBox.setSelected(more); |
|
|
|
|
|
|
|
|
|
if (other == CustomGrouper.TOGETHER) { |
|
|
|
|
this.otherComboBox.setSelectedIndex(2); |
|
|
|
|
this.otherTextField.setEnabled(true); |
|
|
|
|
} else if (other == CustomGrouper.DISCARD) { |
|
|
|
|
this.otherComboBox.setSelectedIndex(0); |
|
|
|
|
this.otherTextField.setEnabled(false); |
|
|
|
|
} else { |
|
|
|
|
this.otherComboBox.setSelectedIndex(1); |
|
|
|
|
this.otherTextField.setEnabled(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (odisplay != null) { |
|
|
|
|
this.otherTextField.setText(odisplay); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (conditionGroups != null) { |
|
|
|
|
java.util.List<NameObject> list = new ArrayList<NameObject>(); |
|
|
|
|
for (int i = 0; i < conditionGroups.length; i++) { |
|
|
|
|
list.add(new NameObject(conditionGroups[i].getDisplay(), conditionGroups[i])); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
specifiedControlPane.populate(list.toArray(new NameObject[list.size()])); |
|
|
|
|
} |
|
|
|
|
this.specifiedComboBox.setSelectedIndex(0); |
|
|
|
|
cardLayout.show(centerCardPane, "Condition"); |
|
|
|
|
CustomGrouper customGrouper = (CustomGrouper)grouper; |
|
|
|
|
boolean force = customGrouper.isForce(); |
|
|
|
|
ConditionGroup[] conditionGroups = customGrouper.getConditionGroups(); |
|
|
|
|
boolean more = customGrouper.isMore(); |
|
|
|
|
int other = customGrouper.getOther(); |
|
|
|
|
String odisplay = customGrouper.getOtherdisplay(); |
|
|
|
|
|
|
|
|
|
this.forceCheckBox.setSelected(force); |
|
|
|
|
|
|
|
|
|
this.moreCheckBox.setSelected(more); |
|
|
|
|
|
|
|
|
|
if (other == CustomGrouper.TOGETHER) { |
|
|
|
|
this.otherComboBox.setSelectedIndex(2); |
|
|
|
|
this.otherTextField.setEnabled(true); |
|
|
|
|
} else if (other == CustomGrouper.DISCARD) { |
|
|
|
|
this.otherComboBox.setSelectedIndex(0); |
|
|
|
|
this.otherTextField.setEnabled(false); |
|
|
|
|
} else { |
|
|
|
|
this.otherComboBox.setSelectedIndex(1); |
|
|
|
|
this.otherTextField.setEnabled(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (odisplay != null) { |
|
|
|
|
this.otherTextField.setText(odisplay); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (conditionGroups != null){ |
|
|
|
|
java.util.List<NameObject> list = new ArrayList<NameObject>(); |
|
|
|
|
for(int i = 0; i < conditionGroups.length; i++) { |
|
|
|
|
list.add(new NameObject(conditionGroups[i].getDisplay(), conditionGroups[i])); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
specifiedControlPane.populate(list.toArray(new NameObject[list.size()])); |
|
|
|
|
} |
|
|
|
|
} else if (grouper instanceof FunctionGrouper |
|
|
|
|
&& ((FunctionGrouper) grouper).isCustom()) { |
|
|
|
|
this.specifiedComboBox.setSelectedIndex(1); |
|
|
|
|
cardLayout.show(centerCardPane, "Formula"); |
|
|
|
|
formulaGroupPane.populate(grouper); |
|
|
|
|
&& ((FunctionGrouper)grouper).isCustom()) { |
|
|
|
|
this.specifiedComboBox.setSelectedIndex(1); |
|
|
|
|
cardLayout.show(centerCardPane, "Formula"); |
|
|
|
|
formulaGroupPane.populate(grouper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (otherComboBox.getSelectedIndex() == 2) { |
|
|
|
@ -223,53 +223,52 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public RecordGrouper update(CellElement cellElement, RecordGrouper recordGrouper) { |
|
|
|
|
if (this.specifiedComboBox.getSelectedIndex() == 0) { |
|
|
|
|
CustomGrouper customGroup = new CustomGrouper(); |
|
|
|
|
if (this.specifiedComboBox.getSelectedIndex() == 0) { |
|
|
|
|
CustomGrouper customGroup = new CustomGrouper(); |
|
|
|
|
|
|
|
|
|
if (forceCheckBox.isSelected()) { |
|
|
|
|
customGroup.setForce(true); |
|
|
|
|
customGroup.setForce(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!moreCheckBox.isSelected()) { |
|
|
|
|
customGroup.setMore(false); |
|
|
|
|
customGroup.setMore(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (otherComboBox.getSelectedIndex() == 2) { |
|
|
|
|
customGroup.setOther(CustomGrouper.TOGETHER); |
|
|
|
|
customGroup.setOther(CustomGrouper.TOGETHER); |
|
|
|
|
} else if (otherComboBox.getSelectedIndex() == 0) { |
|
|
|
|
customGroup.setOther(CustomGrouper.DISCARD); |
|
|
|
|
customGroup.setOther(CustomGrouper.DISCARD); |
|
|
|
|
} else { |
|
|
|
|
customGroup.setOther(CustomGrouper.LEAVE); |
|
|
|
|
customGroup.setOther(CustomGrouper.LEAVE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
customGroup.setOdisplay(this.otherTextField.getText()); |
|
|
|
|
|
|
|
|
|
// Nameable[]居然不能强转成NameObject[],一定要这么写...
|
|
|
|
|
Nameable[] res = specifiedControlPane.update(); |
|
|
|
|
NameObject[] nameObject_array = new NameObject[res.length]; |
|
|
|
|
java.util.Arrays.asList(res).toArray(nameObject_array); |
|
|
|
|
ConditionGroup[] res_array = new ConditionGroup[res.length]; |
|
|
|
|
for (int i = 0; i < res.length; i++) { |
|
|
|
|
res_array[i] = (ConditionGroup) nameObject_array[i].getObject(); |
|
|
|
|
res_array[i].setDisplay(nameObject_array[i].getName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
customGroup.setConditionGroups(res_array); |
|
|
|
|
recordGrouper = customGroup; |
|
|
|
|
} else { |
|
|
|
|
recordGrouper = formulaGroupPane.update(); |
|
|
|
|
} |
|
|
|
|
Nameable[] res = specifiedControlPane.update(); |
|
|
|
|
NameObject[] nameObject_array = new NameObject[res.length]; |
|
|
|
|
java.util.Arrays.asList(res).toArray(nameObject_array); |
|
|
|
|
ConditionGroup[] res_array = new ConditionGroup[res.length]; |
|
|
|
|
for (int i = 0; i < res.length; i ++) { |
|
|
|
|
res_array[i] = (ConditionGroup)nameObject_array[i].getObject(); |
|
|
|
|
res_array[i].setDisplay(nameObject_array[i].getName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
customGroup.setConditionGroups(res_array); |
|
|
|
|
recordGrouper = customGroup; |
|
|
|
|
} else { |
|
|
|
|
recordGrouper = formulaGroupPane.update(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return recordGrouper; |
|
|
|
|
return recordGrouper; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static class ConditionGroupDetailsPane extends BasicBeanPane<ConditionGroup> { |
|
|
|
|
private ConditionGroup editing; |
|
|
|
|
|
|
|
|
|
private DSColumnLiteConditionPane liteConditionPane; |
|
|
|
|
private ConditionGroup editing; |
|
|
|
|
|
|
|
|
|
public ConditionGroupDetailsPane(String[] displayNames) { |
|
|
|
|
//alex:右侧的组内的条件细节
|
|
|
|
|
private DSColumnLiteConditionPane liteConditionPane; |
|
|
|
|
public ConditionGroupDetailsPane(String[] displayNames) { |
|
|
|
|
//alex:右侧的组内的条件细节
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); |
|
|
|
|
|
|
|
|
@ -286,17 +285,17 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public ConditionGroup updateBean() { |
|
|
|
|
editing.setCondition(liteConditionPane.updateBean()); |
|
|
|
|
public ConditionGroup updateBean() { |
|
|
|
|
editing.setCondition(liteConditionPane.updateBean()); |
|
|
|
|
|
|
|
|
|
return editing; |
|
|
|
|
} |
|
|
|
|
return editing; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void populateBean(ConditionGroup ob) { |
|
|
|
|
editing = ob; |
|
|
|
|
liteConditionPane.populateBean(ob.getCondition()); |
|
|
|
|
} |
|
|
|
|
public void populateBean(ConditionGroup ob) { |
|
|
|
|
editing = ob; |
|
|
|
|
liteConditionPane.populateBean(ob.getCondition()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class FormulaGroupPane extends JPanel { |
|
|
|
@ -311,7 +310,7 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
private JPanel southPane; |
|
|
|
|
|
|
|
|
|
public FormulaGroupPane() { |
|
|
|
|
this.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("D-Dispaly_Divide_Result_Set_into_Groups"))); |
|
|
|
|
this.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_D_Dispaly_Divide_Result_Set_into_Groups"))); |
|
|
|
|
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); |
|
|
|
|
JPanel contentPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); |
|
|
|
|
this.add(contentPane, BorderLayout.NORTH); |
|
|
|
@ -321,10 +320,10 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
contentPane.add(northPane); |
|
|
|
|
modeComboBox = new UIComboBox(displayModeNames); |
|
|
|
|
|
|
|
|
|
northPane.add(GUICoreUtils.createFlowPane(new JComponent[] { new UILabel(InsertText), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Display_Modes") + ": "), |
|
|
|
|
modeComboBox }, FlowLayout.LEFT), BorderLayout.WEST); |
|
|
|
|
northPane.add(GUICoreUtils.createFlowPane(new JComponent[] { new UILabel(InsertText), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Display_Modes") + ": "), |
|
|
|
|
modeComboBox }, FlowLayout.LEFT), BorderLayout.WEST); |
|
|
|
|
|
|
|
|
|
UILabel label = new UILabel("="); |
|
|
|
|
UILabel label = new UILabel("="); |
|
|
|
|
label.setFont(new Font("Dialog", Font.BOLD, 12)); |
|
|
|
|
valueField = new UITextField(16); |
|
|
|
|
valueField.setText("$$$"); |
|
|
|
@ -334,7 +333,7 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
formulaButton.setPreferredSize(new Dimension(25, valueField.getPreferredSize().height)); |
|
|
|
|
formulaButton.addActionListener(new ActionListener() { |
|
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
|
BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build(); |
|
|
|
|
BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build(); |
|
|
|
|
String text = valueField.getText(); |
|
|
|
|
if (text == null || text.length() <= 0) { |
|
|
|
|
valueFormula.setContent("$$$"); |
|
|
|
@ -344,59 +343,59 @@ public class SpecifiedGroupAttrPane extends BasicPane {
|
|
|
|
|
|
|
|
|
|
final UIFormula formulaPane = FormulaFactory.createFormulaPane(); |
|
|
|
|
|
|
|
|
|
formulaPane.populate(valueFormula, new CustomVariableResolver(displayNames == null ? new String[0] : displayNames, true)); |
|
|
|
|
formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(FormulaGroupPane.this), new DialogActionAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void doOk() { |
|
|
|
|
BaseFormula valueFormula = formulaPane.update(); |
|
|
|
|
formulaPane.populate(valueFormula, new CustomVariableResolver(displayNames == null? new String[0] : displayNames, true)); |
|
|
|
|
formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(FormulaGroupPane.this), new DialogActionAdapter(){ |
|
|
|
|
@Override |
|
|
|
|
public void doOk() { |
|
|
|
|
BaseFormula valueFormula = formulaPane.update(); |
|
|
|
|
if (valueFormula.getContent().length() <= 1) { |
|
|
|
|
valueField.setText("$$$"); |
|
|
|
|
} else { |
|
|
|
|
valueField.setText(valueFormula.getContent().substring(1)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}).setVisible(true); |
|
|
|
|
} |
|
|
|
|
}).setVisible(true); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
southPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(InsertText), //new UILabel(com.fr.design.i18n.Toolkit.i18nText("I-Message_FunctionGrouper_2")),
|
|
|
|
|
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Custom_Value") + ": "), label, valueField, formulaButton}, FlowLayout.LEFT); |
|
|
|
|
southPane = GUICoreUtils.createFlowPane(new JComponent[] {new UILabel(InsertText), //new UILabel(com.fr.design.i18n.Toolkit.i18nText("I-Message_FunctionGrouper_2")),
|
|
|
|
|
new UILabel(com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Custom", "Value"}) + ": "), label, valueField, formulaButton}, FlowLayout.LEFT); |
|
|
|
|
contentPane.add(southPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// populate
|
|
|
|
|
public void populate(RecordGrouper grouper) { |
|
|
|
|
if (grouper instanceof FunctionGrouper) { |
|
|
|
|
int mode = ((FunctionGrouper) grouper).getDivideMode(); |
|
|
|
|
if (mode == FunctionGrouper.GROUPING_MODE) { |
|
|
|
|
this.modeComboBox.setSelectedIndex(0); |
|
|
|
|
} else if (mode == FunctionGrouper.LIST_MODE) { |
|
|
|
|
this.modeComboBox.setSelectedIndex(1); |
|
|
|
|
} else { |
|
|
|
|
this.modeComboBox.setSelectedIndex(2); |
|
|
|
|
} |
|
|
|
|
String formulaContent = ((FunctionGrouper) grouper).getFormulaContent(); |
|
|
|
|
if (formulaContent == null) { |
|
|
|
|
this.valueField.setText("$$$"); |
|
|
|
|
} else { |
|
|
|
|
this.valueField.setText(formulaContent); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public RecordGrouper update() { |
|
|
|
|
FunctionGrouper grouper = new FunctionGrouper(); |
|
|
|
|
grouper.setCustom(true); |
|
|
|
|
if (this.modeComboBox.getSelectedIndex() == 0) { |
|
|
|
|
grouper.setDivideMode(FunctionGrouper.GROUPING_MODE); |
|
|
|
|
} else if (this.modeComboBox.getSelectedIndex() == 1) { |
|
|
|
|
grouper.setDivideMode(FunctionGrouper.LIST_MODE); |
|
|
|
|
} else if (this.modeComboBox.getSelectedIndex() == 2) { |
|
|
|
|
grouper.setDivideMode(FunctionGrouper.CONTINUUM_MODE); |
|
|
|
|
} |
|
|
|
|
grouper.setFormulaContent(this.valueField.getText()); |
|
|
|
|
// populate
|
|
|
|
|
public void populate(RecordGrouper grouper) { |
|
|
|
|
if (grouper instanceof FunctionGrouper) { |
|
|
|
|
int mode = ((FunctionGrouper)grouper).getDivideMode(); |
|
|
|
|
if (mode == FunctionGrouper.GROUPING_MODE) { |
|
|
|
|
this.modeComboBox.setSelectedIndex(0); |
|
|
|
|
} else if (mode == FunctionGrouper.LIST_MODE) { |
|
|
|
|
this.modeComboBox.setSelectedIndex(1); |
|
|
|
|
} else { |
|
|
|
|
this.modeComboBox.setSelectedIndex(2); |
|
|
|
|
} |
|
|
|
|
String formulaContent = ((FunctionGrouper)grouper).getFormulaContent(); |
|
|
|
|
if(formulaContent == null) { |
|
|
|
|
this.valueField.setText("$$$"); |
|
|
|
|
} else { |
|
|
|
|
this.valueField.setText(formulaContent); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return grouper; |
|
|
|
|
} |
|
|
|
|
public RecordGrouper update() { |
|
|
|
|
FunctionGrouper grouper = new FunctionGrouper(); |
|
|
|
|
grouper.setCustom(true); |
|
|
|
|
if (this.modeComboBox.getSelectedIndex() == 0) { |
|
|
|
|
grouper.setDivideMode(FunctionGrouper.GROUPING_MODE); |
|
|
|
|
} else if (this.modeComboBox.getSelectedIndex() == 1) { |
|
|
|
|
grouper.setDivideMode(FunctionGrouper.LIST_MODE); |
|
|
|
|
} else if (this.modeComboBox.getSelectedIndex() == 2) { |
|
|
|
|
grouper.setDivideMode(FunctionGrouper.CONTINUUM_MODE); |
|
|
|
|
} |
|
|
|
|
grouper.setFormulaContent(this.valueField.getText()); |
|
|
|
|
|
|
|
|
|
return grouper; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |