|
|
@ -19,7 +19,6 @@ import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.mainframe.cell.CellEditorPane; |
|
|
|
import com.fr.design.mainframe.cell.CellEditorPane; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.report.cell.CellElement; |
|
|
|
import com.fr.report.cell.CellElement; |
|
|
@ -52,9 +51,9 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
//排列顺序
|
|
|
|
//排列顺序
|
|
|
|
private ResultSetSortConfigPane sortPane; |
|
|
|
private ResultSetSortConfigPane sortPane; |
|
|
|
//结果集筛选
|
|
|
|
//结果集筛选
|
|
|
|
private SelectCountPane selectCountPane; |
|
|
|
private ResultSetFilterConfigPane filterPane; |
|
|
|
//自定义值显示
|
|
|
|
//自定义值显示
|
|
|
|
private ValuePane valuePane; |
|
|
|
private CustomValuePane valuePane; |
|
|
|
//横向可扩展性
|
|
|
|
//横向可扩展性
|
|
|
|
private UICheckBox horizontalExtendableCheckBox; |
|
|
|
private UICheckBox horizontalExtendableCheckBox; |
|
|
|
//纵向可扩展性
|
|
|
|
//纵向可扩展性
|
|
|
@ -68,6 +67,7 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
public DSColumnAdvancedEditorPane() { |
|
|
|
public DSColumnAdvancedEditorPane() { |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(this.createContentPane(), BorderLayout.CENTER); |
|
|
|
this.add(this.createContentPane(), BorderLayout.CENTER); |
|
|
|
|
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -99,22 +99,22 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
private JPanel createContentPane() { |
|
|
|
private JPanel createContentPane() { |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
//结果集排序
|
|
|
|
|
|
|
|
|
|
|
|
this.sortPane = new ResultSetSortConfigPane(); |
|
|
|
this.sortPane = new ResultSetSortConfigPane(); |
|
|
|
|
|
|
|
//结果筛选
|
|
|
|
|
|
|
|
|
|
|
|
selectCountPane = new DSColumnAdvancedEditorPane.SelectCountPane(); |
|
|
|
filterPane = new ResultSetFilterConfigPane(); |
|
|
|
|
|
|
|
//自定义值显示
|
|
|
|
valuePane = new DSColumnAdvancedEditorPane.ValuePane(); |
|
|
|
valuePane = new CustomValuePane(); |
|
|
|
|
|
|
|
//可扩展性
|
|
|
|
JPanel extendableDirectionPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
JPanel extendableDirectionPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
extendableDirectionPane.add(horizontalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Horizontal_Extendable"))); |
|
|
|
extendableDirectionPane.add(horizontalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Horizontal_Extendable"))); |
|
|
|
extendableDirectionPane.add(verticalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Vertical_Extendable"))); |
|
|
|
extendableDirectionPane.add(verticalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Vertical_Extendable"))); |
|
|
|
|
|
|
|
|
|
|
|
JPanel extendablePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("ExpandD-Expandable")); |
|
|
|
|
|
|
|
extendablePane.setLayout(new BorderLayout()); |
|
|
|
|
|
|
|
extendablePane.add(extendableDirectionPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel multiNumPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Fill_blank_Data")); |
|
|
|
//补充空白数据
|
|
|
|
|
|
|
|
JPanel multiNumPane = new JPanel(); |
|
|
|
|
|
|
|
|
|
|
|
useMultiplyNumCheckBox = new UICheckBox(Inter.getLocText("Column_Multiple")); |
|
|
|
useMultiplyNumCheckBox = new UICheckBox(Inter.getLocText("Column_Multiple")); |
|
|
|
multiNumPane.add(useMultiplyNumCheckBox); |
|
|
|
multiNumPane.add(useMultiplyNumCheckBox); |
|
|
@ -124,22 +124,20 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
multiNumPane.add(multiNumSpinner); |
|
|
|
multiNumPane.add(multiNumSpinner); |
|
|
|
|
|
|
|
|
|
|
|
useMultiplyNumCheckBox.addActionListener(new ActionListener() { |
|
|
|
useMultiplyNumCheckBox.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
checkButtonEnabled(); |
|
|
|
checkButtonEnabled(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, |
|
|
|
double p = TableLayout.PREFERRED, f = TableLayout.FILL; |
|
|
|
TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; |
|
|
|
double[] rowSize = {p, p, p, p, p, p}; |
|
|
|
double[] columnSize = {TableLayout.FILL}; |
|
|
|
double[] columnSize = {f}; |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = null; |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
components = new Component[][]{ |
|
|
|
|
|
|
|
{sortPane}, |
|
|
|
{sortPane}, |
|
|
|
{selectCountPane}, |
|
|
|
{filterPane}, |
|
|
|
{valuePane}, |
|
|
|
{valuePane}, |
|
|
|
{extendablePane}, |
|
|
|
{extendableDirectionPane}, |
|
|
|
{multiNumPane} |
|
|
|
{multiNumPane} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
@ -167,7 +165,7 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ResultSetSortConfigPane() { |
|
|
|
public ResultSetSortConfigPane() { |
|
|
|
this.setLayout(new BorderLayout(0, 4)); |
|
|
|
this.setLayout(new BorderLayout(0, 0)); |
|
|
|
Icon[] iconArray = { |
|
|
|
Icon[] iconArray = { |
|
|
|
IOUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), |
|
|
|
IOUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), |
|
|
|
IOUtils.readIcon("/com/fr/design/images/expand/asc.png"), |
|
|
|
IOUtils.readIcon("/com/fr/design/images/expand/asc.png"), |
|
|
@ -177,24 +175,34 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
sort_type_pane = new UIButtonGroup(iconArray); |
|
|
|
sort_type_pane = new UIButtonGroup(iconArray); |
|
|
|
sort_type_pane.setAllToolTips(nameArray); |
|
|
|
sort_type_pane.setAllToolTips(nameArray); |
|
|
|
sort_type_pane.setGlobalName(Inter.getLocText("ExpandD-Sort_After_Expand")); |
|
|
|
sort_type_pane.setGlobalName(Inter.getLocText("ExpandD-Sort_After_Expand")); |
|
|
|
this.add(sort_type_pane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cardLayout = new CardLayout(); |
|
|
|
cardLayout = new CardLayout(); |
|
|
|
centerPane = new JPanel(cardLayout); |
|
|
|
centerPane = new JPanel(cardLayout); |
|
|
|
|
|
|
|
|
|
|
|
tinyFormulaPane = new TinyFormulaPane(); |
|
|
|
tinyFormulaPane = new TinyFormulaPane(); |
|
|
|
|
|
|
|
|
|
|
|
centerPane.add(new JPanel(), "none"); |
|
|
|
centerPane.add(new JPanel(), "none"); |
|
|
|
centerPane.add(tinyFormulaPane, "content"); |
|
|
|
centerPane.add(tinyFormulaPane, "content"); |
|
|
|
|
|
|
|
//todo 国际化
|
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
UILabel sortLabel = new UILabel("排列顺序"); |
|
|
|
|
|
|
|
|
|
|
|
sort_type_pane.addChangeListener(new ChangeListener() { |
|
|
|
sort_type_pane.addChangeListener(new ChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
cardLayout.show(centerPane, sort_type_pane.getSelectedIndex() == 0 ? "none" : "content"); |
|
|
|
boolean noContent = sort_type_pane.getSelectedIndex() == 0; |
|
|
|
|
|
|
|
cardLayout.show(centerPane, noContent ? "none" : "content"); |
|
|
|
|
|
|
|
if (noContent) { |
|
|
|
|
|
|
|
centerPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
centerPane.setPreferredSize(new Dimension(165, 20)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{sortLabel, sort_type_pane}, |
|
|
|
|
|
|
|
new Component[]{null, centerPane} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED, f = TableLayout.FILL; |
|
|
|
|
|
|
|
double[] rowSize = {p, p}, columnSize = {p, f}; |
|
|
|
|
|
|
|
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -224,80 +232,106 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
* |
|
|
|
* |
|
|
|
* @see DSColumnAdvancedPane.SelectCountPane |
|
|
|
* @see DSColumnAdvancedPane.SelectCountPane |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected static class SelectCountPane extends JPanel { |
|
|
|
protected static class ResultSetFilterConfigPane extends JPanel { |
|
|
|
|
|
|
|
private enum FilterType { |
|
|
|
|
|
|
|
//前N个 后N个 奇数 偶数 自定义 未定义
|
|
|
|
|
|
|
|
TOP, BOTTOM, ODD, EVEN, SPECIFY, UNDEFINE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CellElement cellElement; |
|
|
|
CellElement cellElement; |
|
|
|
// private Comparator sortComparator;
|
|
|
|
private UIComboBox rsComboBox; |
|
|
|
private UIComboBox selectCountComboBox; |
|
|
|
private JPanel setCardPane; |
|
|
|
private JPanel selectCountCardPane; |
|
|
|
private JPanel tipCardPane; |
|
|
|
private UITextField serialTextField; |
|
|
|
private UITextField serialTextField; |
|
|
|
|
|
|
|
|
|
|
|
DSColumnAdvancedEditorPane.JFormulaField topFormulaPane; |
|
|
|
DSColumnAdvancedEditorPane.JFormulaField topFormulaPane; |
|
|
|
DSColumnAdvancedEditorPane.JFormulaField bottomFormulaPane; |
|
|
|
DSColumnAdvancedEditorPane.JFormulaField bottomFormulaPane; |
|
|
|
|
|
|
|
|
|
|
|
public SelectCountPane() { |
|
|
|
public ResultSetFilterConfigPane() { |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED, f = TableLayout.FILL; |
|
|
|
|
|
|
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
UILabel filterLabel = new UILabel("结果集筛选"); |
|
|
|
|
|
|
|
|
|
|
|
selectCountComboBox = new UIComboBox(new String[]{ |
|
|
|
//结果集筛选下拉框
|
|
|
|
|
|
|
|
rsComboBox = new UIComboBox(new String[]{ |
|
|
|
Inter.getLocText("Undefined"), |
|
|
|
Inter.getLocText("Undefined"), |
|
|
|
Inter.getLocText("BindColumn-Top_N"), |
|
|
|
Inter.getLocText("BindColumn-Top_N"), |
|
|
|
Inter.getLocText("BindColumn-Bottom_N"), |
|
|
|
Inter.getLocText("BindColumn-Bottom_N"), |
|
|
|
Inter.getLocText("Odd"), |
|
|
|
Inter.getLocText("Odd"), |
|
|
|
Inter.getLocText("Even"), |
|
|
|
Inter.getLocText("Even"), |
|
|
|
Inter.getLocText("Specify"),}); |
|
|
|
Inter.getLocText("Specify") |
|
|
|
selectCountComboBox.addActionListener(new ActionListener() { |
|
|
|
}); |
|
|
|
|
|
|
|
rsComboBox.addActionListener(new ActionListener() { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
int selectIndex = selectCountComboBox.getSelectedIndex(); |
|
|
|
int selectIndex = rsComboBox.getSelectedIndex(); |
|
|
|
CardLayout c1 = (CardLayout) selectCountCardPane.getLayout(); |
|
|
|
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout(); |
|
|
|
|
|
|
|
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout(); |
|
|
|
if (selectIndex == 1) { |
|
|
|
if (selectIndex == 1) { |
|
|
|
c1.show(selectCountCardPane, "TOP"); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.TOP.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name()); |
|
|
|
} else if (selectIndex == 2) { |
|
|
|
} else if (selectIndex == 2) { |
|
|
|
c1.show(selectCountCardPane, "BOTTOM"); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name()); |
|
|
|
} else if (selectIndex == 3) { |
|
|
|
} else if (selectIndex == 3) { |
|
|
|
c1.show(selectCountCardPane, "ODD"); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.ODD.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name()); |
|
|
|
} else if (selectIndex == 4) { |
|
|
|
} else if (selectIndex == 4) { |
|
|
|
c1.show(selectCountCardPane, "EVEN"); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.EVEN.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name()); |
|
|
|
} else if (selectIndex == 5) { |
|
|
|
} else if (selectIndex == 5) { |
|
|
|
c1.show(selectCountCardPane, "SPECIFY"); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
c1.show(selectCountCardPane, "UNDEFINE"); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name()); |
|
|
|
|
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
//配置展示CardLayout
|
|
|
|
selectCountCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
setCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
this.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(INSET_TEXT), selectCountComboBox, |
|
|
|
//提示信息展示CardLayout
|
|
|
|
new UILabel(INSET_TEXT), selectCountCardPane}, FlowLayout.LEFT), BorderLayout.WEST); |
|
|
|
tipCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
// selectCountCardPane.setLayout(new CardLayout());
|
|
|
|
|
|
|
|
|
|
|
|
//前N个
|
|
|
|
//not define pane
|
|
|
|
topFormulaPane = new DSColumnAdvancedEditorPane.JFormulaField("="); |
|
|
|
|
|
|
|
setCardPane.add(topFormulaPane, FilterType.TOP.name()); |
|
|
|
JPanel undefinedPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("Undefined")), FlowLayout.LEFT); |
|
|
|
tipCardPane.add(new JPanel(), FilterType.TOP.name()); |
|
|
|
topFormulaPane = new DSColumnAdvancedEditorPane.JFormulaField("-1"); |
|
|
|
|
|
|
|
bottomFormulaPane = new DSColumnAdvancedEditorPane.JFormulaField("-1"); |
|
|
|
//后N个
|
|
|
|
serialTextField = new UITextField(18); |
|
|
|
bottomFormulaPane = new DSColumnAdvancedEditorPane.JFormulaField("="); |
|
|
|
JPanel oddPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1") |
|
|
|
setCardPane.add(bottomFormulaPane, FilterType.BOTTOM.name()); |
|
|
|
+ " " + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), FlowLayout.LEFT); |
|
|
|
tipCardPane.add(new JPanel(), FilterType.BOTTOM.name()); |
|
|
|
JPanel evenPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1") |
|
|
|
|
|
|
|
+ " " + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FlowLayout.LEFT); |
|
|
|
//自定义值下方没有提示信息,也没有输入框
|
|
|
|
JPanel specifyPane = GUICoreUtils.createFlowPane(new JComponent[]{ |
|
|
|
JPanel undefinedPane = new JPanel(); |
|
|
|
serialTextField, new UILabel( |
|
|
|
setCardPane.add(new JPanel(), FilterType.UNDEFINE.name()); |
|
|
|
|
|
|
|
tipCardPane.add(new JPanel(), FilterType.UNDEFINE.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//奇数 UILabel 占一行作为提示信息
|
|
|
|
|
|
|
|
setCardPane.add(new JPanel(), FilterType.ODD.name()); |
|
|
|
|
|
|
|
tipCardPane.add(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1") |
|
|
|
|
|
|
|
+ "," + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), FilterType.ODD.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//偶数 UILabel 占一行作为提示信息
|
|
|
|
|
|
|
|
setCardPane.add(new JPanel(), FilterType.EVEN.name()); |
|
|
|
|
|
|
|
tipCardPane.add(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1") |
|
|
|
|
|
|
|
+ "," + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FilterType.ODD.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//输入框占用右半边,提示信息占一行
|
|
|
|
|
|
|
|
serialTextField = new UITextField(16); |
|
|
|
|
|
|
|
setCardPane.add(serialTextField, FilterType.SPECIFY.name()); |
|
|
|
|
|
|
|
tipCardPane.add(new UILabel( |
|
|
|
Inter.getLocText(new String[]{ |
|
|
|
Inter.getLocText(new String[]{ |
|
|
|
"Format", "BindColumn-Result_Serial_Number_Start_From_1", "Inner_Parameter", "Group_Count"}, |
|
|
|
"Format", "BindColumn-Result_Serial_Number_Start_From_1", "Inner_Parameter", "Group_Count"}, |
|
|
|
new String[]{": 1,2-3,5,8 ", ",", "$__count__"}) |
|
|
|
new String[]{": 1,2-3,5,8 ", ",", "$__count__"})), FilterType.SPECIFY.name()); |
|
|
|
) |
|
|
|
|
|
|
|
}, FlowLayout.LEFT); |
|
|
|
this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{ |
|
|
|
serialTextField.setToolTipText(Inter.getLocText("StyleFormat-Sample") + ":=JOINARRAY(GREPARRAY(RANGE($__count__), item!=4), \",\")"); |
|
|
|
{filterLabel, rsComboBox}, |
|
|
|
selectCountCardPane.add(undefinedPane, "UNDEFINE"); |
|
|
|
{null, setCardPane}, |
|
|
|
selectCountCardPane.add(topFormulaPane, "TOP"); |
|
|
|
{tipCardPane, null} |
|
|
|
selectCountCardPane.add(bottomFormulaPane, "BOTTOM"); |
|
|
|
}, new double[]{p, p, p}, new double[]{p, f}), BorderLayout.CENTER); |
|
|
|
//odd
|
|
|
|
|
|
|
|
selectCountCardPane.add(oddPane, "ODD"); |
|
|
|
|
|
|
|
//even
|
|
|
|
|
|
|
|
selectCountCardPane.add(evenPane, "EVEN"); |
|
|
|
|
|
|
|
//specify
|
|
|
|
|
|
|
|
selectCountCardPane.add(specifyPane, "SPECIFY"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(CellElement cellElement) { |
|
|
|
public void populate(CellElement cellElement) { |
|
|
@ -316,7 +350,7 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
this.bottomFormulaPane.populateElement(cellElement); |
|
|
|
this.bottomFormulaPane.populateElement(cellElement); |
|
|
|
if (selectCount != null) { |
|
|
|
if (selectCount != null) { |
|
|
|
int selectCountType = selectCount.getType(); |
|
|
|
int selectCountType = selectCount.getType(); |
|
|
|
this.selectCountComboBox.setSelectedIndex(selectCountType); |
|
|
|
this.rsComboBox.setSelectedIndex(selectCountType); |
|
|
|
if (selectCountType == SelectCount.TOP) { |
|
|
|
if (selectCountType == SelectCount.TOP) { |
|
|
|
this.topFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
this.topFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
} else if (selectCountType == SelectCount.BOTTOM) { |
|
|
|
} else if (selectCountType == SelectCount.BOTTOM) { |
|
|
@ -338,7 +372,7 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); |
|
|
|
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); |
|
|
|
|
|
|
|
|
|
|
|
//alex:SelectCount
|
|
|
|
//alex:SelectCount
|
|
|
|
int selectCountSelectIndex = this.selectCountComboBox.getSelectedIndex(); |
|
|
|
int selectCountSelectIndex = this.rsComboBox.getSelectedIndex(); |
|
|
|
if (selectCountSelectIndex == 0) { |
|
|
|
if (selectCountSelectIndex == 0) { |
|
|
|
dSColumn.setSelectCount(null); |
|
|
|
dSColumn.setSelectCount(null); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -381,19 +415,16 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
public JFormulaField(String defaultValue) { |
|
|
|
public JFormulaField(String defaultValue) { |
|
|
|
this.defaultValue = defaultValue; |
|
|
|
this.defaultValue = defaultValue; |
|
|
|
|
|
|
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); |
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
|
|
|
UILabel bottomLabel = new UILabel("="); |
|
|
|
formulaTextField = new UITextField(11); |
|
|
|
bottomLabel.setFont(new Font("Dialog", Font.BOLD, 12)); |
|
|
|
|
|
|
|
this.add(bottomLabel); |
|
|
|
|
|
|
|
formulaTextField = new UITextField(24); |
|
|
|
|
|
|
|
this.add(formulaTextField); |
|
|
|
this.add(formulaTextField); |
|
|
|
formulaTextField.setText(defaultValue); |
|
|
|
formulaTextField.setText(defaultValue); |
|
|
|
|
|
|
|
|
|
|
|
UIButton bottomFrmulaButton = new UIButton("..."); |
|
|
|
UIButton formulaButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); |
|
|
|
this.add(bottomFrmulaButton); |
|
|
|
this.add(formulaButton); |
|
|
|
bottomFrmulaButton.setToolTipText(Inter.getLocText("Formula") + "..."); |
|
|
|
formulaButton.setToolTipText(Inter.getLocText("Formula") + "..."); |
|
|
|
bottomFrmulaButton.setPreferredSize(new Dimension(25, formulaTextField.getPreferredSize().height)); |
|
|
|
formulaButton.setPreferredSize(new Dimension(20, formulaTextField.getPreferredSize().height)); |
|
|
|
bottomFrmulaButton.addActionListener(formulaButtonActionListener); |
|
|
|
formulaButton.addActionListener(formulaButtonActionListener); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(String formulaContent) { |
|
|
|
public void populate(String formulaContent) { |
|
|
@ -453,13 +484,12 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
* |
|
|
|
* |
|
|
|
* @see DSColumnAdvancedPane.ValuePane |
|
|
|
* @see DSColumnAdvancedPane.ValuePane |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static class ValuePane extends JPanel { |
|
|
|
private static class CustomValuePane extends JPanel { |
|
|
|
private DSColumnAdvancedEditorPane.JFormulaField formulaField; |
|
|
|
private DSColumnAdvancedEditorPane.JFormulaField formulaField; |
|
|
|
|
|
|
|
|
|
|
|
public ValuePane() { |
|
|
|
public CustomValuePane() { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); |
|
|
|
|
|
|
|
UILabel customValueLabel = new UILabel("显示值"); |
|
|
|
this.add(new UILabel(INSET_TEXT + Inter.getLocText("Value") + ":")); |
|
|
|
|
|
|
|
this.add(Box.createHorizontalStrut(2)); |
|
|
|
this.add(Box.createHorizontalStrut(2)); |
|
|
|
this.add((formulaField = new DSColumnAdvancedEditorPane.JFormulaField("$$$"))); |
|
|
|
this.add((formulaField = new DSColumnAdvancedEditorPane.JFormulaField("$$$"))); |
|
|
|
} |
|
|
|
} |
|
|
@ -493,7 +523,6 @@ public class DSColumnAdvancedEditorPane extends CellEditorPane { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); |
|
|
|
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); |
|
|
|
|
|
|
|
|
|
|
|
//formula
|
|
|
|
//formula
|
|
|
|
dSColumn.setResult(this.formulaField.getFormulaText()); |
|
|
|
dSColumn.setResult(this.formulaField.getFormulaText()); |
|
|
|
} |
|
|
|
} |
|
|
|