Browse Source

Merge pull request #1218 in BA/design from ~VITO/design:release/9.0 to release/9.0

* commit '4218141c70f3e1566d9ac810f809c7ba9145051d':
  漏了
  REPORT-4483 0909设计器加回鸣谢和关于
master
superman 7 years ago
parent
commit
36a2a1c3b1
  1. 32
      designer/src/com/fr/design/mainframe/bbs/BBSConstants.java
  2. 24
      designer/src/com/fr/design/mainframe/bbs/BBSGuestPane.java
  3. 12
      designer/src/com/fr/design/mainframe/bbs/bbs.properties
  4. 35
      designer/src/com/fr/start/ReportSplashPane.java
  5. 4
      designer_base/src/com/fr/design/actions/help/AboutPane.java
  6. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  7. 3
      designer_base/src/com/fr/start/BaseDesigner.java

32
designer/src/com/fr/design/mainframe/bbs/BBSConstants.java

@ -4,13 +4,13 @@
package com.fr.design.mainframe.bbs; package com.fr.design.mainframe.bbs;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.util.Properties; import java.util.Properties;
/** /**
* @author neil * @author neil
*
* @date: 2015-3-10-上午9:50:13 * @date: 2015-3-10-上午9:50:13
*/ */
public class BBSConstants { public class BBSConstants {
@ -20,25 +20,35 @@ public class BBSConstants {
private static final String GUEST_KEY = "USER"; private static final String GUEST_KEY = "USER";
private static final String GUEST_KEY_ONLINE = "guest.user";
private static final String LINK_KEY = "LINK"; private static final String LINK_KEY = "LINK";
private static final int GUEST_NUM = 5; private static final String LINK_KEY_ONLINE = "guest.link";
//用户名信息数组
public static final String[] ALL_GUEST = loadAllGuestsInfo(GUEST_KEY);
//用户论坛链接信息
public static final String[] ALL_LINK = loadAllGuestsInfo(LINK_KEY);
private static Properties PROP = null; private static Properties PROP = null;
public static String[] getAllGuest() {
return loadAllGuestsInfoOnline(GUEST_KEY_ONLINE, loadAllGuestsInfo(GUEST_KEY));
}
public static String[] getAllLink() {
return loadAllGuestsInfoOnline(LINK_KEY_ONLINE, loadAllGuestsInfo(LINK_KEY));
}
//加载所有用户的信息, 用户名, 论坛连接 //加载所有用户的信息, 用户名, 论坛连接
private static String[] loadAllGuestsInfo(String key){ private static String loadAllGuestsInfo(String key) {
String[] allGuests = new String[GUEST_NUM]; return loadAttribute(key, StringUtils.EMPTY);
for (int i = 0; i < GUEST_NUM; i++) {
allGuests[i] = loadAttribute(key + i, StringUtils.EMPTY);
} }
//加载所有用户的信息, 用户名, 论坛连接
private static String[] loadAllGuestsInfoOnline(String key, String defaultValue) {
String[] allGuests = new String[0];
String guest = SiteCenter.getInstance().acquireUrlByKind(key, defaultValue);
if (StringUtils.isNotEmpty(guest)) {
allGuests = guest.split("\\|");
}
return allGuests; return allGuests;
} }
//如果要定制, 直接改bbs.properties就行了 //如果要定制, 直接改bbs.properties就行了
private static String loadAttribute(String key, String defaultValue) { private static String loadAttribute(String key, String defaultValue) {
if (PROP == null) { if (PROP == null) {

24
designer/src/com/fr/design/mainframe/bbs/BBSGuestPane.java

@ -3,15 +3,6 @@
*/ */
package com.fr.design.mainframe.bbs; package com.fr.design.mainframe.bbs;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URI;
import javax.swing.JPanel;
import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -21,6 +12,12 @@ import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.start.BBSGuestPaneProvider; import com.fr.start.BBSGuestPaneProvider;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URI;
/** /**
* @author neil * @author neil
* *
@ -54,9 +51,12 @@ public class BBSGuestPane extends JPanel implements BBSGuestPaneProvider{
double[] colSize = {p}; double[] colSize = {p};
Component[][] components = new Component[rowSize.length][colSize.length]; Component[][] components = new Component[rowSize.length][colSize.length];
for (int i = 0; i < components.length; i++) { String[] allGuest = BBSConstants.getAllGuest();
String userName = BBSConstants.ALL_GUEST[i]; String[] allLink = BBSConstants.getAllLink();
String url = BBSConstants.ALL_LINK[i]; 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); components[i][0] = getURLActionLabel(userName, url);
} }

12
designer/src/com/fr/design/mainframe/bbs/bbs.properties

@ -4,16 +4,8 @@ COLLECT_URL=http://www.finereporthelp.com:8081/bbs/ReportServer?op=bbs&cmd=colle
DEFAULT_URL=http\://bbs.finereport.com/home.php?mod=space&do=notice DEFAULT_URL=http\://bbs.finereport.com/home.php?mod=space&do=notice
GET_MESSAGE_URL=http://feedback.finedevelop.com:3000/bbs/message/count GET_MESSAGE_URL=http://feedback.finedevelop.com:3000/bbs/message/count
GET_SIGN_INFO_URL=http\://bbs.finereport.com GET_SIGN_INFO_URL=http\://bbs.finereport.com
LINK0=http\://bbs.finereport.com/space-uid-55823.html LLINK= 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
LINK1=http\://bbs.finereport.com/space-uid-56940.html
LINK2=http\://bbs.finereport.com/space-uid-51621.html
LINK3=http\://bbs.finereport.com/space-uid-52618.html
LINK4=http\://bbs.finereport.com/space-uid-48993.html
SHARE_URL=http\://bbs.finereport.com SHARE_URL=http\://bbs.finereport.com
USER0=\u6590\u6CE2\u90A3\u5951(\u5B59\u70B3\u6DA6) UUSER=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
USER1=deafire(\u674E\u5FD7\u4F1F)
USER2=\u963F\u8FEA(\u8C22\u8FEA)
USER3=bingjie(\u5F20\u8BB0\u82B1)
USER4=\u6D77\u7EF5\u5B9D\u5B9D(\u90DD\u6B63)
VERIFY_URL=http://www.finereporthelp.com:8081/bbs/ReportServer?op=bbs&cmd=verify 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 UPDATE_INFO_URL=http://bbs.finereport.com/source/plugin/infor/infor.html

35
designer/src/com/fr/start/ReportSplashPane.java

@ -8,6 +8,7 @@ import com.fr.base.FRContext;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.general.ModuleContext; import com.fr.general.ModuleContext;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper; import com.fr.stable.CoreGraphHelper;
@ -27,14 +28,11 @@ import java.util.TimerTask;
/** /**
* @author neil * @author neil
*
* @date: 2015-3-13-上午9:47:58 * @date: 2015-3-13-上午9:47:58
*/ */
public class ReportSplashPane extends SplashPane { public class ReportSplashPane extends SplashPane {
private static final String OEM_PATH = "/com/fr/base/images/oem"; private static final String OEM_PATH = "/com/fr/base/images/oem";
private static final String SPLASH_CN = "splash_chinese.png";
private static final String SPLASH_EN = "splash_english.png";
private static final String SPLASH_MAC_CN = "splash_chinese_mac.png"; private static final String SPLASH_MAC_CN = "splash_chinese_mac.png";
private static final String SPLASH_MAC_EN = "splash_english_mac.png"; private static final String SPLASH_MAC_EN = "splash_english_mac.png";
@ -55,6 +53,10 @@ public class ReportSplashPane extends SplashPane{
private java.util.Timer timer = new java.util.Timer(); private java.util.Timer timer = new java.util.Timer();
public ReportSplashPane() { public ReportSplashPane() {
init();
}
private void init() {
this.setBackground(null); this.setBackground(null);
timer.schedule(new TimerTask() { timer.schedule(new TimerTask() {
@ -65,10 +67,7 @@ public class ReportSplashPane extends SplashPane{
} }
}, 0, 300); }, 0, 300);
ModuleContext.registerModuleListener(moduleListener); ModuleListener moduleListener = new ModuleAdapter() {
}
private ModuleListener moduleListener = new ModuleAdapter() {
@Override @Override
public void onStartBefore(String moduleName, String moduleI18nName) { public void onStartBefore(String moduleName, String moduleI18nName) {
moduleID = moduleI18nName; moduleID = moduleI18nName;
@ -77,6 +76,8 @@ public class ReportSplashPane extends SplashPane{
ReportSplashPane.this.repaint(); ReportSplashPane.this.repaint();
} }
}; };
ModuleContext.registerModuleListener(moduleListener);
}
protected void paintComponent(Graphics g) { protected void paintComponent(Graphics g) {
super.paintComponent(g); super.paintComponent(g);
@ -119,6 +120,13 @@ public class ReportSplashPane extends SplashPane{
//加载模块信息 //加载模块信息
double y = MODULE_INFO_Y + height + leading + ascent; double y = MODULE_INFO_Y + height + leading + ascent;
GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, y); GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, y);
//每次随机感谢一位论坛用户
if (shouldShowThanks()) {
splashG2d.setPaint(THANK_COLOR);
String content = Inter.getLocText("FR-Designer_Thanks-To") + GUEST;
GraphHelper.drawString(splashG2d, content, THANK_INFO_X, y);
}
} }
// 是否显示鸣谢文字 // 是否显示鸣谢文字
@ -133,13 +141,16 @@ public class ReportSplashPane extends SplashPane{
} }
private static String getRandomUser() { private static String getRandomUser() {
int num = new Random().nextInt(BBSConstants.ALL_GUEST.length); String[] allGuest = BBSConstants.getAllGuest();
return StringUtils.BLANK + BBSConstants.ALL_GUEST[num]; if (allGuest.length == 0) {
return StringUtils.EMPTY;
}
int num = new Random().nextInt(allGuest.length);
return StringUtils.BLANK + allGuest[num];
} }
/** /**
* 窗口关闭后取消定时获取模块信息的timer * 窗口关闭后取消定时获取模块信息的timer
*
*/ */
public void releaseTimer() { public void releaseTimer() {
timer.cancel(); timer.cancel();
@ -149,7 +160,6 @@ public class ReportSplashPane extends SplashPane{
* 创建启动画面的背景图片 * 创建启动画面的背景图片
* *
* @return 背景图片 * @return 背景图片
*
*/ */
public Image createSplashBackground() { public Image createSplashBackground() {
String fileName = getImageName(); String fileName = getImageName();
@ -162,7 +172,4 @@ public class ReportSplashPane extends SplashPane{
//jdk1.8下透明有bug, 设置了setWindowTransparent后, JFrame直接最小化了, 先用mac下的加载图片 //jdk1.8下透明有bug, 设置了setWindowTransparent后, JFrame直接最小化了, 先用mac下的加载图片
return isChina ? SPLASH_MAC_CN : SPLASH_MAC_EN; return isChina ? SPLASH_MAC_CN : SPLASH_MAC_EN;
} }
} }

4
designer_base/src/com/fr/design/actions/help/AboutPane.java

@ -82,12 +82,16 @@ public class AboutPane extends JPanel {
contentPane.add(actionLabel); contentPane.add(actionLabel);
contentPane.add(emailLabel); contentPane.add(emailLabel);
if (shouldShowThanks()) {
addThankPane(contentPane);
}
} }
// 是否显示服务电话和 qq // 是否显示服务电话和 qq
private boolean shouldShowPhoneAndQQ() { private boolean shouldShowPhoneAndQQ() {
return !FRContext.getLocale().equals(Locale.US); return !FRContext.getLocale().equals(Locale.US);
} }
// 是否显示鸣谢面板 // 是否显示鸣谢面板
private boolean shouldShowThanks() { private boolean shouldShowThanks() {
Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN}; Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN};

2
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -183,7 +183,7 @@ FR-Designer_Support_QQ=\u6280\u672FQQ
FR-Designer_Swatch=\u6837\u54C1 FR-Designer_Swatch=\u6837\u54C1
FR-Designer_Tab_title=tab\u6807\u9898 FR-Designer_Tab_title=tab\u6807\u9898
FR-Designer_TableData=\u6570\u636E\u96C6 FR-Designer_TableData=\u6570\u636E\u96C6
FR-Designer_Thank_guest=\u7279\u522B\u9E23\u8C22\u4EE5\u4E0B\u8BBA\u575B\u5E06\u85AF\u5BF9\u8BE5\u7248\u672C\u8BBE\u8BA1\u5668\u6613\u7528\u6027\u505A\u51FA\u7684\u7A81\u51FA\u8D21\u732E FR-Designer_Thank_guest=\u7279\u522B\u9E23\u8C22\u4EE5\u4E0B\u756A\u85AF\u5BF9\u5E06\u8F6F\u4EA7\u54C1\u3001\u6587\u5316\u3001\u751F\u6001\u5EFA\u8BBE\u505A\u51FA\u7684\u7A81\u51FA\u8D21\u732E
FR-Designer_Thanks-To=\u9E23\u8C22 FR-Designer_Thanks-To=\u9E23\u8C22
FR-Designer_Title=\u6807\u9898 FR-Designer_Title=\u6807\u9898
FR-Designer_Total=\u603B\u5171 FR-Designer_Total=\u603B\u5171

3
designer_base/src/com/fr/start/BaseDesigner.java

@ -27,6 +27,7 @@ import com.fr.general.FRLogger;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.ModuleContext; import com.fr.general.ModuleContext;
import com.fr.general.SiteCenter;
import com.fr.plugin.PluginCollector; import com.fr.plugin.PluginCollector;
import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.PluginStartup; import com.fr.plugin.manage.PluginStartup;
@ -64,6 +65,8 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
} }
RestartHelper.deleteRecordFilesWhenStart(); RestartHelper.deleteRecordFilesWhenStart();
SiteCenter.getInstance();
DesignUtils.setPort(getStartPort()); DesignUtils.setPort(getStartPort());
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
if (DesignUtils.isStarted()) { if (DesignUtils.isStarted()) {

Loading…
Cancel
Save