|
|
|
@ -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<Boolean, Void>() { |
|
|
|
|
@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(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|