|
|
@ -18,6 +18,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIHeadGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIHeadGroup; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
|
|
|
import com.fr.design.gui.ilable.MultilineLabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
@ -54,6 +55,7 @@ import java.util.ArrayList; |
|
|
|
public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
|
|
|
|
|
|
|
|
private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL; |
|
|
|
private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL; |
|
|
|
|
|
|
|
private static final Color TIP_FONT_COLOR = new Color(0x7F333334, true); |
|
|
|
|
|
|
|
|
|
|
|
private enum FilterType { |
|
|
|
private enum FilterType { |
|
|
|
//前N个 后N个 奇数 偶数 自定义 未定义
|
|
|
|
//前N个 后N个 奇数 偶数 自定义 未定义
|
|
|
@ -71,8 +73,6 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
private JPanel cardContainer; |
|
|
|
private JPanel cardContainer; |
|
|
|
// 卡片布局TAB切换按钮
|
|
|
|
// 卡片布局TAB切换按钮
|
|
|
|
private UIHeadGroup tabsHeaderIconPane; |
|
|
|
private UIHeadGroup tabsHeaderIconPane; |
|
|
|
// 数据列基本设置
|
|
|
|
|
|
|
|
private DSColumnBasicEditorPane cellDSColumnBasicPane; |
|
|
|
|
|
|
|
// 数据列高级设置
|
|
|
|
// 数据列高级设置
|
|
|
|
private DSColumnAdvancedEditorPane cellDSColumnAdvancedPane; |
|
|
|
private DSColumnAdvancedEditorPane cellDSColumnAdvancedPane; |
|
|
|
|
|
|
|
|
|
|
@ -156,7 +156,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
private void createPanes() { |
|
|
|
private void createPanes() { |
|
|
|
paneList = new ArrayList<>(); |
|
|
|
paneList = new ArrayList<>(); |
|
|
|
/*基本设置面板*/ |
|
|
|
/*基本设置面板*/ |
|
|
|
cellDSColumnBasicPane = new DSColumnBasicEditorPane(); |
|
|
|
DSColumnBasicEditorPane cellDSColumnBasicPane = new DSColumnBasicEditorPane(); |
|
|
|
paneList.add(cellDSColumnBasicPane); |
|
|
|
paneList.add(cellDSColumnBasicPane); |
|
|
|
/*高级设置面板*/ |
|
|
|
/*高级设置面板*/ |
|
|
|
cellDSColumnAdvancedPane = new DSColumnAdvancedEditorPane(); |
|
|
|
cellDSColumnAdvancedPane = new DSColumnAdvancedEditorPane(); |
|
|
@ -225,7 +225,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{uiLabel, uiButton} |
|
|
|
new Component[]{uiLabel, uiButton} |
|
|
|
}; |
|
|
|
}; |
|
|
|
conditionPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); |
|
|
|
this.add(this.createContentPane(), BorderLayout.CENTER); |
|
|
|
this.add(this.createContentPane(), BorderLayout.CENTER); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
} |
|
|
|
} |
|
|
@ -272,7 +272,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
//条件过滤
|
|
|
|
//条件过滤
|
|
|
|
new Component[]{this.conditionPane} |
|
|
|
new Component[]{this.conditionPane} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -483,11 +483,11 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
//数据倍数
|
|
|
|
//数据倍数
|
|
|
|
UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple")); |
|
|
|
UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple")); |
|
|
|
multipleLabel.setPreferredSize(new Dimension(60, 20)); |
|
|
|
multipleLabel.setPreferredSize(new Dimension(60, 20)); |
|
|
|
multiPane = TableLayoutHelper.createTableLayoutPane(new Component[][]{ |
|
|
|
multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
|
|
|
new Component[]{ |
|
|
|
new Component[]{ |
|
|
|
multipleLabel, multiNumSpinner |
|
|
|
multipleLabel, multiNumSpinner |
|
|
|
} |
|
|
|
} |
|
|
|
}, new double[]{P}, new double[]{P, F} |
|
|
|
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP |
|
|
|
); |
|
|
|
); |
|
|
|
multiNumPane.add(multiPane); |
|
|
|
multiNumPane.add(multiPane); |
|
|
|
useMultiplyNumCheckBox.addActionListener(new ActionListener() { |
|
|
|
useMultiplyNumCheckBox.addActionListener(new ActionListener() { |
|
|
@ -516,7 +516,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
{extendableDirectionPane}, |
|
|
|
{extendableDirectionPane}, |
|
|
|
{multiNumPane} |
|
|
|
{multiNumPane} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -582,7 +582,9 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
double[] rowSize = {P, P}, columnSize = {P, F}; |
|
|
|
double[] rowSize = {P, P}, columnSize = {P, F}; |
|
|
|
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); |
|
|
|
this.add(TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
|
|
|
components, rowSize, columnSize, HGAP, VGAP |
|
|
|
|
|
|
|
), BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -604,7 +606,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
if (noContent) { |
|
|
|
if (noContent) { |
|
|
|
centerPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
centerPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
centerPane.setPreferredSize(new Dimension(155, 20)); |
|
|
|
centerPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
} |
|
|
|
} |
|
|
|
String sortFormula = dSColumn.getSortFormula(); |
|
|
|
String sortFormula = dSColumn.getSortFormula(); |
|
|
|
if (sortFormula != null && sortFormula.length() >= 1) { |
|
|
|
if (sortFormula != null && sortFormula.length() >= 1) { |
|
|
@ -678,14 +680,14 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.TOP.name()); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.TOP.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name()); |
|
|
|
//隐藏tip 显示set
|
|
|
|
//隐藏tip 显示set
|
|
|
|
setCardPane.setPreferredSize(new Dimension(155, 20)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
} else if (selectIndex == 2) { |
|
|
|
} else if (selectIndex == 2) { |
|
|
|
//后N个
|
|
|
|
//后N个
|
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name()); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name()); |
|
|
|
//隐藏tip 显示set
|
|
|
|
//隐藏tip 显示set
|
|
|
|
setCardPane.setPreferredSize(new Dimension(155, 20)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
} else if (selectIndex == 3) { |
|
|
|
} else if (selectIndex == 3) { |
|
|
|
//奇数
|
|
|
|
//奇数
|
|
|
@ -693,19 +695,19 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name()); |
|
|
|
//隐藏set 显示tip
|
|
|
|
//隐藏set 显示tip
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(221, 15)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
} else if (selectIndex == 4) { |
|
|
|
} else if (selectIndex == 4) { |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.EVEN.name()); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.EVEN.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name()); |
|
|
|
//隐藏set 显示tip
|
|
|
|
//隐藏set 显示tip
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(221, 15)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
} else if (selectIndex == 5) { |
|
|
|
} else if (selectIndex == 5) { |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name()); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name()); |
|
|
|
//显示set和tip
|
|
|
|
//显示set和tip
|
|
|
|
setCardPane.setPreferredSize(new Dimension(155, 20)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(221, 15)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name()); |
|
|
|
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name()); |
|
|
|
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name()); |
|
|
@ -713,7 +715,10 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
setCardPane.revalidate(); |
|
|
|
|
|
|
|
tipCardPane.revalidate(); |
|
|
|
|
|
|
|
setCardPane.repaint(); |
|
|
|
|
|
|
|
tipCardPane.repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
//配置展示CardLayout
|
|
|
|
//配置展示CardLayout
|
|
|
@ -737,28 +742,29 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
|
|
|
|
|
|
|
|
//奇数 UILabel 占一行作为提示信息
|
|
|
|
//奇数 UILabel 占一行作为提示信息
|
|
|
|
setCardPane.add(new JPanel(), FilterType.ODD.name()); |
|
|
|
setCardPane.add(new JPanel(), FilterType.ODD.name()); |
|
|
|
tipCardPane.add(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1") |
|
|
|
MultilineLabel oddTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Odd_Tip")); |
|
|
|
+ "," + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), FilterType.ODD.name()); |
|
|
|
oddTip.setForeground(TIP_FONT_COLOR); |
|
|
|
|
|
|
|
tipCardPane.add(oddTip, FilterType.ODD.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//偶数 UILabel 占一行作为提示信息
|
|
|
|
//偶数 UILabel 占一行作为提示信息
|
|
|
|
setCardPane.add(new JPanel(), FilterType.EVEN.name()); |
|
|
|
setCardPane.add(new JPanel(), FilterType.EVEN.name()); |
|
|
|
tipCardPane.add(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1") |
|
|
|
MultilineLabel evenTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Even_Tip")); |
|
|
|
+ "," + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FilterType.EVEN.name()); |
|
|
|
evenTip.setForeground(TIP_FONT_COLOR); |
|
|
|
|
|
|
|
tipCardPane.add(evenTip, FilterType.EVEN.name()); |
|
|
|
|
|
|
|
|
|
|
|
//输入框占用右半边,提示信息占一行
|
|
|
|
//输入框占用右半边,提示信息占一行
|
|
|
|
serialTextField = new UITextField(16); |
|
|
|
serialTextField = new UITextField(16); |
|
|
|
setCardPane.add(serialTextField, FilterType.SPECIFY.name()); |
|
|
|
setCardPane.add(serialTextField, FilterType.SPECIFY.name()); |
|
|
|
tipCardPane.add(new UILabel( |
|
|
|
MultilineLabel specifyTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Specify_Tip")); |
|
|
|
Inter.getLocText(new String[]{ |
|
|
|
specifyTip.setForeground(TIP_FONT_COLOR); |
|
|
|
"Format", "BindColumn-Result_Serial_Number_Start_From_1", "Inner_Parameter", "Group_Count"}, |
|
|
|
tipCardPane.add(specifyTip, FilterType.SPECIFY.name()); |
|
|
|
new String[]{": 1,2-3,5,8 ", ",", "$__count__"})), FilterType.SPECIFY.name()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{ |
|
|
|
this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
|
|
|
{filterLabel, rsComboBox}, |
|
|
|
{filterLabel, rsComboBox}, |
|
|
|
{null, setCardPane}, |
|
|
|
{null, setCardPane}, |
|
|
|
{tipCardPane, null} |
|
|
|
{tipCardPane, null} |
|
|
|
}, new double[]{P, P, P}, new double[]{P, F}), BorderLayout.CENTER); |
|
|
|
}, new double[]{P, P, P}, new double[]{P, F}, HGAP, VGAP), BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(CellElement cellElement) { |
|
|
|
public void populate(CellElement cellElement) { |
|
|
@ -776,30 +782,30 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
case SelectCount.TOP: |
|
|
|
case SelectCount.TOP: |
|
|
|
this.topFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
this.topFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
//隐藏tip 显示set
|
|
|
|
//隐藏tip 显示set
|
|
|
|
setCardPane.setPreferredSize(new Dimension(155, 20)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SelectCount.BOTTOM: |
|
|
|
case SelectCount.BOTTOM: |
|
|
|
this.bottomFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
this.bottomFormulaPane.populate(selectCount.getFormulaCount()); |
|
|
|
//隐藏tip 显示set
|
|
|
|
//隐藏tip 显示set
|
|
|
|
setCardPane.setPreferredSize(new Dimension(155, 20)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SelectCount.SPECIFY: |
|
|
|
case SelectCount.SPECIFY: |
|
|
|
this.serialTextField.setText(selectCount.getSerial()); |
|
|
|
this.serialTextField.setText(selectCount.getSerial()); |
|
|
|
//显示set和tip
|
|
|
|
//显示set和tip
|
|
|
|
setCardPane.setPreferredSize(new Dimension(155, 20)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(156, 20)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(221, 15)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SelectCount.EVEN: |
|
|
|
case SelectCount.EVEN: |
|
|
|
//隐藏set 显示tip
|
|
|
|
//隐藏set 显示tip
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(221, 15)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SelectCount.ODD: |
|
|
|
case SelectCount.ODD: |
|
|
|
//隐藏set 显示tip
|
|
|
|
//隐藏set 显示tip
|
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
setCardPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(221, 15)); |
|
|
|
tipCardPane.setPreferredSize(new Dimension(224, 40)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
//隐藏set和tip
|
|
|
|
//隐藏set和tip
|
|
|
@ -949,9 +955,9 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value")); |
|
|
|
UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value")); |
|
|
|
customValueLabel.setPreferredSize(new Dimension(60, 20)); |
|
|
|
customValueLabel.setPreferredSize(new Dimension(60, 20)); |
|
|
|
formulaField = new JFormulaField("$$$"); |
|
|
|
formulaField = new JFormulaField("$$$"); |
|
|
|
this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{ |
|
|
|
this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
|
|
|
new Component[]{customValueLabel, formulaField}, |
|
|
|
new Component[]{customValueLabel, formulaField}, |
|
|
|
}, new double[]{P}, new double[]{P, F}), BorderLayout.CENTER); |
|
|
|
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP), BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(CellElement cellElement) { |
|
|
|
public void populate(CellElement cellElement) { |
|
|
|