@ -4,6 +4,7 @@ import com.fr.base.FRContext;
import com.fr.design.constants.UIConstants ;
import com.fr.design.dialog.BasicPane ;
import com.fr.design.extra.WebViewDlgHelper ;
import com.fr.design.gui.frpane.FineTabbedPane ;
import com.fr.design.gui.frpane.UITabbedPane ;
import com.fr.design.gui.icheckbox.UICheckBox ;
import com.fr.design.gui.ilable.ActionLabel ;
@ -24,6 +25,9 @@ import java.awt.*;
import java.awt.event.ActionEvent ;
import java.awt.event.ActionListener ;
import static com.fine.swing.ui.layout.Layouts.* ;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle ;
/ * *
* Sets Report Page Attributes
* /
@ -33,7 +37,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private static final int LABEL_HEIGHT = 45 ;
//tab
private UI TabbedPane tabbedPane ;
private Fine TabbedPane tabbedPane ;
// 重复标题行
private RepeatRowPane repeatTitleRowPane ;
@ -82,15 +86,16 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* 重复标题行
* /
private JPanel initRowStartPane ( ) {
JPanel soverlapRowStartPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
useRepeatTitleRCheckBox = new UICheckBox ( ) ;
soverlapRowStartPane . add ( useRepeatTitleRCheckBox ) ;
soverlapRowStartPane . add ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Title_Start_Row_Form" ) ) ) ;
repeatTitleRowPane = new RepeatRowPane ( ) ;
soverlapRowStartPane . add ( repeatTitleRowPane ) ;
soverlapRowStartPane . add ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Row" ) ) ) ;
return soverlapRowStartPane ;
return row (
2 ,
cell ( useRepeatTitleRCheckBox ) ,
cell ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Title_Start_Row_Form" ) ) ) ,
cell ( repeatTitleRowPane ) ,
cell ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Row" ) ) )
) . getComponent ( ) ;
}
/ * *
@ -98,16 +103,49 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* /
private JPanel initColStartPane ( ) {
// 重复打印标题的起始列
JPanel soverlapColStartPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
useRepeatTitleCCheckBox = new UICheckBox ( ) ;
soverlapColStartPane . add ( useRepeatTitleCCheckBox ) ;
soverlapColStartPane . add ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Title_Start_Column_Form" ) ) ) ;
// 重复打印标题的结束列
repeatTitleColPane = new RepeatColPane ( ) ;
soverlapColStartPane . add ( repeatTitleColPane ) ;
soverlapColStartPane . add ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Column" ) ) ) ;
return soverlapColStartPane ;
return row (
2 ,
cell ( useRepeatTitleCCheckBox ) ,
cell ( new UILabel ( Toolkit . i18nText ( "Fine-Design_Report_Title_Start_Column_Form" ) ) ) ,
cell ( repeatTitleColPane ) ,
cell ( new UILabel ( Toolkit . i18nText ( "Fine-Design_Report_Column" ) ) )
) . getComponent ( ) ;
}
private JPanel initPageRepeatPane ( ) {
return row (
10 ,
column (
10 ,
cell ( new UILabel ( REPEAT_AND_FROZEN_HEAD ) ) . weight ( 0 . 5 ) ,
flex ( 0 . 5 )
) ,
column (
10 ,
cell ( initRowStartPane ( ) ) . weight ( 0 . 5 ) ,
cell ( initColStartPane ( ) ) . weight ( 0 . 5 )
)
) . getComponent ( ) ;
}
private JPanel initPageRepeatFootPane ( ) {
return row (
10 ,
column (
10 ,
cell ( new UILabel ( REPEAT_AND_FROZEN_FOOT ) ) . weight ( 0 . 5 ) ,
flex ( 0 . 5 )
) ,
column (
10 ,
cell ( initFootRowStarPane ( ) ) . weight ( 0 . 5 ) ,
cell ( initFootColStartPane ( ) ) . weight ( 0 . 5 )
)
) . getComponent ( ) ;
}
/ * *
@ -115,15 +153,16 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* /
private JPanel initFootRowStarPane ( ) {
// 重复打印结尾的起始行
JPanel foverlapRowStartPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
useRepeatFinisRCheckBox = new UICheckBox ( ) ;
foverlapRowStartPane . add ( useRepeatFinisRCheckBox ) ;
foverlapRowStartPane . add ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Finis_Start_Row_Form" ) ) ) ;
repeatFinisRowPane = new RepeatRowPane ( ) ;
foverlapRowStartPane . add ( repeatFinisRowPane ) ;
foverlapRowStartPane . add ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Row" ) ) ) ;
return foverlapRowStartPane ;
return row (
2 ,
cell ( useRepeatFinisRCheckBox ) ,
cell ( new UILabel ( Toolkit . i18nText ( "Fine-Design_Report_Finis_Start_Row_Form" ) ) ) ,
cell ( repeatFinisRowPane ) ,
cell ( new UILabel ( Toolkit . i18nText ( "Fine-Design_Basic_Row" ) ) )
) . getComponent ( ) ;
}
/ * *
@ -131,15 +170,16 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* /
private JPanel initFootColStartPane ( ) {
// 重复打印结尾的起始列
JPanel foverlapColStartPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
useRepeatFinisCCheckBox = new UICheckBox ( ) ;
foverlapColStartPane . add ( useRepeatFinisCCheckBox ) ;
foverlapColStartPane . add ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Finis_Start_Column_Form" ) ) ) ;
repeatFinisColPane = new RepeatColPane ( ) ;
foverlapColStartPane . add ( repeatFinisColPane ) ;
foverlapColStartPane . add ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Column" ) ) ) ;
return foverlapColStartPane ;
return row (
2 ,
cell ( useRepeatFinisCCheckBox ) ,
cell ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Finis_Start_Column_Form" ) ) ) ,
cell ( repeatFinisColPane ) ,
cell ( new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Column" ) ) )
) . getComponent ( ) ;
}
/ * *
@ -157,37 +197,64 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* /
private JPanel initPageFrozenPane ( ) {
// 分页冻结
JPanel pagecon = FRGUIPaneFactory . createNColumnGridInnerContainer_S_Pane ( 1 ) ;
pagecon . setBorder ( BorderFactory . createEmptyBorder ( 0 , 20 , 0 , 0 ) ) ;
JPanel pageRowGridPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
pageRowGridPane . add ( this . usePageHeadFrozenRCheckBox = new UICheckBox ( ) ) ;
usePageHeadFrozenRCheckBox = new UICheckBox ( ) ;
// 显示行冻结信息的panel
freezePageRowPane = new FreezePagePane ( true ) ;
pageRowGridPane . add ( freezePageRowPane ) ;
pagecon . add ( pageRowGridPane ) ;
addPageFrozenCol ( pagecon ) ;
addBorder ( pagecon , REPEAT_AND_FROZEN_HEAD ) ;
return pagecon ;
freezePageColPane = new FreezePagePane ( false ) ;
usePageHeadFrozenCCheckBox = new UICheckBox ( ) ;
return row (
10 ,
column (
10 ,
cell ( new UILabel ( REPEAT_AND_FROZEN_HEAD ) ) . weight ( 0 . 5 ) ,
flex ( 0 . 5 )
) ,
column (
10 ,
row (
2 ,
cell ( usePageHeadFrozenRCheckBox ) ,
cell ( freezePageRowPane )
) . weight ( 0 . 5 ) ,
row (
2 ,
cell ( usePageHeadFrozenCCheckBox ) ,
cell ( freezePageColPane )
) . weight ( 0 . 5 )
)
) . getComponent ( ) ;
}
private JPanel initPageFrozenFootPane ( ) {
JPanel pageContentPanel = FRGUIPaneFactory . createNColumnGridInnerContainer_S_Pane ( 1 ) ;
pageContentPanel . setBorder ( BorderFactory . createEmptyBorder ( 0 , 20 , 0 , 0 ) ) ;
// 行冻结
JPanel pageRowPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
pageRowPane . add ( this . usePageFootFrozenRCheckBox = new UICheckBox ( ) ) ;
usePageFootFrozenRCheckBox = new UICheckBox ( ) ;
// 列冻结
JPanel pageColPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
pageColPane . add ( this . usePageFootFrozenCCheckBox = new UICheckBox ( ) ) ;
pageContentPanel . add ( pageRowPane ) ;
usePageFootFrozenCCheckBox = new UICheckBox ( ) ;
freezeFootRowPane = new FreezePagePane ( true , true ) ;
pageRowPane . add ( freezeFootRowPane ) ;
pageContentPanel . add ( pageColPane ) ;
freezeFootColPane = new FreezePagePane ( false , true ) ;
pageColPane . add ( freezeFootColPane ) ;
addBorder ( pageContentPanel , REPEAT_AND_FROZEN_FOOT ) ;
return pageContentPanel ;
return row (
10 ,
column (
10 ,
cell ( new UILabel ( REPEAT_AND_FROZEN_FOOT ) ) . weight ( 0 . 5 ) ,
flex ( 0 . 5 )
) ,
column (
10 ,
row (
2 ,
cell ( usePageFootFrozenRCheckBox ) ,
cell ( freezeFootRowPane )
) . weight ( 0 . 5 ) ,
row (
2 ,
cell ( usePageFootFrozenCCheckBox ) ,
cell ( freezeFootColPane )
) . weight ( 0 . 5 )
)
) . getComponent ( ) ;
}
@ -207,49 +274,59 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* 填报冻结Pane
* /
protected JPanel initWriteFrozenPane ( ) {
JPanel writePanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
// 填报冻结
UILabel writeLabel = new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Face_Write_Frozen" ) + ":" ) ;
JPanel writeLabelPanel = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
writeLabelPanel . add ( writeLabel ) ;
writePanel . add ( writeLabelPanel , BorderLayout . NORTH ) ;
JPanel writecon = FRGUIPaneFactory . createNColumnGridInnerContainer_S_Pane ( 1 ) ;
writecon . setBorder ( BorderFactory . createEmptyBorder ( 0 , 20 , 0 , 0 ) ) ;
writePanel . add ( writecon , BorderLayout . CENTER ) ;
// 行冻结
JPanel writeRowPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
writeRowPane . add ( this . useWriteFrozenRCheckBox = new UICheckBox ( ) ) ;
// 列冻结
JPanel writeColPane = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
writeColPane . add ( this . useWriteFrozenCCheckBox = new UICheckBox ( ) ) ;
writecon . add ( writeRowPane ) ;
useWriteFrozenRCheckBox = new UICheckBox ( ) ;
freezeWriteRowPane = new FreezeWriteRowPane ( ) ;
writeRowPane . add ( freezeWriteRowPane ) ;
writecon . add ( writeColPane ) ;
// 列冻结
useWriteFrozenCCheckBox = new UICheckBox ( ) ;
freezeWriteColPane = new FreezeWriteColPane ( ) ;
writeColPane . add ( freezeWriteColPane ) ;
return writePanel ;
return row (
10 ,
column (
10 ,
cell ( new UILabel ( Toolkit . i18nText ( "Fine-Design_Report_Face_Write_Frozen" ) ) ) . weight ( 0 . 5 ) ,
flex ( 0 . 5 )
) ,
column (
10 ,
row (
2 ,
cell ( useWriteFrozenRCheckBox ) ,
cell ( freezeWriteRowPane )
) . weight ( 0 . 5 ) ,
row (
2 ,
cell ( useWriteFrozenCCheckBox ) ,
cell ( freezeWriteColPane )
) . weight ( 0 . 5 )
)
) . getComponent ( ) ;
}
public RepeatAndFreezeSettingPane ( ) {
this . setLayout ( FRGUIPaneFactory . createBorderLayout ( ) ) ;
JPanel outrepeatPanel = FRGUIPaneFactory . createTitledBorderPane ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Repeat" ) ) ;
JPanel cenrepeatPanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
outrepeatPanel . add ( cenrepeatPanel ) ;
JPanel outfreezePanel = FRGUIPaneFactory . createTitledBorderPane ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Engine_Frozen" ) ) ;
JPanel pagePanel = new JPanel ( FRGUIPaneFactory . createBorderLayout ( ) ) ;
JPanel repeatHeadPanel = FRGUIPaneFactory . createNColumnGridInnerContainer_S_Pane ( 1 ) ;
JPanel repeatFootPanel = FRGUIPaneFactory . createNColumnGridInnerContainer_S_Pane ( 1 ) ;
tabbedPane = new UITabbedPane ( ) ;
//添加上方的边界线
addBorder ( repeatHeadPanel , REPEAT_AND_FROZEN_HEAD ) ;
addBorder ( repeatFootPanel , REPEAT_AND_FROZEN_FOOT ) ;
pagePanel . add ( outrepeatPanel , BorderLayout . NORTH ) ;
pagePanel . add ( outfreezePanel , BorderLayout . CENTER ) ;
this . setLayout ( new BorderLayout ( ) ) ;
JPanel outrepeatPanel = column (
10 ,
cell ( initPageRepeatPane ( ) ) ,
cell ( initPageRepeatFootPane ( ) )
) . getComponent ( ) ;
JPanel outfreezePanel = column (
10 ,
cell ( initPageFrozenPane ( ) ) ,
cell ( initPageFrozenFootPane ( ) )
) . getComponent ( ) ;
JPanel pagePanel = column (
10 ,
fix ( 10 ) ,
cell ( wrapComponentWithTitle ( outrepeatPanel , com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Repeat" ) ) ) ,
cell ( wrapComponentWithTitle ( outfreezePanel , com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Engine_Frozen" ) ) ) ,
cell ( new UILabel ( "<html><font color=gray>" + Toolkit . i18nText ( "Fine-Design_Report_Engine_Freeze_Tip" ) + "</font></html>" ) )
) . getComponent ( ) ;
// 重复打印部分
// 重复打印标题的起始行
@ -258,31 +335,22 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
UILabel warning = new UILabel ( "(" + com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Engine_FreezeWarning" ) + ")" ) ;
warning . setForeground ( Color . red ) ;
labelPanel . add ( warning ) ;
cenrepeatPanel . add ( repeatHeadPanel , BorderLayout . NORTH ) ;
cenrepeatPanel . add ( repeatFootPanel , BorderLayout . CENTER ) ;
repeatHeadPanel . add ( initRowStartPane ( ) ) ;
addColStart ( repeatHeadPanel ) ;
repeatFootPanel . add ( initFootRowStarPane ( ) ) ;
addFootColStart ( repeatFootPanel ) ;
outfreezePanel . add ( initPageFrozenPane ( ) , BorderLayout . NORTH ) ;
outfreezePanel . add ( initPageFrozenFootPane ( ) , BorderLayout . CENTER ) ;
outfreezePanel . add ( new UILabel ( "<html><font color=gray> " + Toolkit . i18nText ( "Fine-Design_Report_Engine_Freeze_Tip" ) + "</font></html>" ) , BorderLayout . SOUTH ) ;
JPanel writePanel = FRGUIPaneFactory . createTitledBorderPane ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Engine_Frozen" ) ) ;
JPanel writeOutrepeatPanel = initWriteFrozenPane ( ) ;
JPanel writePanel = column (
10 ,
fix ( 10 ) ,
cell ( wrapComponentWithTitle ( writeOutrepeatPanel , com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Report_Engine_Frozen" ) ) )
) . getComponent ( ) ;
addWriteFrozen ( writePanel , pagePanel ) ;
if ( tabbedPane . getTabSize ( ) = = 0 ) {
this . add ( pagePanel ) ;
}
initPageRwoListener ( ) ;
initPageColListener ( ) ;
initWriteListener ( ) ;
}
private boolean shouldShowTip ( ) {
return WorkContext . getCurrent ( ) . isLocal ( ) & & FRContext . isChineseEnv ( ) ;
}
@ -320,9 +388,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
}
protected void addWriteFrozen ( JPanel freezePanel , JPanel pagePanel ) {
freezePanel . add ( initWriteFrozenPane ( ) , BorderLayout . CENTER ) ;
tabbedPane . addTab ( Toolkit . i18nText ( "Fine-Design_Basic_M_Page_Preview" ) , pagePanel ) ;
tabbedPane . addTab ( Toolkit . i18nText ( "Fine-Design_Basic_M_Write_Preview" ) , freezePanel ) ;
FineTabbedPane . TabPaneBuilder tabbedPaneBuilder = new FineTabbedPane . TabPaneBuilder ( ) ;
tabbedPaneBuilder . addTab ( Toolkit . i18nText ( "Fine-Design_Basic_M_Page_Preview" ) , pagePanel ) ; //分页预览
tabbedPaneBuilder . addTab ( Toolkit . i18nText ( "Fine-Design_Basic_M_Write_Preview" ) , freezePanel ) ;
tabbedPane = tabbedPaneBuilder . withHeadRatio ( 0 . 35f ) . build ( ) ;
//去除对应的焦点虚线边框
tabbedPane . setFocusable ( false ) ;
this . add ( tabbedPane ) ;