Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~neil/design into release/10.0

bugfix/10.0
neil 6 years ago
parent
commit
dbfe628741
  1. 1
      designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java
  2. 34
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSConstants.java
  3. 2
      designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java
  4. 41
      designer-realize/src/main/java/com/fr/start/SplashContext.java
  5. 2
      designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java

1
designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java

@ -142,6 +142,7 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
} }
}); });
dialog.pack();
dialog.setModal(true); dialog.setModal(true);
dialog.setVisible(true); dialog.setVisible(true);
} }

34
designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSConstants.java

@ -26,29 +26,51 @@ public class BBSConstants {
private static Properties PROP = null; private static Properties PROP = null;
/**
* 获取所有的感谢对象无法获取在线使用默认
* @return 感谢对象的数组
*/
public static String[] getAllGuest() { public static String[] getAllGuest() {
return loadAllGuestsInfoOnline(GUEST_KEY_ONLINE, loadAllGuestsInfo(GUEST_KEY)); return loadAllGuestsInfoOnline(GUEST_KEY_ONLINE, loadAllGuestsInfo(GUEST_KEY));
} }
/**
* 获取所有的链接无法获取在线使用默认
* @return 链接的数组
*/
public static String[] getAllLink() { public static String[] getAllLink() {
return loadAllGuestsInfoOnline(LINK_KEY_ONLINE, loadAllGuestsInfo(LINK_KEY)); return loadAllGuestsInfoOnline(LINK_KEY_ONLINE, loadAllGuestsInfo(LINK_KEY));
} }
//加载所有用户的信息, 用户名, 论坛连接 /**
* 获取所有的感谢对象手动选择策略
* @return 感谢对象的数组
*/
public static String[] getAllGuestManual(boolean isOnline) {
String guest;
if (isOnline) {
guest = CloudCenter.getInstance().acquireUrlByKind(GUEST_KEY_ONLINE, StringUtils.EMPTY);
} else {
guest = loadAllGuestsInfo(GUEST_KEY);
}
if (StringUtils.isNotEmpty(guest)) {
return guest.split("\\|");
}
return new String[0];
}
private static String loadAllGuestsInfo(String key) { private static String loadAllGuestsInfo(String key) {
return loadAttribute(key, StringUtils.EMPTY); return loadAttribute(key, StringUtils.EMPTY);
} }
//加载所有用户的信息, 用户名, 论坛连接
private static String[] loadAllGuestsInfoOnline(String key, String defaultValue) { private static String[] loadAllGuestsInfoOnline(String key, String defaultValue) {
String[] allGuests = new String[0];
String guest = CloudCenter.getInstance().acquireUrlByKind(key, defaultValue); String guest = CloudCenter.getInstance().acquireUrlByKind(key, defaultValue);
if (StringUtils.isNotEmpty(guest)) { if (StringUtils.isNotEmpty(guest)) {
allGuests = guest.split("\\|"); return guest.split("\\|");
} }
return allGuests; return new String[0];
} }
//如果要定制, 直接改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) {

2
designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java

@ -129,7 +129,7 @@ public class ReportWebWidgetConstants {
BaseUtils.readIcon("/com/fr/web/images/appendRow.png"), AppendColumnRow.class); BaseUtils.readIcon("/com/fr/web/images/appendRow.png"), AppendColumnRow.class);
public static final WidgetOption DELETECOLUMNROW = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Delete_Record"), public static final WidgetOption DELETECOLUMNROW = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Delete_Record"),
BaseUtils.readIcon("/com/fr/web/images/deleteRow.png"), DeleteColumnRow.class); BaseUtils.readIcon("/com/fr/web/images/deleteRow.png"), DeleteColumnRow.class);
public static final WidgetOption VERIFY = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"), BaseUtils.readIcon("/com/fr/web/images/verify.gif"), public static final WidgetOption VERIFY = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"), BaseUtils.readIcon("/com/fr/web/images/verify.png"),
Verify.class); Verify.class);
public static final WidgetOption SUBMITFORCIBLY = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Submit_Forcibly"), public static final WidgetOption SUBMITFORCIBLY = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Submit_Forcibly"),
BaseUtils.readIcon("/com/fr/web/images/save2.png"), SubmitForcibly.class); BaseUtils.readIcon("/com/fr/web/images/save2.png"), SubmitForcibly.class);

