From 7098c73a883ee7db7dbfdcb05a92a11dbc57f84b Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 13 Mar 2018 14:55:51 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4483=200909=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=8A=A0=E5=9B=9E=E9=B8=A3=E8=B0=A2=E5=92=8C=E5=85=B3=E4=BA=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/bbs/BBSConstants.java | 40 +++++- .../fr/design/mainframe/bbs/BBSGuestPane.java | 132 ++++++++++-------- .../fr/design/mainframe/bbs/bbs.properties | 1 + .../com/fr/design/locale/designer.properties | 1 + .../design/locale/designer_en_US.properties | 1 + .../design/locale/designer_ja_JP.properties | 1 + .../design/locale/designer_ko_KR.properties | 1 + .../design/locale/designer_zh_CN.properties | 1 + .../design/locale/designer_zh_TW.properties | 1 + 9 files changed, 117 insertions(+), 62 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/bbs/BBSConstants.java b/designer/src/com/fr/design/mainframe/bbs/BBSConstants.java index d48ce08324..77c5c2da59 100644 --- a/designer/src/com/fr/design/mainframe/bbs/BBSConstants.java +++ b/designer/src/com/fr/design/mainframe/bbs/BBSConstants.java @@ -23,24 +23,35 @@ public class BBSConstants { private static final String GUEST_KEY_ONLINE = "guest.user"; private static final String LINK_KEY = "LINK"; private static final String LINK_KEY_ONLINE = "guest.link"; + private static final String JOIN_LINK_KEY = "JOIN"; + private static final String JOIN_LINK_KEY_ONLINE = "guest.join"; private static Properties PROP = null; public static String[] getAllGuest() { - return loadAllGuestsInfoOnline(GUEST_KEY_ONLINE, loadAllGuestsInfo(GUEST_KEY)); + return loadArrayOnline(GUEST_KEY_ONLINE, loadAttribute(GUEST_KEY)); } public static String[] getAllLink() { - return loadAllGuestsInfoOnline(LINK_KEY_ONLINE, loadAllGuestsInfo(LINK_KEY)); + return loadArrayOnline(LINK_KEY_ONLINE, loadAttribute(LINK_KEY)); } - //加载所有用户的信息, 用户名, 论坛连接 - private static String loadAllGuestsInfo(String key) { + public static String getHowToJoinLink() { + return loadAttributeOnline(JOIN_LINK_KEY_ONLINE, loadAttribute(JOIN_LINK_KEY)); + } + + private static String loadAttribute(String key) { return loadAttribute(key, StringUtils.EMPTY); } - //加载所有用户的信息, 用户名, 论坛连接 - private static String[] loadAllGuestsInfoOnline(String key, String defaultValue) { + /** + * 在线加载数组形式的键值,值使用|分割 + * + * @param key 键 + * @param defaultValue 默认值 + * @return 值 + */ + private static String[] loadArrayOnline(String key, String defaultValue) { String[] allGuests = new String[0]; String guest = SiteCenter.getInstance().acquireUrlByKind(key, defaultValue); if (StringUtils.isNotEmpty(guest)) { @@ -48,7 +59,22 @@ public class BBSConstants { } return allGuests; } - + + /** + * 在线加载建制 + * + * @param key 键 + * @param defaultValue 默认值 + * @return 值 + */ + private static String loadAttributeOnline(String key, String defaultValue) { + String value = SiteCenter.getInstance().acquireUrlByKind(key, defaultValue); + if (StringUtils.isEmpty(value)) { + return StringUtils.EMPTY; + } + return value; + } + //如果要定制, 直接改bbs.properties就行了 private static String loadAttribute(String key, String defaultValue) { if (PROP == null) { diff --git a/designer/src/com/fr/design/mainframe/bbs/BBSGuestPane.java b/designer/src/com/fr/design/mainframe/bbs/BBSGuestPane.java index 2fe20b9015..21937ef4e1 100644 --- a/designer/src/com/fr/design/mainframe/bbs/BBSGuestPane.java +++ b/designer/src/com/fr/design/mainframe/bbs/BBSGuestPane.java @@ -1,5 +1,5 @@ /** - * + * */ package com.fr.design.mainframe.bbs; @@ -20,61 +20,83 @@ import java.net.URI; /** * @author neil - * * @date: 2015-3-13-下午12:54:45 */ -public class BBSGuestPane extends JPanel implements BBSGuestPaneProvider{ - - /** - * 构造函数 - */ - public BBSGuestPane() { - this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); - initTableContent(); - } - - private void initTableContent(){ - JPanel guestPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - //感谢标签 - JPanel infoPane = initInfoPane(); - guestPane.add(infoPane, BorderLayout.NORTH); - //用户名+超链 - JPanel userPane = initUserPane(); - guestPane.add(userPane, BorderLayout.CENTER); - - this.add(guestPane); - } - - private JPanel initUserPane(){ - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p, p, p}; - double[] colSize = {p}; - - Component[][] components = new Component[rowSize.length][colSize.length]; - String[] allGuest = BBSConstants.getAllGuest(); - String[] allLink = BBSConstants.getAllLink(); - int min = Math.min(allGuest.length, components.length); - for (int i = 0; i < min; i++) { - String userName = allGuest[i]; - String url = allLink[i]; - components[i][0] = getURLActionLabel(userName, url); - } - - return TableLayoutHelper.createTableLayoutPane(components, rowSize, colSize); - } - - private JPanel initInfoPane(){ - JPanel infoPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - UILabel infoNorthLabel = new UILabel(Inter.getLocText("FR-Designer_Thank_guest")); - UILabel centerLabel = new UILabel(StringUtils.BLANK); - infoPane.add(infoNorthLabel, BorderLayout.NORTH); - infoPane.add(centerLabel, BorderLayout.CENTER); - - return infoPane; - } - - private ActionLabel getURLActionLabel(final String text, final String url){ - ActionLabel actionLabel = new ActionLabel(text); +public class BBSGuestPane extends JPanel implements BBSGuestPaneProvider { + + /** + * 构造函数 + */ + public BBSGuestPane() { + this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); + initTableContent(); + } + + private void initTableContent() { + JPanel guestPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + //感谢标签 + JPanel infoPane = initInfoPane(); + guestPane.add(infoPane, BorderLayout.NORTH); + //用户名+超链 + JPanel userPane = initUserPane(); + guestPane.add(userPane, BorderLayout.CENTER); + //如何加入 + JPanel howToJoin = initHowToJoinPane(); + guestPane.add(howToJoin, BorderLayout.SOUTH); + + this.add(guestPane); + } + + private JPanel initUserPane() { + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p, p, p}; + double[] colSize = {p}; + + Component[][] components = new Component[rowSize.length][colSize.length]; + String[] allGuest = BBSConstants.getAllGuest(); + String[] allLink = BBSConstants.getAllLink(); + int min = Math.min(allGuest.length, components.length); + for (int i = 0; i < min; i++) { + String userName = allGuest[i]; + String url = allLink[i]; + JPanel sPane = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); + sPane.add(getURLActionLabel(userName, url)); + components[i][0] = sPane; + } + + return TableLayoutHelper.createTableLayoutPane(components, rowSize, colSize); + } + + private JPanel initInfoPane() { + JPanel infoPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel infoNorthLabel = new UILabel(Inter.getLocText("FR-Designer_Thank_guest")); + UILabel centerLabel = new UILabel(StringUtils.BLANK); + infoPane.add(infoNorthLabel, BorderLayout.NORTH); + infoPane.add(centerLabel, BorderLayout.CENTER); + + return infoPane; + } + + /** + * Border中嵌套Flow布局。Border布局为了空出间隔, + * Flow布局为了下划线不会超过文字长度 + */ + private JPanel initHowToJoinPane() { + // 超链文字 + JPanel infoPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0(); + UILabel infoNorthLabel = getURLActionLabel(Inter.getLocText("FR-Designer_How_To_Join"), BBSConstants.getHowToJoinLink()); + infoPane.add(infoNorthLabel); + // 空白行 + UILabel centerLabel = new UILabel(StringUtils.BLANK); + + JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + borderPane.add(centerLabel, BorderLayout.NORTH); + borderPane.add(infoPane, BorderLayout.CENTER); + return borderPane; + } + + private ActionLabel getURLActionLabel(final String text, final String url) { + ActionLabel actionLabel = new ActionLabel(text); actionLabel.addActionListener(new ActionListener() { @Override @@ -86,7 +108,7 @@ public class BBSGuestPane extends JPanel implements BBSGuestPaneProvider{ } } }); - + return actionLabel; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/bbs/bbs.properties b/designer/src/com/fr/design/mainframe/bbs/bbs.properties index ae39a3ee33..4c6b27236e 100644 --- a/designer/src/com/fr/design/mainframe/bbs/bbs.properties +++ b/designer/src/com/fr/design/mainframe/bbs/bbs.properties @@ -7,5 +7,6 @@ GET_SIGN_INFO_URL=http\://bbs.finereport.com LINK=http\://bbs.fanruan.com/home.php?mod=space&uid=66470&do=profile|http\://bbs.fanruan.com/home.php?mod=space&uid=67190&do=profile|http\://bbs.fanruan.com/home.php?mod=space&uid=65659&do=profile|http\://bbs.fanruan.com/home.php?mod=space&uid=60352&do=profile|http\://bbs.fanruan.com/home.php?mod=space&uid=78157&do=profile SHARE_URL=http\://bbs.finereport.com USER=cherishdqy\uFF08\u9093\u79CB\u4E91\uFF09|yets11\uFF08\u9676\u5B5D\u6587\uFF09|\u661F\u75D5\uFF08\u71D5\u5B8F\u4F1F\uFF09|\u9759\u542C\u7985\u9E23\uFF08\u674E\u51A0\u519B\uFF09|yiyemeiying\uFF08\u5218\u4F73\uFF09 +JOIN=http\://bbs.fanruan.com/thread-72652-1-1.html VERIFY_URL=http://www.finereporthelp.com:8081/bbs/ReportServer?op=bbs&cmd=verify UPDATE_INFO_URL=http://bbs.finereport.com/source/plugin/infor/infor.html diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index aeae242e35..5420c443c9 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2187,3 +2187,4 @@ FR-Designer_Official_Website=Official Website: FR-Designer_Support_Email=Email: FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=Under the absolute canvas block, the chart does not support the setting of self-adaptive FR-Designer_Max_Height_Cannot_Be_Negative=The maximum height cannot be negative +FR-Designer_How_To_Join= diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 8702186aad..814ca58ed7 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2186,3 +2186,4 @@ FR-Designer_Official_Website=Official Website: FR-Designer_Support_Email=Email: FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=Under the absolute canvas block, the chart does not support the setting of self-adaptive FR-Designer_Max_Height_Cannot_Be_Negative=The maximum height cannot be negative +FR-Designer_How_To_Join=Poke me to learn how to join the thank you list diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 265cf79a61..9dbc2882ff 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2184,3 +2184,4 @@ FR-Designer_Official_Website= FR-Designer_Support_Email= FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout= FR-Designer_Max_Height_Cannot_Be_Negative= +FR-Designer_How_To_Join= diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 08967850cc..ab9ebead1a 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2185,3 +2185,4 @@ FR-Designer_Official_Website= FR-Designer_Support_Email= FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout= FR-Designer_Max_Height_Cannot_Be_Negative= +FR-Designer_How_To_Join= diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 445a306635..e69134f580 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2187,3 +2187,4 @@ FR-Designer_Official_Website=\u5B98\u65B9\u7F51\u7AD9\uFF1A FR-Designer_Support_Email=\u652F\u6301\u90AE\u7BB1\uFF1A FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=\u7EDD\u5BF9\u753B\u5E03\u5757\u72B6\u6001\u4E0B\uFF0C\u56FE\u8868\u4E0D\u652F\u6301\u8BBE\u7F6E\u81EA\u9002\u5E94 FR-Designer_Max_Height_Cannot_Be_Negative=\u6700\u5927\u9AD8\u5EA6\u4E0D\u53EF\u4E3A\u8D1F\u503C +FR-Designer_How_To_Join=\u6233\u6211\u4E86\u89E3\u5982\u4F55\u52A0\u5165\u81F4\u8C22\u540D\u5355 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index b6da70f375..e1e3dc1777 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2186,3 +2186,4 @@ FR-Designer_Official_Website=\u5B98\u65B9\u7DB2\u7AD9\uFF1A FR-Designer_Support_Email=\u652F\u6301\u90F5\u7BB1\uFF1A FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=\u7D55\u5C0D\u756B\u5E03\u584A\u72C0\u614B\u4E0B\uFF0C\u5716\u8868\u4E0D\u652F\u6301\u8A2D\u5B9A\u81EA\u6211\u8ABF\u6574 FR-Designer_Max_Height_Cannot_Be_Negative=\u6700\u5927\u9AD8\u5EA6\u4E0D\u53EF\u70BA\u8CA0\u503C +FR-Designer_How_To_Join=\u6233\u6211\u4E86\u89E3\u5982\u4F55\u52A0\u5165\u81F4\u8B1D\u540D\u55AE