|
|
|
@ -1,11 +1,13 @@
|
|
|
|
|
package com.fr.start; |
|
|
|
|
|
|
|
|
|
import com.fr.concurrent.NamedThreadFactory; |
|
|
|
|
import com.fr.design.constants.DesignerLaunchStatus; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.mainframe.bbs.BBSConstants; |
|
|
|
|
import com.fr.event.Event; |
|
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
|
import com.fr.event.Listener; |
|
|
|
|
import com.fr.event.Null; |
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
import com.fr.general.locale.image.I18nImage; |
|
|
|
|
import com.fr.module.ModuleEvent; |
|
|
|
@ -28,13 +30,13 @@ public class SplashContext {
|
|
|
|
|
public static final String SPLASH_PATH = getSplashPath(); |
|
|
|
|
public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf("/") + 1); |
|
|
|
|
private static final int FETCH_ONLINE_MAX_TIMES = 50; |
|
|
|
|
private static final String THANKS = Toolkit.i18nText("Fine-Design_Report_Thanks_To"); |
|
|
|
|
private String thanks = StringUtils.EMPTY; |
|
|
|
|
|
|
|
|
|
private static final SplashContext SPLASH_CONTEXT = new SplashContext(); |
|
|
|
|
|
|
|
|
|
private SplashStrategy splashStrategy; |
|
|
|
|
|
|
|
|
|
private String moduleId = Toolkit.i18nText("Fine-Design_Basic_Initializing"); |
|
|
|
|
private String moduleId = StringUtils.EMPTY; |
|
|
|
|
private int loadingIndex = 0; |
|
|
|
|
private String[] loading = new String[]{"..", "....", "......"}; |
|
|
|
|
|
|
|
|
@ -73,7 +75,12 @@ public class SplashContext {
|
|
|
|
|
public void show() { |
|
|
|
|
splashStrategy.show(); |
|
|
|
|
//监听
|
|
|
|
|
initListener(); |
|
|
|
|
EventDispatcher.listen(DesignerLaunchStatus.UI_PRE_INIT_COMPLETE, new Listener<Null>() { |
|
|
|
|
@Override |
|
|
|
|
public void on(Event event, Null param) { |
|
|
|
|
initListener(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -91,6 +98,8 @@ public class SplashContext {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initListener() { |
|
|
|
|
thanks = Toolkit.i18nText("Fine-Design_Report_Thanks_To"); |
|
|
|
|
moduleId = Toolkit.i18nText("Fine-Design_Basic_Initializing"); |
|
|
|
|
scheduler.scheduleAtFixedRate(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
@ -157,7 +166,7 @@ public class SplashContext {
|
|
|
|
|
if (shouldShowThanks() && !hasShowThanks) { |
|
|
|
|
tryFetchOnline(); |
|
|
|
|
if (StringUtils.isNotEmpty(guest)) { |
|
|
|
|
updateThanksLog(THANKS + guest); |
|
|
|
|
updateThanksLog(thanks + guest); |
|
|
|
|
hasShowThanks = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|