Browse Source

Pull request #7060: REPORT-55240:修改一下设计器关于报表引擎的设置界面

Merge in DESIGN/design from ~FLY.LI/design:feature/x to feature/x

* commit '30748629ae0ff4a7cfad07e0d090bfc669c81062':
  REPORT-55240:修改一下设计器关于报表引擎的设置界面
feature/x
Fly.Li 3 years ago
parent
commit
1e027ca039
  1. 96
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

96
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -53,11 +53,15 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
private JPanel outLineEngineSettingPane; private JPanel outLineEngineSettingPane;
private JLayeredPane engineSettingPane; private JLayeredPane engineSettingPane;
private UICheckBox clientPaging; private UICheckBox clientPaging;
private UICheckBox pageQueryBox; private UICheckBox lineEnginePageQueryBox;
private UICheckBox engineXPageQueryBox;
private UICheckBox rowCountBox;
private JPanel outPagingEngineSelectPane; private JPanel outPagingEngineSelectPane;
private JPanel outEngineXSettingPane; private JPanel outEngineXSettingPane;
private JPanel pageQueryPane; private JPanel lineEnginePageQueryPane;
private IntegerEditor countPerPageEditor; private JPanel engineXPageQueryPane;
private IntegerEditor lineEngineCountPerPageEditor;
private IntegerEditor engineXCountPerPageEditor;
private WorkSheet worksheet; private WorkSheet worksheet;
private List<JRadioButton> radioButtons = new ArrayList<>(2); private List<JRadioButton> radioButtons = new ArrayList<>(2);
@ -115,39 +119,53 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
return pagingEngineSelectPane; return pagingEngineSelectPane;
} }
/** /**
* 目前先屏蔽后面新引擎显示页码再加上相关代码 * 目前先屏蔽后面新引擎显示页码再加上相关代码
* */ * */
private void createEngineXSettingPane(){ private void createEngineXSettingPane(){
outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"));
outEngineXSettingPane.setBounds(0, 0, 570, 240); outEngineXSettingPane.setBounds(0, 0, 570, 240);
JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
engineXPageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
engineXPageQueryBox.setSelected(false);
pageQueryBoxPanel.add(engineXPageQueryBox);
engineXSettingPane.add(pageQueryBoxPanel);
engineXCountPerPageEditor = new IntegerEditor(new Integer(30));
engineXCountPerPageEditor.setPreferredSize(new Dimension(120, 20));
engineXPageQueryPane = createPageQueryPane(engineXCountPerPageEditor);
engineXPageQueryPane.setVisible(false);
engineXSettingPane.add(engineXPageQueryPane);
engineXPageQueryBox.addActionListener(new SelectActionListener(engineXPageQueryBox, engineXPageQueryPane));
JPanel rowCountPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
//todo 改一下国际化文件
rowCountBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_Count"));
rowCountBox.setSelected(false);
rowCountPanel.add(rowCountBox);
engineXSettingPane.add(rowCountPanel);
outEngineXSettingPane.add(engineXSettingPane);
} }
private void createLineEngineSettingPane(){ private void createLineEngineSettingPane(){
outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"));
outLineEngineSettingPane.setBounds(0, 0, 570, 240); outLineEngineSettingPane.setBounds(0, 0, 570, 240);
JPanel lineEngineSettingPane = createCommonEngineSettingPane(); JPanel lineEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
lineEnginePageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
lineEnginePageQueryBox.setSelected(false);
pageQueryBoxPanel.add(lineEnginePageQueryBox);
lineEngineSettingPane.add(pageQueryBoxPanel);
lineEngineCountPerPageEditor = new IntegerEditor(new Integer(30));
lineEngineCountPerPageEditor.setPreferredSize(new Dimension(120, 20));
lineEnginePageQueryPane = createPageQueryPane(lineEngineCountPerPageEditor);
lineEnginePageQueryPane.setVisible(false);
lineEngineSettingPane.add(lineEnginePageQueryPane);
lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane));
JPanel tipPane = createTipPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip")); JPanel tipPane = createTipPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip"));
lineEngineSettingPane.add(tipPane); lineEngineSettingPane.add(tipPane);
outLineEngineSettingPane.add(lineEngineSettingPane); outLineEngineSettingPane.add(lineEngineSettingPane);
} }
private JPanel createCommonEngineSettingPane(){
JPanel commonEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
pageQueryBox.setSelected(false);
pageQueryBoxPanel.add(pageQueryBox);
commonEngineSettingPane.add(pageQueryBoxPanel);
pageQueryPane = createPageQueryPane();
pageQueryPane.setVisible(false);
commonEngineSettingPane.add(pageQueryPane);
pageQueryBox.addActionListener(new SelectActionListener(pageQueryBox, pageQueryPane));
return commonEngineSettingPane;
}
private JPanel createTipPane(String tipText){ private JPanel createTipPane(String tipText){
JPanel tipPane = new JPanel(); JPanel tipPane = new JPanel();
UILabel tip = new UILabel(tipText, SwingConstants.LEFT); UILabel tip = new UILabel(tipText, SwingConstants.LEFT);
@ -156,12 +174,10 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
return tipPane; return tipPane;
} }
private JPanel createPageQueryPane() { private JPanel createPageQueryPane(IntegerEditor countPerPageEditor) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = {p, p}; double rowSize[] = {p, p};
double columnSize[] = {p, p}; double columnSize[] = {p, p};
countPerPageEditor = new IntegerEditor(new Integer(30));
countPerPageEditor.setPreferredSize(new Dimension(120, 20));
Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage") + ":"), countPerPageEditor}}; Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage") + ":"), countPerPageEditor}};
JPanel pageQueryPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel pageQueryPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
pageQueryPane.setBorder(BorderFactory.createEmptyBorder(5, 15, 0, 0)); pageQueryPane.setBorder(BorderFactory.createEmptyBorder(5, 15, 0, 0));
@ -232,9 +248,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
return; return;
} }
clientPaging.setSelected(ob.isClientPaging()); clientPaging.setSelected(ob.isClientPaging());
if (clientPaging.isSelected()){ outPagingEngineSelectPane.setVisible(clientPaging.isSelected());
outPagingEngineSelectPane.setVisible(true);
}
engineSettingPane.setVisible(true); engineSettingPane.setVisible(true);
radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X); radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X);
radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE); radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE);
@ -242,33 +256,39 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
engineSettingPane.moveToFront(outEngineXSettingPane); engineSettingPane.moveToFront(outEngineXSettingPane);
outEngineXSettingPane.setVisible(true); outEngineXSettingPane.setVisible(true);
outLineEngineSettingPane.setVisible(false); outLineEngineSettingPane.setVisible(false);
engineXCountPerPageEditor.setValue(new Integer(ob.getCountPerPage()));
engineXPageQueryBox.setSelected(ob.isPageQuery());
engineXPageQueryPane.setVisible(ob.isPageQuery());
}else { }else {
engineSettingPane.moveToFront(outLineEngineSettingPane); engineSettingPane.moveToFront(outLineEngineSettingPane);
outEngineXSettingPane.setVisible(false); outEngineXSettingPane.setVisible(false);
outLineEngineSettingPane.setVisible(true); outLineEngineSettingPane.setVisible(true);
lineEngineCountPerPageEditor.setValue(new Integer(ob.getCountPerPage()));
lineEnginePageQueryBox.setSelected(ob.isPageQuery());
lineEnginePageQueryPane.setVisible(ob.isPageQuery());
} }
countPerPageEditor.setValue(new Integer(ob.getCountPerPage())); rowCountBox.setSelected(ob.isEnableRowCount());
if (ob.isPageQuery()) {
pageQueryBox.setSelected(true);
pageQueryPane.setVisible(true);
} else {
pageQueryBox.setSelected(false);
pageQueryPane.setVisible(false);
}
} }
@Override @Override
public LayerReportAttr updateBean() { public LayerReportAttr updateBean() {
//这里注意一下怎么更新的,后续可能存在判断为空的调用,从而对老引擎造成影响。 //这里注意一下怎么更新的,后续可能存在判断为空的调用,从而对老引擎造成影响。
LayerReportAttr attr = new LayerReportAttr(); LayerReportAttr attr = new LayerReportAttr();
attr.setPageQuery(pageQueryBox.isSelected());
attr.setCountPerPage(Math.min(500, (countPerPageEditor.getValue()).intValue()));
attr.setClientPaging(clientPaging.isSelected()); attr.setClientPaging(clientPaging.isSelected());
for (int i = 0; i < radioButtons.size(); i++){ for (int i = 0; i < radioButtons.size(); i++){
if (radioButtons.get(i).isSelected()){ if (radioButtons.get(i).isSelected()){
attr.setEngineState(i); attr.setEngineState(i);
} }
} }
if (attr.getEngineState() == LayerReportAttr.ENGINE_X){
attr.setEnableRowCount(rowCountBox.isSelected());
attr.setCountPerPage(engineXCountPerPageEditor.getValue().intValue());
attr.setPageQuery(engineXPageQueryBox.isSelected());
}else {
attr.setPageQuery(lineEnginePageQueryBox.isSelected());
attr.setCountPerPage(lineEngineCountPerPageEditor.getValue());
}
attr.setEnableRowCount(rowCountBox.isSelected());
return attr; return attr;
} }
@ -286,8 +306,8 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
} }
public void setDefaultAttr(){ public void setDefaultAttr(){
clientPaging.setSelected(false); clientPaging.setSelected(false);
countPerPageEditor.setValue(30); lineEngineCountPerPageEditor.setValue(30);
pageQueryBox.setSelected(false); lineEnginePageQueryBox.setSelected(false);
radioButtons.get(0).setSelected(false); radioButtons.get(0).setSelected(false);
radioButtons.get(1).setSelected(false); radioButtons.get(1).setSelected(false);
} }

Loading…
Cancel
Save