Browse Source

REPORT-16346 优化

research/10.0
vito 6 years ago
parent
commit
675523e91b
  1. 9
      designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java
  3. 53
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
  4. 31
      designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java

9
designer-base/src/main/java/com/fr/design/constants/DesignerLaunchStatus.java

@ -19,7 +19,12 @@ public enum DesignerLaunchStatus implements Event<Null> {
/**
* 设计器模块启动完成
*/
DESIGNER_INIT_COMPLETE;
DESIGNER_INIT_COMPLETE,
/**
* 启动完成
*/
OPEN_LAST_FILE_COMPLETE;
private static DesignerLaunchStatus status;
@ -29,6 +34,6 @@ public enum DesignerLaunchStatus implements Event<Null> {
public static void setStatus(DesignerLaunchStatus state) {
status = state;
EventDispatcher.fire(DesignerLaunchStatus.getStatus());
EventDispatcher.asyncFire(DesignerLaunchStatus.getStatus());
}
}

2
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<Null>() {
EventDispatcher.listen(DesignerLaunchStatus.OPEN_LAST_FILE_COMPLETE, new Listener<Null>() {
@Override
public void on(Event event, Null param) {
// 使用单线程索引

53
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<Class<?>> classes = new ArrayList<>();
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);

31
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();

Loading…
Cancel
Save