From 7ace9cb7ebff3d6f527f5d29fbdbcb63f20744d0 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Mon, 25 Oct 2021 11:49:18 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-60896=20mac=E7=9B=AE=E5=BD=95=E8=92=99?= =?UTF-8?q?=E5=B1=82=E7=BB=93=E6=9D=9F=E5=90=8E=E6=9C=89=E9=81=97=E7=95=99?= =?UTF-8?q?=E9=80=8F=E6=98=8E=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/guide/base/Guide.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/guide/base/Guide.java b/designer-base/src/main/java/com/fr/design/mainframe/guide/base/Guide.java index 9469f931a..c8d3e6801 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/guide/base/Guide.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/guide/base/Guide.java @@ -10,6 +10,8 @@ import com.fr.stable.StringUtils; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; +import java.awt.event.HierarchyEvent; +import java.awt.event.HierarchyListener; public class Guide { private String id; @@ -101,7 +103,7 @@ public class Guide { } GuideManager.getInstance().setCurrentGuide(this); guideView.showLoading(); - + guideView.addHierarchyListener(loadingHierarchyListener); new SwingWorker() { @Override protected Boolean doInBackground() { @@ -135,6 +137,9 @@ public class Guide { public void start() { guideView.hideLoading(); + } + + private void startScene() { if (scene != null) { guideView.setScene(scene); guideView.showGuide(); @@ -161,6 +166,7 @@ public class Guide { if (lifecycle != null) { lifecycle.onTerminate(); } + guideView.removeHierarchyListener(loadingHierarchyListener); end(); } @@ -186,4 +192,12 @@ public class Guide { public void removeGuideLifecycle() { this.lifecycle = null; } + + private HierarchyListener loadingHierarchyListener = new HierarchyListener() { + @Override + public void hierarchyChanged(HierarchyEvent e) { + guideView.removeHierarchyListener(loadingHierarchyListener); + startScene(); + } + }; }