|
|
@ -87,8 +87,8 @@ public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
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.i18nText("Fine-Design_Report_Condition_Group"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Formula_Group") |
|
|
|
com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Condition", "Group"}), com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"Formula", "Group"}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
specifiedComboBox.addItemListener(new ItemListener() { |
|
|
|
specifiedComboBox.addItemListener(new ItemListener() { |
|
|
@ -167,14 +167,14 @@ public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
// 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(); |
|
|
@ -200,16 +200,16 @@ public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
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); |
|
|
@ -249,8 +249,8 @@ public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
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()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -267,7 +267,6 @@ public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
private ConditionGroup editing; |
|
|
|
private ConditionGroup editing; |
|
|
|
|
|
|
|
|
|
|
|
private DSColumnLiteConditionPane liteConditionPane; |
|
|
|
private DSColumnLiteConditionPane liteConditionPane; |
|
|
|
|
|
|
|
|
|
|
|
public ConditionGroupDetailsPane(String[] displayNames) { |
|
|
|
public ConditionGroupDetailsPane(String[] displayNames) { |
|
|
|
//alex:右侧的组内的条件细节
|
|
|
|
//alex:右侧的组内的条件细节
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
@ -311,7 +310,7 @@ public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
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("Fine-Design_Report_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); |
|
|
@ -344,8 +343,8 @@ 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(); |
|
|
@ -359,15 +358,15 @@ public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
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.i18nText("Fine-Design_Report_Custom_Value") + ": "), label, valueField, formulaButton}, FlowLayout.LEFT); |
|
|
|
new UILabel(com.fr.design.i18n.Toolkit.i18nTextArray(new String[]{"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) { |
|
|
@ -375,8 +374,8 @@ public class SpecifiedGroupAttrPane extends BasicPane { |
|
|
|
} 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); |
|
|
|