scope stefansOS_loadingAnimation. sbool #fullScreen; sS #text = "Stefan's OS loading"; sS #animationID = #1101325; //#1101279; static JFrame stefansOS_loadingAnimation(Runnable onStop) { ret stefansOS_loadingAnimation(onStop, null); } static JFrame stefansOS_loadingAnimation(final Runnable onStop, LiveValue lvDetails) { if (headless()) null; print("[loading animation]"); final JLabel label = jcenteredlabel(text); final JButton stopButton = jbutton(upper("Press space to stop"), r { disableButton(); //setText(heldInstance(JButton), "Stopping..."); setText(label, "STOPPING"); callF(onStop); }); logMechListAppendLocally("Animations shown", animationID); JComponent anim; { temp tempSetThreadLocal(imageIcon_fixGIF, false); anim = jimage(animationID); } JPanel panel = jBackground(Color.black, centerAndSouth(centerAndSouth( withMargin(50, anim), withMargin(20, 40, 0, 40, setForeground(Color.white, setFont(#1011145, 60, label)))), withMargin(0, 20, 20, 20, northAndCenter( withBottomMargin(30, setForeground(Color.white, jCenteredLiveValueLabel(lvDetails))), jcenteredline(stopButton))))); if (fullScreen) ret showFullScreen(panel); else ret onWindowClosingOnly(showCenterPackedFrame(text, panel), rClickButton(stopButton)); } end scope