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