Browse Source

REPORT-59724:修改成默认选中新计算引擎选项以及顺便修改一下报表引擎属性类相关属性命名不规范的地方

research/11.0
fly.li 3 years ago
parent
commit
a79d9c929f
  1. 90
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

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

@ -33,9 +33,9 @@ import java.util.List;
*/
public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
private static final int LABEL_HEIGHT = 55;
private UICheckBox isClientPaging;
private UICheckBox isShowDataNumber;
private UICheckBox isPageQueryBox;
private UICheckBox clientPaging;
private UICheckBox showDataNumber;
private UICheckBox pageQueryBox;
private IntegerEditor countPerPageEditor;
private WorkSheet worksheet;
private List<JRadioButton> radioButtons = new ArrayList<>(2);
@ -56,31 +56,31 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
this.add(outlayerReportPane);
outlayerReportPane.add(layerReportPane);
JPanel isClientPagingPanle = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
isClientPaging = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enable_Client_Page"));
isClientPaging.addActionListener(new ActionListener(){
JPanel clientPagingpanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
clientPaging = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enable_Client_Page"));
clientPaging.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
if (isClientPaging.isSelected()){
isPageQueryBox.setEnabled(true);
if (clientPaging.isSelected()){
pageQueryBox.setEnabled(true);
}else{
isPageQueryBox.setEnabled(false);
pageQueryBox.setEnabled(false);
}
}
});
isClientPaging.setSelected(false);
isClientPagingPanle.add(isClientPaging);
layerReportPane.add(isClientPagingPanle);
UIRadioButton lineEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"), false);
UIRadioButton newEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"), false);
clientPaging.setSelected(false);
clientPagingpanel.add(clientPaging);
layerReportPane.add(clientPagingpanel);
UIRadioButton newEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"), true);
UIRadioButton lineEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"), false);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(newEngine);
buttonGroup.add(lineEngine);
radioButtons.add(lineEngine);
radioButtons.add(newEngine);
radioButtons.add(lineEngine);
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
@ -88,8 +88,8 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
Component[][] components = new Component[][]{
new Component[] {
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Engine_Select")),
lineEngine,
newEngine
newEngine,
lineEngine
}
};
JPanel pagingEngineRadioPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
@ -101,21 +101,21 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
infoPane.add(label);
layerReportPane.add(infoPane);
JPanel isShowDataNumberPanle = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
isShowDataNumber = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Data_Total_Number"));
isShowDataNumber.setSelected(false);
isShowDataNumberPanle.add(isShowDataNumber);
layerReportPane.add(isShowDataNumberPanle);
JPanel isPageQueryBoxPanle = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
isPageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
isPageQueryBox.setSelected(false);
isPageQueryBox.setEnabled(false);
isPageQueryBoxPanle.add(isPageQueryBox);
layerReportPane.add(isPageQueryBoxPanle);
isPageQueryBox.addActionListener(new ActionListener() {
JPanel showDataNumberPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
showDataNumber = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Data_Total_Number"));
showDataNumber.setSelected(false);
showDataNumberPanel.add(showDataNumber);
layerReportPane.add(showDataNumberPanel);
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
pageQueryBox.setSelected(false);
pageQueryBox.setEnabled(false);
pageQueryBoxPanel.add(pageQueryBox);
layerReportPane.add(pageQueryBoxPanel);
pageQueryBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (isPageQueryBox.isSelected()) {
if (pageQueryBox.isSelected()) {
countPerPageEditor.setEnabled(true);
} else {
countPerPageEditor.setEnabled(false);
@ -152,14 +152,14 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
setDefaultAttr();
return;
}
isClientPaging.setSelected(ob.isClientPaging());
isShowDataNumber.setSelected(ob.isShowDataNumber());
clientPaging.setSelected(ob.isClientPaging());
showDataNumber.setSelected(ob.isShowDataNumber());
countPerPageEditor.setValue(new Integer(ob.getCountPerPage()));
if (ob.isPageQuery()) {
isPageQueryBox.setSelected(true);
pageQueryBox.setSelected(true);
countPerPageEditor.setEnabled(true);
} else {
isPageQueryBox.setSelected(false);
pageQueryBox.setSelected(false);
countPerPageEditor.setEnabled(false);
}
radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X ? true : false);
@ -170,10 +170,10 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
public LayerReportAttr updateBean() {
//这里注意一下怎么更新的,后续可能存在判断为空的调用,从而对老引擎造成影响。
LayerReportAttr attr = new LayerReportAttr();
attr.setPageQuery(isPageQueryBox.isSelected());
attr.setPageQuery(pageQueryBox.isSelected());
attr.setCountPerPage(Math.min(500, ((Integer)countPerPageEditor.getValue()).intValue()));
attr.setClientPaging(isClientPaging.isSelected());
attr.setShowDataNumber(isShowDataNumber.isSelected());
attr.setClientPaging(clientPaging.isSelected());
attr.setShowDataNumber(showDataNumber.isSelected());
for (int i = 0; i < radioButtons.size(); i++){
if (radioButtons.get(i).isSelected()){
attr.setEngineState(i);
@ -184,24 +184,24 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
@Override
public void checkValid() throws Exception {
if (isClientPaging.isSelected()) {
if (clientPaging.isSelected()) {
if (!ReportUtils.isLayerReportUsable(worksheet)) {
int value = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_After_Changed_Some_Attributes_Are_Different") + "?",
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION);
if (value != JOptionPane.YES_OPTION) {
isClientPaging.setSelected(false);
clientPaging.setSelected(false);
}
}
}
}
public void setDefaultAttr(){
isClientPaging.setSelected(false);
isShowDataNumber.setSelected(false);
clientPaging.setSelected(false);
showDataNumber.setSelected(false);
countPerPageEditor.setValue(new Integer(30));
countPerPageEditor.setEnabled(false);
isPageQueryBox.setSelected(false);
isPageQueryBox.setEnabled(false);
radioButtons.get(0).setSelected(false);
pageQueryBox.setSelected(false);
pageQueryBox.setEnabled(false);
radioButtons.get(0).setSelected(true);
radioButtons.get(1).setSelected(false);
}
}

Loading…
Cancel
Save