Browse Source

REPORT-3348 数据列集选择组件布局修改,一些代码结构

master
yaoh.wu 7 years ago
parent
commit
1bd82501ff
  1. 8
      designer/src/com/fr/design/dscolumn/DSColumnBasicEditorPane.java
  2. 6
      designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
  3. 15
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

8
designer/src/com/fr/design/dscolumn/DSColumnBasicEditorPane.java

@ -69,15 +69,15 @@ public class DSColumnBasicEditorPane extends CellEditorPane {
private JPanel createContentPane() { private JPanel createContentPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {f};
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
//数据集列选择 //数据集列选择
new Component[]{this.dataPane, null}, new Component[]{this.dataPane},
//数据分组设置 //数据分组设置
new Component[]{this.groupPane, null}, new Component[]{this.groupPane},
//条件过滤 //条件过滤
new Component[]{this.conditionPane, null} new Component[]{this.conditionPane}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }

6
designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -81,11 +81,11 @@ public class SelectedDataColumnPane extends BasicPane {
columnNameComboBox.setEditable(true); columnNameComboBox.setEditable(true);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel label1 = new UILabel(Inter.getLocText("TableData") + ":"); UILabel label1 = new UILabel(Inter.getLocText("TableData"));
UILabel label3 = new UILabel(Inter.getLocText("DataColumn") + ":"); UILabel label3 = new UILabel(Inter.getLocText("DataColumn"));
if (showParameterButton) { if (showParameterButton) {
//todo 国际化 //todo 国际化
UILabel label2 = new UILabel("param" + ":"); UILabel label2 = new UILabel("param");
Component[][] components = { Component[][] components = {
{label1, tableNameComboBox}, {label1, tableNameComboBox},
{label2, paramButton}, {label2, paramButton},

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

@ -8,6 +8,8 @@ import com.fr.design.dscolumn.SelectedDataColumnPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
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.design.utils.gui.GUICoreUtils;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
@ -152,6 +154,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
String[] iconArray = new String[paneList.size()]; String[] iconArray = new String[paneList.size()];
card = new CardLayout(); card = new CardLayout();
center = new JPanel(card); center = new JPanel(card);
center.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
for (int i = 0; i < paneList.size(); i++) { for (int i = 0; i < paneList.size(); i++) {
CellEditorPane pane = paneList.get(i); CellEditorPane pane = paneList.get(i);
iconArray[i] = pane.getIconPath(); iconArray[i] = pane.getIconPath();
@ -176,12 +179,18 @@ public class CellDSColumnEditor extends CellQuickEditor {
/*基本设置面板*/ /*基本设置面板*/
this.dataPane = new SelectedDataColumnPane(); this.dataPane = new SelectedDataColumnPane();
this.groupPane = new ResultSetGroupDockingPane(tc); this.groupPane = new ResultSetGroupDockingPane(tc);
this.conditionPane = new JPanel(new BorderLayout()); double p = TableLayout.PREFERRED, f = TableLayout.FILL;
conditionPane.add(new UILabel("filter:"), BorderLayout.WEST); double[] rowSize = {p}, columnSize = {p, f};
UILabel uiLabel = new UILabel("filter");
UIButton uiButton = new UIButton();
if (tc != null) { if (tc != null) {
//第一次初始化时tc为空,引发NullPointerException //第一次初始化时tc为空,引发NullPointerException
conditionPane.add(new UIButton(new DSColumnConditionAction(tc)), BorderLayout.CENTER); uiButton = new UIButton(new DSColumnConditionAction(tc));
} }
Component[][] components = new Component[][]{
new Component[]{uiLabel, uiButton}
};
this.conditionPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
dataPane.addListener(dataListener); dataPane.addListener(dataListener);
groupPane.addListener(groupListener); groupPane.addListener(groupListener);
paneList.add(new DSColumnBasicEditorPane(cellElement, dataPane, groupPane, conditionPane)); paneList.add(new DSColumnBasicEditorPane(cellElement, dataPane, groupPane, conditionPane));

Loading…
Cancel
Save