|
|
|
@ -22,6 +22,7 @@ import javax.swing.AbstractButton;
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.ButtonGroup; |
|
|
|
|
import javax.swing.JLabel; |
|
|
|
|
import javax.swing.JLayeredPane; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.JRadioButton; |
|
|
|
@ -49,8 +50,9 @@ import java.util.List;
|
|
|
|
|
*/ |
|
|
|
|
public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> { |
|
|
|
|
private static final int LABEL_HEIGHT = 55; |
|
|
|
|
private JPanel outLineEngineSettingPane; |
|
|
|
|
private JLayeredPane engineSettingPane; |
|
|
|
|
private UICheckBox clientPaging; |
|
|
|
|
private UICheckBox showDataNumber; |
|
|
|
|
private UICheckBox pageQueryBox; |
|
|
|
|
private JPanel outPagingEngineSelectPane; |
|
|
|
|
private JPanel outEngineXSettingPane; |
|
|
|
@ -82,48 +84,79 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
|
|
|
|
|
private JPanel createReportEnginePane(){ |
|
|
|
|
JPanel reportEnginePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
|
|
|
|
JPanel clientPagingpanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
JPanel clientPagingPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
clientPaging = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enable_Client_Page")); |
|
|
|
|
clientPaging.setSelected(false); |
|
|
|
|
clientPagingpanel.add(clientPaging); |
|
|
|
|
reportEnginePane.add(clientPagingpanel); |
|
|
|
|
clientPagingPane.add(clientPaging); |
|
|
|
|
reportEnginePane.add(clientPagingPane); |
|
|
|
|
outPagingEngineSelectPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Engine_Select")); |
|
|
|
|
reportEnginePane.add(outPagingEngineSelectPane); |
|
|
|
|
outPagingEngineSelectPane.setVisible(false); |
|
|
|
|
outPagingEngineSelectPane.setPreferredSize(new Dimension(600, 300)); |
|
|
|
|
outPagingEngineSelectPane.add(createPagingEngineSelectPane()); |
|
|
|
|
clientPaging.addActionListener(new SelectActionListener(clientPaging, outPagingEngineSelectPane)); |
|
|
|
|
reportEnginePane.validate(); |
|
|
|
|
return reportEnginePane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createPagingEngineSelectPane(){ |
|
|
|
|
engineSettingPane = new JLayeredPane(); |
|
|
|
|
engineSettingPane.setPreferredSize(new Dimension(570, 240)); |
|
|
|
|
engineSettingPane.setBounds(0,0,570,240); |
|
|
|
|
createEngineXSettingPane(); |
|
|
|
|
createLineEngineSettingPane(); |
|
|
|
|
engineSettingPane.add(outEngineXSettingPane, JLayeredPane.DEFAULT_LAYER); |
|
|
|
|
engineSettingPane.add(outLineEngineSettingPane, JLayeredPane.DEFAULT_LAYER); |
|
|
|
|
engineSettingPane.moveToFront(outEngineXSettingPane); |
|
|
|
|
engineSettingPane.setVisible(false); |
|
|
|
|
this.validate(); |
|
|
|
|
JPanel pagingEngineSelectPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
|
|
|
|
outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); |
|
|
|
|
outEngineXSettingPane.setVisible(false); |
|
|
|
|
outEngineXSettingPane.setPreferredSize(new Dimension(570, 240)); |
|
|
|
|
outEngineXSettingPane.add(createEngineXSettingPane()); |
|
|
|
|
pagingEngineSelectPane.add(createPagingEngineRadioPanel()); |
|
|
|
|
pagingEngineSelectPane.add(outEngineXSettingPane); |
|
|
|
|
|
|
|
|
|
pagingEngineSelectPane.add(engineSettingPane); |
|
|
|
|
return pagingEngineSelectPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 目前先屏蔽,后面新引擎显示页码再加上相关代码 |
|
|
|
|
* */ |
|
|
|
|
private JPanel createEngineXSettingPane(){ |
|
|
|
|
JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); |
|
|
|
|
outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); |
|
|
|
|
outEngineXSettingPane.setBounds(0, 0, 570, 240); |
|
|
|
|
return outEngineXSettingPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createLineEngineSettingPane(){ |
|
|
|
|
outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); |
|
|
|
|
outLineEngineSettingPane.setBounds(0, 0, 570, 240); |
|
|
|
|
JPanel lineEngineSettingPane = createCommonEngineSettingPane(); |
|
|
|
|
JPanel tipPane = createTipPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip")); |
|
|
|
|
lineEngineSettingPane.add(tipPane); |
|
|
|
|
outLineEngineSettingPane.add(lineEngineSettingPane); |
|
|
|
|
return outLineEngineSettingPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
engineXSettingPane.add(pageQueryBoxPanel); |
|
|
|
|
commonEngineSettingPane.add(pageQueryBoxPanel); |
|
|
|
|
pageQueryPane = createPageQueryPane(); |
|
|
|
|
pageQueryPane.setVisible(false); |
|
|
|
|
engineXSettingPane.add(pageQueryPane); |
|
|
|
|
commonEngineSettingPane.add(pageQueryPane); |
|
|
|
|
pageQueryBox.addActionListener(new SelectActionListener(pageQueryBox, pageQueryPane)); |
|
|
|
|
return commonEngineSettingPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createTipPane(String tipText){ |
|
|
|
|
JPanel tipPane = new JPanel(); |
|
|
|
|
UILabel tip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Report_Engine_tip"), SwingConstants.LEFT); |
|
|
|
|
UILabel tip = new UILabel(tipText, SwingConstants.LEFT); |
|
|
|
|
tip.setForeground(new Color(128,128,128)); |
|
|
|
|
tipPane.add(tip); |
|
|
|
|
engineXSettingPane.add(tipPane); |
|
|
|
|
return engineXSettingPane; |
|
|
|
|
return tipPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createPageQueryPane() { |
|
|
|
@ -132,7 +165,6 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
double columnSize[] = {p, p}; |
|
|
|
|
countPerPageEditor = new IntegerEditor(new Integer(30)); |
|
|
|
|
countPerPageEditor.setPreferredSize(new Dimension(120,20)); |
|
|
|
|
countPerPageEditor.setEnabled(false); |
|
|
|
|
Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage") + ":"), countPerPageEditor}}; |
|
|
|
|
JPanel pageQueryPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
pageQueryPane.setBorder(BorderFactory.createEmptyBorder(5, 15, 0, 0)); |
|
|
|
@ -186,8 +218,8 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
JPanel pagingEngineRadioPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
newEngine.addActionListener(new SelectActionListener(newEngine, outEngineXSettingPane)); |
|
|
|
|
lineEngine.addActionListener(new SelectActionListener(lineEngine, outEngineXSettingPane)); |
|
|
|
|
newEngine.addActionListener(new EngineSelectActionListener(newEngine, engineSettingPane, outEngineXSettingPane, outLineEngineSettingPane)); |
|
|
|
|
lineEngine.addActionListener(new EngineSelectActionListener(lineEngine, engineSettingPane, outLineEngineSettingPane, outEngineXSettingPane)); |
|
|
|
|
return pagingEngineRadioPanel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -206,22 +238,22 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
if (clientPaging.isSelected()){ |
|
|
|
|
outPagingEngineSelectPane.setVisible(true); |
|
|
|
|
} |
|
|
|
|
engineSettingPane.setVisible(true); |
|
|
|
|
radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X); |
|
|
|
|
radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE); |
|
|
|
|
if (ob.getEngineState() == LayerReportAttr.ENGINE_X){ |
|
|
|
|
engineSettingPane.moveToFront(outEngineXSettingPane); |
|
|
|
|
}else { |
|
|
|
|
engineSettingPane.moveToFront(outLineEngineSettingPane); |
|
|
|
|
} |
|
|
|
|
countPerPageEditor.setValue(new Integer(ob.getCountPerPage())); |
|
|
|
|
if (ob.isPageQuery()) { |
|
|
|
|
pageQueryBox.setSelected(true); |
|
|
|
|
countPerPageEditor.setEnabled(true); |
|
|
|
|
pageQueryPane.setVisible(true); |
|
|
|
|
} else { |
|
|
|
|
pageQueryBox.setSelected(false); |
|
|
|
|
countPerPageEditor.setEnabled(false); |
|
|
|
|
} |
|
|
|
|
if (pageQueryBox.isSelected()){ |
|
|
|
|
pageQueryPane.setVisible(true); |
|
|
|
|
pageQueryPane.setVisible(false); |
|
|
|
|
} |
|
|
|
|
radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X); |
|
|
|
|
radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE); |
|
|
|
|
//有一个默认值,一定会显示分页选项界面
|
|
|
|
|
outEngineXSettingPane.setVisible(true); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -254,7 +286,6 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
public void setDefaultAttr(){ |
|
|
|
|
clientPaging.setSelected(false); |
|
|
|
|
countPerPageEditor.setValue(30); |
|
|
|
|
countPerPageEditor.setEnabled(false); |
|
|
|
|
pageQueryBox.setSelected(false); |
|
|
|
|
radioButtons.get(0).setSelected(false); |
|
|
|
|
radioButtons.get(1).setSelected(false); |
|
|
|
@ -276,5 +307,30 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class EngineSelectActionListener implements ActionListener{ |
|
|
|
|
private AbstractButton source; |
|
|
|
|
private JLayeredPane target; |
|
|
|
|
private JPanel showTarget; |
|
|
|
|
private JPanel notShowTarget; |
|
|
|
|
private EngineSelectActionListener(AbstractButton source, JLayeredPane target, JPanel showTarget, JPanel notShowTarget){ |
|
|
|
|
this.source = source; |
|
|
|
|
this.target = target; |
|
|
|
|
this.showTarget = showTarget; |
|
|
|
|
this.notShowTarget = notShowTarget; |
|
|
|
|
} |
|
|
|
|
//由于屏蔽了新引擎设置,由于新引擎设置界面是空的,行式引擎的设置会显示出来,每次转换时,因此将不需要显示的屏蔽
|
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
if (source.isSelected()){ |
|
|
|
|
target.setVisible(true); |
|
|
|
|
showTarget.setVisible(true); |
|
|
|
|
notShowTarget.setVisible(false); |
|
|
|
|
target.moveToFront(showTarget); |
|
|
|
|
}else { |
|
|
|
|
target.setVisible(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|