Browse Source

REPORT-3348 card layout隐藏时不再显示空白面板

master
yaoh.wu 7 years ago
parent
commit
deaed5b5ec
  1. 3
      designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  2. 56
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

3
designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -69,10 +69,13 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
int i = goBox.getSelectedIndex(); int i = goBox.getSelectedIndex();
if (i == BIND_GROUP) { if (i == BIND_GROUP) {
cardLayout.show(cardPane, "groupPane"); cardLayout.show(cardPane, "groupPane");
cardPane.setPreferredSize(new Dimension(155, 20));
} else if (i == BIND_SELECTED) { } else if (i == BIND_SELECTED) {
cardLayout.show(cardPane, "listPane"); cardLayout.show(cardPane, "listPane");
cardPane.setPreferredSize(new Dimension(0, 0));
} else if (i == BIND_SUMMARY) { } else if (i == BIND_SUMMARY) {
cardLayout.show(cardPane, "summaryPane"); cardLayout.show(cardPane, "summaryPane");
cardPane.setPreferredSize(new Dimension(155, 20));
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
cellExpandAttr.setDirection(Constants.NONE); cellExpandAttr.setDirection(Constants.NONE);
} }

56
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -597,7 +597,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(165, 20)); centerPane.setPreferredSize(new Dimension(155, 20));
} }
String sortFormula = dSColumn.getSortFormula(); String sortFormula = dSColumn.getSortFormula();
if (sortFormula != null && sortFormula.length() >= 1) { if (sortFormula != null && sortFormula.length() >= 1) {
@ -667,28 +667,44 @@ public class CellDSColumnEditor extends CellQuickEditor {
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout(); CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout(); CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectIndex == 1) { if (selectIndex == 1) {
//前N个
setCardPaneLayout.show(setCardPane, FilterType.TOP.name()); setCardPaneLayout.show(setCardPane, FilterType.TOP.name());
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name()); tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name());
//todo 隐藏tip //隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(155, 20));
tipCardPane.setPreferredSize(new Dimension(0, 0));
} else if (selectIndex == 2) { } else if (selectIndex == 2) {
//后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());
//todo 隐藏tip //隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(155, 20));
tipCardPane.setPreferredSize(new Dimension(0, 0));
} else if (selectIndex == 3) { } else if (selectIndex == 3) {
//奇数
setCardPaneLayout.show(setCardPane, FilterType.ODD.name()); setCardPaneLayout.show(setCardPane, FilterType.ODD.name());
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name()); tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name());
//todo 隐藏set //隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(221, 15));
} 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());
//todo 隐藏set //隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(221, 15));
} 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
setCardPane.setPreferredSize(new Dimension(155, 20));
tipCardPane.setPreferredSize(new Dimension(221, 15));
} 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());
//todo 隐藏set和tip //隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(0, 0));
} }
} }
@ -715,13 +731,13 @@ 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") tipCardPane.add(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
+ "," + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), "ODD"); + "," + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), 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") tipCardPane.add(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
+ "," + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), "ODD"); + "," + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FilterType.EVEN.name());
//输入框占用右半边,提示信息占一行 //输入框占用右半边,提示信息占一行
serialTextField = new UITextField(16); serialTextField = new UITextField(16);
@ -729,7 +745,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
tipCardPane.add(new UILabel( 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__"})), "SPECIFY"); new String[]{": 1,2-3,5,8 ", ",", "$__count__"})), FilterType.SPECIFY.name());
this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{ this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
{filterLabel, rsComboBox}, {filterLabel, rsComboBox},
@ -752,19 +768,41 @@ public class CellDSColumnEditor extends CellQuickEditor {
switch (selectCountType) { switch (selectCountType) {
case SelectCount.TOP: case SelectCount.TOP:
this.topFormulaPane.populate(selectCount.getFormulaCount()); this.topFormulaPane.populate(selectCount.getFormulaCount());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(155, 20));
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
setCardPane.setPreferredSize(new Dimension(155, 20));
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
setCardPane.setPreferredSize(new Dimension(155, 20));
tipCardPane.setPreferredSize(new Dimension(221, 15));
break; break;
case SelectCount.EVEN: case SelectCount.EVEN:
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(221, 15));
break; break;
case SelectCount.ODD: case SelectCount.ODD:
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(221, 15));
break; break;
default: default:
//隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(0, 0));
} }
} else {
//隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(0, 0));
} }
} }
} }

Loading…
Cancel
Save