From 675523e91b3fad67d4ed2456c2c95026379dbc8d Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 25 Jun 2019 20:28:59 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-16346=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/DesignerLaunchStatus.java | 9 +++- .../toolbar/UpdateActionManager.java | 2 +- .../fr/start/module/DesignerActivator.java | 53 ------------------- .../fr/start/module/PreStartActivator.java | 31 ----------- 4 files changed, 8 insertions(+), 87 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java b/designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java index d62a84f78..9b7919933 100644 --- a/designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java +++ b/designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java @@ -19,7 +19,12 @@ public enum DesignerLaunchStatus implements Event { /** * 设计器模块启动完成 */ - DESIGNER_INIT_COMPLETE; + DESIGNER_INIT_COMPLETE, + + /** + * 启动完成 + */ + OPEN_LAST_FILE_COMPLETE; private static DesignerLaunchStatus status; @@ -29,6 +34,6 @@ public enum DesignerLaunchStatus implements Event { public static void setStatus(DesignerLaunchStatus state) { status = state; - EventDispatcher.fire(DesignerLaunchStatus.getStatus()); + EventDispatcher.asyncFire(DesignerLaunchStatus.getStatus()); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java index 8f4a4f3d8..7f6ec1eb7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java @@ -116,7 +116,7 @@ public class UpdateActionManager { } isRegisterIndexSearchTextTask = true; // 没有缓存或者缓存失效的时候,等待设计器启动之后开始索引任务 - EventDispatcher.listen(DesignerLaunchStatus.DESIGNER_INIT_COMPLETE, new Listener() { + EventDispatcher.listen(DesignerLaunchStatus.OPEN_LAST_FILE_COMPLETE, new Listener() { @Override public void on(Event event, Null param) { // 使用单线程索引 diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 9ab53f1b0..ebfb8ef09 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -5,7 +5,6 @@ import com.fr.base.Formula; import com.fr.base.MultiFieldParameter; import com.fr.base.process.ProcessOperator; import com.fr.chart.chartattr.ChartCollection; -import com.fr.concurrent.NamedThreadFactory; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.NewFormAction; import com.fr.design.actions.core.ActionFactory; @@ -22,7 +21,6 @@ import com.fr.design.actions.insert.flot.FormulaFloatAction; import com.fr.design.actions.insert.flot.ImageFloatAction; import com.fr.design.actions.insert.flot.TextBoxFloatAction; import com.fr.design.bridge.DesignToolbarProvider; -import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.form.parameter.FormParaDesigner; import com.fr.design.fun.ElementUIProvider; import com.fr.design.gui.controlpane.NameObjectCreator; @@ -35,9 +33,6 @@ import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.mainframe.BaseJForm; -import com.fr.design.mainframe.CellElementPropertyPane; -import com.fr.design.mainframe.DesignerFrameFileDealerPane; -import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCaseThumbnail; import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.InformationCollector; @@ -51,7 +46,6 @@ import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormElementCaseDesigner; import com.fr.design.mainframe.form.FormReportComponentComposite; import com.fr.design.mainframe.loghandler.DesignerLogAppender; -import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.mainframe.socketio.DesignerSocketIO; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.FormParameterReader; @@ -59,7 +53,6 @@ import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; import com.fr.form.stable.ElementCaseThumbnailProcessor; -import com.fr.form.ui.WidgetInfoConfig; import com.fr.general.xml.GeneralXMLTools; import com.fr.js.EmailJavaScript; import com.fr.js.JavaScriptImpl; @@ -105,8 +98,6 @@ import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; /** * Created by juhaoyu on 2018/1/31. @@ -126,7 +117,6 @@ public class DesignerActivator extends Activator { } } designerModuleStart(); - preLoadPane(); loadLogAppender(); DesignerSocketIO.update(); UserInfoPane.getInstance().updateBBSUserInfo(); @@ -169,49 +159,6 @@ public class DesignerActivator extends Activator { InformationCollector.getInstance().collectStartTime(); } - private static void preLoadPane() { - ExecutorService service = Executors.newCachedThreadPool(new NamedThreadFactory("PreLoadPane")); - service.submit(new Runnable() { - @Override - public void run() { - LogMessageBar.getInstance(); - } - }); - - service.submit(new Runnable() { - @Override - public void run() { - HistoryTemplateListPane.getInstance(); - } - }); - service.submit(new Runnable() { - @Override - public void run() { - WidgetInfoConfig.getInstance(); - } - }); - service.submit(new Runnable() { - @Override - public void run() { - CellElementPropertyPane.getInstance(); - } - }); - service.submit(new Runnable() { - @Override - public void run() { - DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane - } - }); - - service.submit(new Runnable() { - @Override - public void run() { - EastRegionContainerPane.getInstance(); - } - }); - service.shutdown(); - } - private static Class[] actionsForInsertCellElement() { List> classes = new ArrayList<>(); Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); diff --git a/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java b/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java index 3a9f59140..630f96b20 100644 --- a/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java @@ -1,11 +1,9 @@ package com.fr.start.module; -import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.fun.OemProcessor; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.template.info.TemplateInfoCollector; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignerPort; import com.fr.event.EventDispatcher; @@ -24,11 +22,8 @@ import com.fr.start.SplashContext; import com.fr.start.SplashStrategy; import com.fr.start.fx.SplashFx; import com.fr.start.jni.SplashMac; -import com.fr.start.preload.ImagePreLoader; import java.io.File; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; /** * Created by juhaoyu on 2018/1/8. @@ -52,8 +47,6 @@ public class PreStartActivator extends Activator { RestartHelper.deleteRecordFilesWhenStart(); - preloadResource(); - SplashContext.getInstance().registerSplash(createSplash()); SplashContext.getInstance().show(); @@ -115,30 +108,6 @@ public class PreStartActivator extends Activator { return new String[]{".cpt", ".xls", ".xlsx", ".frm", ".form", ".cht", ".chart"}; } - private static void preloadResource() { - - ExecutorService service = Executors.newCachedThreadPool(new NamedThreadFactory("PreLoadResource")); - - service.submit(new Runnable() { - - @Override - public void run() { - - new ImagePreLoader(); - } - }); - - service.submit(new Runnable() { - - @Override - public void run() { - - TemplateInfoCollector.getInstance(); - } - }); - service.shutdown(); - } - private SplashStrategy createSplash() { OemProcessor oemProcessor = OemHandler.findOem();