41
designer-realize/src/main/java/com/fr/start/SplashContext.java

@ -24,6 +24,7 @@ public class SplashContext {
public static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif"; public static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif";
public static final String SPLASH_CACHE_NAME = "splash_10.gif"; public static final String SPLASH_CACHE_NAME = "splash_10.gif";
private static final int FETCH_ONLINE_MAX_TIMES = 10;
private static final SplashContext SPLASH_CONTEXT = new SplashContext(); private static final SplashContext SPLASH_CONTEXT = new SplashContext();
@ -33,7 +34,8 @@ public class SplashContext {
private int loadingIndex = 0; private int loadingIndex = 0;
private String[] loading = new String[]{"..", "....", "......"}; private String[] loading = new String[]{"..", "....", "......"};
private static final String GUEST = getRandomUser(); private int fetchOnlineTimes = 0;
private String guest = StringUtils.EMPTY;
private ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); private ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
@ -81,6 +83,7 @@ public class SplashContext {
scheduler.scheduleAtFixedRate(new Runnable() { scheduler.scheduleAtFixedRate(new Runnable() {
@Override @Override
public void run() { public void run() {
showThanks();
loadingIndex++; loadingIndex++;
updateModuleLog(moduleID.isEmpty() ? StringUtils.EMPTY : moduleID + loading[loadingIndex % 3]); updateModuleLog(moduleID.isEmpty() ? StringUtils.EMPTY : moduleID + loading[loadingIndex % 3]);
} }
@ -90,7 +93,6 @@ public class SplashContext {
@Override @Override
public void on(Event event, String i18n) { public void on(Event event, String i18n) {
showThanks();
moduleID = i18n; moduleID = i18n;
loadingIndex++; loadingIndex++;
updateModuleLog(moduleID.isEmpty() ? StringUtils.EMPTY : moduleID + loading[loadingIndex % 3]); updateModuleLog(moduleID.isEmpty() ? StringUtils.EMPTY : moduleID + loading[loadingIndex % 3]);
@ -110,21 +112,42 @@ public class SplashContext {
/** /**
* 获取随机感谢人员 * 获取随机感谢人员
*/ */
private static String getRandomUser() { private String getRandomUser(String[] allGuest) {
String[] allGuest = BBSConstants.getAllGuest();
if (allGuest.length == 0) {
return StringUtils.EMPTY;
}
int num = new Random().nextInt(allGuest.length); int num = new Random().nextInt(allGuest.length);
return StringUtils.BLANK + allGuest[num]; return StringUtils.BLANK + allGuest[num];
} }
/** /**
* 展示感谢信息 * 尝试获取在线资源达到尝试上限之后使用默认值
*/
private void tryFetchOnline() {
if (StringUtils.isNotEmpty(guest)) {
return;
}
String[] allGuest;
if (fetchOnlineTimes < FETCH_ONLINE_MAX_TIMES) {
allGuest = BBSConstants.getAllGuestManual(true);
if (allGuest.length == 0) {
fetchOnlineTimes++;
return;
}
} else {
allGuest = BBSConstants.getAllGuestManual(false);
}
guest = getRandomUser(allGuest);
}
/**
* 展示感谢信息这里场景是优先使用在线名单
* 甚至可以因此可以延迟几秒显示目前是尝试
* 获取10次在线资源最大时间3秒
*/ */
private void showThanks() { private void showThanks() {
if (shouldShowThanks()) { if (shouldShowThanks()) {
updateThanksLog(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Thanks_To") + GUEST); tryFetchOnline();
if (StringUtils.isNotEmpty(guest)) {
updateThanksLog(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Thanks_To") + guest);
}
} }
} }

2
designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java

@ -370,7 +370,7 @@ public class ImagePreLoader {
"com/fr/web/images/scale.png", "com/fr/web/images/scale.png",
"com/fr/web/images/appendRow.png", "com/fr/web/images/appendRow.png",
"com/fr/web/images/deleteRow.png", "com/fr/web/images/deleteRow.png",
"com/fr/web/images/verify.gif", "com/fr/web/images/verify.png",
"com/fr/web/images/save2.png", "com/fr/web/images/save2.png",
"com/fr/design/images/m_file/export.png", "com/fr/design/images/m_file/export.png",
"com/fr/web/images/showValue.png", "com/fr/web/images/showValue.png",

Loading…
Cancel
Save