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. 43
      designer/src/com/fr/start/ReportSplashPane.java
  5. 26
      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;
import com.fr.general.IOUtils;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
import java.util.Properties;
/**
* @author neil
*
* @date: 2015-3-10-上午9:50:13
*/
public class BBSConstants {
@ -20,25 +20,35 @@ public class BBSConstants {
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 int GUEST_NUM = 5;
//用户名信息数组
public static final String[] ALL_GUEST = loadAllGuestsInfo(GUEST_KEY);
//用户论坛链接信息
public static final String[] ALL_LINK = loadAllGuestsInfo(LINK_KEY);
private static final String LINK_KEY_ONLINE = "guest.link";
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){
String[] allGuests = new String[GUEST_NUM];
for (int i = 0; i < GUEST_NUM; i++) {
allGuests[i] = loadAttribute(key + i, StringUtils.EMPTY);
private static String loadAllGuestsInfo(String key) {
return loadAttribute(key, 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;
}
//如果要定制, 直接改bbs.properties就行了
private static String loadAttribute(String key, String defaultValue) {
if (PROP == null) {

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

@ -3,15 +3,6 @@
*/
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.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -21,6 +12,12 @@ import com.fr.general.Inter;
import com.fr.stable.StringUtils;
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
*
@ -54,9 +51,12 @@ public class BBSGuestPane extends JPanel implements BBSGuestPaneProvider{
double[] colSize = {p};
Component[][] components = new Component[rowSize.length][colSize.length];
for (int i = 0; i < components.length; i++) {
String userName = BBSConstants.ALL_GUEST[i];
String url = BBSConstants.ALL_LINK[i];
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);
}

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
GET_MESSAGE_URL=http://feedback.finedevelop.com:3000/bbs/message/count
GET_SIGN_INFO_URL=http\://bbs.finereport.com
LINK0=http\://bbs.finereport.com/space-uid-55823.html
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
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
SHARE_URL=http\://bbs.finereport.com
USER0=\u6590\u6CE2\u90A3\u5951(\u5B59\u70B3\u6DA6)
USER1=deafire(\u674E\u5FD7\u4F1F)
USER2=\u963F\u8FEA(\u8C22\u8FEA)
USER3=bingjie(\u5F20\u8BB0\u82B1)
USER4=\u6D77\u7EF5\u5B9D\u5B9D(\u90DD\u6B63)
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
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

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

@ -8,6 +8,7 @@ import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.general.ModuleContext;
import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper;
@ -27,14 +28,11 @@ import java.util.TimerTask;
/**
* @author neil
*
* @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 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_EN = "splash_english_mac.png";
@ -55,6 +53,10 @@ public class ReportSplashPane extends SplashPane{
private java.util.Timer timer = new java.util.Timer();
public ReportSplashPane() {
init();
}
private void init() {
this.setBackground(null);
timer.schedule(new TimerTask() {
@ -65,10 +67,7 @@ public class ReportSplashPane extends SplashPane{
}
}, 0, 300);
ModuleContext.registerModuleListener(moduleListener);
}
private ModuleListener moduleListener = new ModuleAdapter() {
ModuleListener moduleListener = new ModuleAdapter() {
@Override
public void onStartBefore(String moduleName, String moduleI18nName) {
moduleID = moduleI18nName;
@ -77,6 +76,8 @@ public class ReportSplashPane extends SplashPane{
ReportSplashPane.this.repaint();
}
};
ModuleContext.registerModuleListener(moduleListener);
}
protected void paintComponent(Graphics g) {
super.paintComponent(g);
@ -105,7 +106,7 @@ public class ReportSplashPane extends SplashPane{
return splashBuffedImage;
}
private void paintShowText(Graphics2D splashG2d){
private void paintShowText(Graphics2D splashG2d) {
FontRenderContext fontRenderContext = splashG2d.getFontRenderContext();
LineMetrics fm = splashG2d.getFont().getLineMetrics("",
fontRenderContext);
@ -119,6 +120,13 @@ public class ReportSplashPane extends SplashPane{
//加载模块信息
double y = MODULE_INFO_Y + height + leading + ascent;
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);
}
}
// 是否显示鸣谢文字
@ -132,14 +140,17 @@ public class ReportSplashPane extends SplashPane{
return true;
}
private static String getRandomUser(){
int num = new Random().nextInt(BBSConstants.ALL_GUEST.length);
return StringUtils.BLANK + BBSConstants.ALL_GUEST[num];
private static String getRandomUser() {
String[] allGuest = BBSConstants.getAllGuest();
if (allGuest.length == 0) {
return StringUtils.EMPTY;
}
int num = new Random().nextInt(allGuest.length);
return StringUtils.BLANK + allGuest[num];
}
/**
* 窗口关闭后取消定时获取模块信息的timer
*
*/
public void releaseTimer() {
timer.cancel();
@ -149,7 +160,6 @@ public class ReportSplashPane extends SplashPane{
* 创建启动画面的背景图片
*
* @return 背景图片
*
*/
public Image createSplashBackground() {
String fileName = getImageName();
@ -157,12 +167,9 @@ public class ReportSplashPane extends SplashPane{
}
//获取图片文件名
private String getImageName(){
private String getImageName() {
boolean isChina = GeneralContext.isChineseEnv();
//jdk1.8下透明有bug, 设置了setWindowTransparent后, JFrame直接最小化了, 先用mac下的加载图片
return isChina ? SPLASH_MAC_CN : SPLASH_MAC_EN;
}
}

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

@ -39,10 +39,10 @@ public class AboutPane extends JPanel {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
//center panel
JPanel centerPane=FRGUIPaneFactory.createBorderLayout_L_Pane();
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(centerPane, BorderLayout.CENTER);
JPanel contentPane=FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
centerPane.add(contentPane, BorderLayout.NORTH);
BoxCenterAlignmentCopyablePane buildCopyPane = new BoxCenterAlignmentCopyablePane(
@ -68,8 +68,8 @@ public class AboutPane extends JPanel {
Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK")
}));
if (shouldShowPhoneAndQQ()){
if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){
if (shouldShowPhoneAndQQ()) {
if (ComparatorUtils.equals(ProductConstants.APP_NAME, FINEREPORT)) {
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE);
contentPane.add(boxCenterAlignmentPane);
}
@ -82,12 +82,16 @@ public class AboutPane extends JPanel {
contentPane.add(actionLabel);
contentPane.add(emailLabel);
if (shouldShowThanks()) {
addThankPane(contentPane);
}
}
// 是否显示服务电话和 qq
private boolean shouldShowPhoneAndQQ() {
return !FRContext.getLocale().equals(Locale.US);
}
// 是否显示鸣谢面板
private boolean shouldShowThanks() {
Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN};
@ -100,9 +104,9 @@ public class AboutPane extends JPanel {
}
//添加鸣谢面板
private void addThankPane(JPanel contentPane){
private void addThankPane(JPanel contentPane) {
BBSGuestPaneProvider pane = StableFactory.getMarkedInstanceObjectFromClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPaneProvider.class);
if(pane == null){
if (pane == null) {
return;
}
@ -110,16 +114,16 @@ public class AboutPane extends JPanel {
contentPane.add((Component) pane);
}
private String append(String...strs){
private String append(String... strs) {
StringBuilder sb = new StringBuilder();
for(String str : strs){
for (String str : strs) {
sb.append(str);
}
return sb.toString();
}
private String getCopyRight(){
private String getCopyRight() {
return append(Inter.getLocText("FR-Designer_About_CopyRight"), COPYRIGHT_LABEL,
ProductConstants.HISTORY, StringUtils.BLANK, SiteCenter.getInstance().acquireUrlByKind("company.name", ProductConstants.COMPANY_NAME));
}
@ -129,7 +133,7 @@ public class AboutPane extends JPanel {
StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX);
}
private BoxCenterAligmentPane getEmailActionLabel(final String mailTo){
private BoxCenterAligmentPane getEmailActionLabel(final String mailTo) {
ActionLabel emailLabel = new ActionLabel(mailTo);
emailLabel.addActionListener(new ActionListener() {
@ -146,7 +150,7 @@ public class AboutPane extends JPanel {
return new BoxCenterAligmentPane(emailLabel);
}
private BoxCenterAligmentPane getURLActionLabel(final String url){
private BoxCenterAligmentPane getURLActionLabel(final String url) {
ActionLabel actionLabel = new ActionLabel(url);
actionLabel.addActionListener(new ActionListener() {
@Override

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

Loading…
Cancel
Save