@ -9,7 +9,6 @@ import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.BoldFontTextLabel ;
import com.fr.design.gui.ilable.UILabel ;
import com.fr.design.layout.FRGUIPaneFactory ;
import com.fr.general.ComparatorUtils ;
import com.fr.general.GeneralUtils ;
import com.fr.general.Inter ;
import com.fr.general.SiteCenter ;
@ -68,29 +67,38 @@ public class AboutPane extends JPanel {
Inter . getLocText ( "FR-Designer-Basic_Activation_Key_Copy_OK" )
} ) ) ;
if ( shouldShowPhoneAndQQ ( ) ) {
if ( ComparatorUtils . equals ( ProductConstants . APP_NAME , FINEREPORT ) ) {
boxCenterAlignmentPane = new BoxCenterAligmentPane ( Inter . getLocText ( "FR-Designer_Service_Phone" ) + ProductConstants . COMPARE_TELEPHONE ) ;
contentPane . add ( boxCenterAlignmentPane ) ;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane ( "QQ:" + SiteCenter . getInstance ( ) . acquireUrlByKind ( "help.qq" ) ) ;
contentPane . add ( boxCenterAlignmentPane ) ;
}
addPhoneAndQQPane ( contentPane ) ;
BoxCenterAligmentPane actionLabel = getURLActionLabel ( SiteCenter . getInstance ( ) . acquireUrlByKind ( "website." + FRContext . getLocale ( ) , ProductConstants . WEBSITE_URL ) ) ;
BoxCenterAligmentPane emailLabel = getEmailActionLabel ( SiteCenter . getInstance ( ) . acquireUrlByKind ( "support.email" , ProductConstants . SUPPORT_EMAIL ) ) ;
contentPane . add ( actionLabel ) ;
contentPane . add ( emailLabel ) ;
// 官网
JPanel urlActionPane = getURLActionPane ( Inter . getLocText ( "FR-Designer_Official_Website" ) , SiteCenter . getInstance ( ) . acquireUrlByKind ( "website." + FRContext . getLocale ( ) , ProductConstants . WEBSITE_URL ) ) ;
// 支持邮箱
String defaultEmail = SiteCenter . getInstance ( ) . acquireUrlByKind ( "support.email" , ProductConstants . SUPPORT_EMAIL ) ;
JPanel emailPane = getEmailActionPane ( Inter . getLocText ( "FR-Designer_Support_Email" ) , SiteCenter . getInstance ( ) . acquireUrlByKind ( "support.email." + FRContext . getLocale ( ) , defaultEmail ) ) ;
contentPane . add ( urlActionPane ) ;
contentPane . add ( emailPane ) ;
if ( shouldShowThanks ( ) ) {
addThankPane ( contentPane ) ;
}
}
// 是否显示服务电话和 qq
private boolean shouldShowPhoneAndQQ ( ) {
return ! FRContext . getLocale ( ) . equals ( Locale . US ) ;
private void addPhoneAndQQPane ( JPanel contentPane ) {
BoxCenterAligmentPane boxCenterAlignmentPane ;
// 英文版不显示服务电话和QQ
if ( FRContext . getLocale ( ) . equals ( Locale . US ) ) {
return ;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane ( Inter . getLocText ( "FR-Designer_Service_Phone" ) + SiteCenter . getInstance ( ) . acquireUrlByKind ( "service.phone." + FRContext . getLocale ( ) , ProductConstants . COMPARE_TELEPHONE ) ) ;
contentPane . add ( boxCenterAlignmentPane ) ;
// 繁体版不显示QQ
if ( FRContext . getLocale ( ) . equals ( Locale . TAIWAN ) ) {
return ;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane ( "QQ: " + SiteCenter . getInstance ( ) . acquireUrlByKind ( "help.qq" ) ) ;
contentPane . add ( boxCenterAlignmentPane ) ;
}
// 是否显示鸣谢面板
private boolean shouldShowThanks ( ) {
Locale [ ] hideLocales = { Locale . US , Locale . KOREA , Locale . JAPAN } ;
@ -132,7 +140,7 @@ public class AboutPane extends JPanel {
StringUtils . BLANK , ProductConstants . RELEASE_VERSION , BUILD_PREFIX ) ;
}
private BoxCenterAligmentPane getEmailActionLabel ( final String mailTo ) {
private JPanel getEmailActionPane ( final String desc , final String mailTo ) {
ActionLabel emailLabel = new ActionLabel ( mailTo ) ;
emailLabel . addActionListener ( new ActionListener ( ) {
@ -146,11 +154,14 @@ public class AboutPane extends JPanel {
}
} ) ;
return new BoxCenterAligmentPane ( emailLabel ) ;
JPanel panel = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
panel . add ( new UILabel ( desc ) ) ;
panel . add ( emailLabel ) ;
return panel ;
}
private BoxCenterAligmentPane getURLActionLabel ( final String url ) {
ActionLabel actionLabel = new ActionLabel ( url ) ;
private JPanel getURLActionPane ( final String desc , final String url ) {
ActionLabel actionLabel = new ActionLabel ( url ) ;
actionLabel . addActionListener ( new ActionListener ( ) {
@Override
public void actionPerformed ( ActionEvent e ) {
@ -161,8 +172,12 @@ public class AboutPane extends JPanel {
}
}
} ) ;
return new BoxCenterAligmentPane ( actionLabel ) ;
JPanel panel = FRGUIPaneFactory . createNormalFlowInnerContainer_S_Pane ( ) ;
panel . add ( new UILabel ( desc ) ) ;
panel . add ( actionLabel ) ;
return panel ;
}
class UserLabel extends BoldFontTextLabel {