From 042b9e659f4194096e1e0b9034c0bdcacea468ab Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 19 Sep 2022 16:46:19 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-80511=20=E5=90=AF=E5=A7=8B=E9=A1=B5?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=80=9F=E5=BA=A6=E4=BC=98=E5=8C=96=201-?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=B6=E9=97=B4=E4=B8=8D=E5=87=86=EF=BC=8C?= =?UTF-8?q?=E8=A6=81=E4=BB=8E=E5=A4=B4=E5=BC=80=E5=A7=8B=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=202-=E5=8E=BB=E6=8E=89=E9=A2=84=E7=83=AD=E7=9A=84=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=EF=BC=8C=E5=AF=B9=E7=9B=B4=E6=8E=A5=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E5=AE=A2=E6=88=B7=E4=B8=8D=E5=8F=8B=E5=A5=BD=203-?= =?UTF-8?q?=E4=B8=8D=E5=8E=BB=E6=AF=8F=E6=AC=A1=E9=83=BD=E8=AF=BB=E5=9B=BE?= =?UTF-8?q?=E7=89=87=EF=BC=8C=E5=9C=A8=E7=AD=89=E5=BE=85=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8CIO=20=E9=A2=91=E7=8E=87=E6=9E=81=E9=AB=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/startup/ui/StartupPageWindow.java | 5 +++-- .../src/main/java/com/fr/start/MainDesigner.java | 5 +++-- .../optimized/DesignerStartupPageActivator.java | 16 ++++------------ 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java index cb0442abd8..f15de856e9 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java @@ -74,6 +74,8 @@ public class StartupPageWindow extends JFrame { private static final Dimension SCREEN_SIZE = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); + private static final BufferedImage BACKGROUND_IMAGE = IOUtils.readImage("com/fr/design/startup/startup_page_background.jpg"); + private StartupPageWorkspacePanel workspacePanel; private JPanel recentOpenPanel; @@ -136,8 +138,7 @@ public class StartupPageWindow extends JFrame { @Override protected void paintComponent(Graphics g) { super.paintComponent(g); - BufferedImage image = IOUtils.readImage("com/fr/design/startup/startup_page_background.jpg"); - g.drawImage(image, 0, 0, SCREEN_SIZE.width, SCREEN_SIZE.height, this); + g.drawImage(BACKGROUND_IMAGE, 0, 0, SCREEN_SIZE.width, SCREEN_SIZE.height, this); } }; this.contentPane.setLayout(getCenterLayout(body)); diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 122f5f9183..24c02893bc 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -119,12 +119,13 @@ public class MainDesigner extends BaseDesigner { * @param args 参数 */ public static void main(String[] args) { + StopWatch watch = new StopWatch(); + watch.start(); + DesignerStartupContext.getRecorder().start(); showSplash(); startPreload0(); - StopWatch watch = new StopWatch(); - watch.start(); DesignerLifecycleMonitorContext.getMonitor().beforeStart(); //启动运行时 FineRuntime.start(); diff --git a/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java b/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java index ccae1a19a6..e41dafcc8f 100644 --- a/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java @@ -9,7 +9,6 @@ import com.fr.start.SplashContext; import com.fr.start.common.DesignerStartupContext; import com.fr.start.module.StartupArgs; import com.fr.start.util.DesignerStartupPageUtil; -import com.fr.start.warmup.DesignerPreWarmTask; import com.fr.startup.metric.DesignerMetrics; import com.fr.startup.metric.DesignerStartupModel; import com.fr.startup.ui.StartupPageModel; @@ -63,10 +62,6 @@ public class DesignerStartupPageActivator extends Activator { // 启动页关闭 SplashContext.getInstance().hide(); - // 预热任务启动 - DesignerPreWarmTask warmTask = new DesignerPreWarmTask(); - warmTask.start(); - // 即时暂停 suspendRecorder(context); @@ -79,21 +74,21 @@ public class DesignerStartupPageActivator extends Activator { model.setOpenLastTemplateRunnable(() -> { context.setOpenLastFile(true); handleModel(model); - launchAfterWarmup(warmTask); + launchAfterWarmup(); }); // selectAndOpenEmpty model.setOpenEmptyTemplateRunnable(() -> { context.setOpenEmpty(true); handleModel(model); - launchAfterWarmup(warmTask); + launchAfterWarmup(); }); // selectAndCreateNew model.setCreateNewTemplateRunnable(() -> { context.setCreateNew(true); handleModel(model); - launchAfterWarmup(warmTask); + launchAfterWarmup(); }); StartupPageWindow window = new StartupPageWindow(model); @@ -123,7 +118,7 @@ public class DesignerStartupPageActivator extends Activator { }); } - private void launchAfterWarmup(DesignerPreWarmTask warmTask) { + private void launchAfterWarmup() { StopWatch stopWatch = StopWatch.createStarted(); @@ -133,9 +128,6 @@ public class DesignerStartupPageActivator extends Activator { // 等待中切换 DesignerStartupContext.getInstance().setOnWaiting(false); - warmTask.join(); - - FineLoggerFactory.getLogger().debug("designer-startup-page warm up cost {} ms", stopWatch.getTime(TimeUnit.MILLISECONDS)); DesignerStartupContext.getInstance().setOnStartup(true); DesignerStartupPageUtil.enterWorkspace(); } finally {