@ -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,11 +84,11 @@ 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 ) ;
@ -97,33 +99,60 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
}
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 ) ;
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 ( ) ;
/ * *
* 目前先屏蔽 , 后面新引擎显示页码再加上相关代码
* * /
private void createEngineXSettingPane ( ) {
outEngineXSettingPane = FRGUIPaneFactory . createTitledBorderPane ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_New_Engine" ) ) ;
outEngineXSettingPane . setBounds ( 0 , 0 , 570 , 240 ) ;
}
private void 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 ) ;
}
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 ) ;
commonEngine SettingPane. add ( pageQueryBoxPanel ) ;
pageQueryPane = createPageQueryPane ( ) ;
pageQueryPane . setVisible ( false ) ;
engineXSettingPane . add ( pageQueryPane ) ;
commonEngine SettingPane. 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 ( ) {
@ -131,8 +160,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
double rowSize [ ] = { p , p } ;
double columnSize [ ] = { p , p } ;
countPerPageEditor = new IntegerEditor ( new Integer ( 30 ) ) ;
countPerPageEditor . setPreferredSize ( new Dimension ( 120 , 20 ) ) ;
countPerPageEditor . setEnabled ( false ) ;
countPerPageEditor . setPreferredSize ( new Dimension ( 120 , 20 ) ) ;
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 +214,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 Engine SelectActionListener( newEngine , engineSettingPane , outEngineXSettingPane , outLineEngine SettingPane ) ) ;
lineEngine . addActionListener ( new Engine SelectActionListener( lineEngine , engineSettingPane , outLineEngineSettingPa ne , outEngineXSettingPane ) ) ;
return pagingEngineRadioPanel ;
}
@ -206,22 +234,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 +282,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 +303,34 @@ 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 ;
}
/ * *
* 由于屏蔽了新引擎设置 , 由于新引擎设置界面是空的 , 行式引擎的设置界面会显示出来 , 因此每次界面转换时 , 将不需要显示的界面屏蔽 。
* 不需要屏蔽新引擎设置时 , 就不需要showTarget . setVisible ( true ) ; notShowTarget . setVisible ( false ) ; 这两行代码了
* * * /
@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 ) ;
}
}
}
}