From 673fa11ca699145c2668b484733d5c937f4b3b94 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Fri, 23 Nov 2018 14:07:13 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-12928=20=E8=AE=BE=E8=AE=A1=E5=99=A8fined?= =?UTF-8?q?b=E9=94=81=E4=BD=8F,=20=E5=8F=AF=E8=83=BD=E6=98=AF=E5=A4=9A?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolbar/UpdateActionManager.java | 24 +++++++----------- .../src/main/java/com/fr/start/Designer.java | 25 ------------------- .../fr/start/module/DesignerActivator.java | 18 ++++++++++++- 3 files changed, 26 insertions(+), 41 deletions(-) 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 dcc053e12..fe3629774 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 @@ -56,21 +56,15 @@ public class UpdateActionManager { } public synchronized void dealWithSearchText(final String paneClass, final UpdateAction updateAction) { - threadPoolExecutor.allowCoreThreadTimeOut(true); - threadPoolExecutor.execute(new Runnable() { - @Override - public void run() { - JPanel panel = null; - try { - panel = (JPanel) StableUtils.classForName(paneClass).newInstance(); - if (panel instanceof LoadingBasicPane) { - panel = ((LoadingBasicPane) panel).getAllComponents(); - } - updateAction.setSearchText(updateAction.getComponentTexts(panel, "_", new StringBuffer(), new StringBuffer(), new StringBuffer())); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + JPanel panel = null; + try { + panel = (JPanel) StableUtils.classForName(paneClass).newInstance(); + if (panel instanceof LoadingBasicPane) { + panel = ((LoadingBasicPane) panel).getAllComponents(); } - }); + updateAction.setSearchText(updateAction.getComponentTexts(panel, "_", new StringBuffer(), new StringBuffer(), new StringBuffer())); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 756cd1262..c9ce8bc06 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -29,7 +29,6 @@ import com.fr.design.mainframe.JWorkBook; import com.fr.design.mainframe.alphafine.component.AlphaFinePane; import com.fr.design.mainframe.bbs.UserInfoLabel; import com.fr.design.mainframe.bbs.UserInfoPane; -import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; @@ -54,7 +53,6 @@ import com.fr.stable.xml.XMLTools; import com.fr.start.fx.SplashFx; import com.fr.start.jni.SplashMac; import com.fr.start.module.StartupArgs; -import com.fr.start.preload.ImagePreLoader; import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; @@ -69,8 +67,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.ArrayList; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; @@ -110,8 +106,6 @@ public class Designer extends BaseDesigner { RestartHelper.deleteRecordFilesWhenStart(); - preloadResource(); - SplashContext.getInstance().registerSplash(createSplash()); SplashContext.getInstance().show(); @@ -131,25 +125,6 @@ public class Designer extends BaseDesigner { } - private static void preloadResource() { - ExecutorService service = Executors.newCachedThreadPool(); - - service.submit(new Runnable() { - @Override - public void run() { - new ImagePreLoader(); - } - }); - - service.submit(new Runnable() { - @Override - public void run() { - TemplateInfoCollector.getInstance(); - } - }); - service.shutdown(); - } - private static SplashStrategy createSplash() { // 这里可以开接口加载自定义启动画面 if (OperatingSystem.isWindows()) { 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 80edec701..2b8e77ac4 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 @@ -52,6 +52,7 @@ 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.mainframe.templateinfo.TemplateInfoCollector; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.FormParameterReader; import com.fr.design.parameter.ParameterPropertyPane; @@ -98,9 +99,10 @@ import com.fr.stable.script.ValueConverter; import com.fr.stable.xml.ObjectTokenizer; import com.fr.stable.xml.ObjectXMLWriterFinder; import com.fr.start.BBSGuestPaneProvider; +import com.fr.start.preload.ImagePreLoader; import com.fr.xml.ReportXMLUtils; -import java.awt.*; +import java.awt.Image; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; @@ -176,6 +178,20 @@ public class DesignerActivator extends Activator { private static void preLoadPane() { ExecutorService service = Executors.newCachedThreadPool(); + service.submit(new Runnable() { + @Override + public void run() { + new ImagePreLoader(); + } + }); + + service.submit(new Runnable() { + @Override + public void run() { + TemplateInfoCollector.getInstance(); + } + }); + service.submit(new Runnable() { @Override public void run() {