!7 static S windowTitle = "Gazelle V 2020-10-28 .02"; lib 1400521 // FlatLAF set flag PingV3. static IF0 ping_v3_pingSourceMaker() { ret () -> new PingSource; } sclass Stem { JFrame window; Rect getFrameRect() { ret toRect(getBounds(window)); } } static Stem stem; static GazelleV gazelle; static TrayIcon trayIcon; static JFrame mainWindow; svoid trayIconLeftClick { activateFrame_v2(mainWindow); } svoid makeTrayIcon { pcall-short { trayIcon = installTrayIcon(#1103045, windowTitle, r trayIconLeftClick, "Show Gazelle", r { activateFrame(mainWindow) }, "Exit Gazelle", r cleanExit ); } } p { __javax = x30.class; loadableUtils.utils.__setJavaX(x30.class); vm_generalMap_put(stefansOS := mc()); com.formdev.flatlaf.FlatLightLaf.setup(); makeTrayIcon(); GazelleV gazelle; if (contains(args, "profile")) gazelle = profileToConsole(() -> actualMain(args)); else gazelle = actualMain(args); if (contains(args, "brexit")) System.exit(0); temp gazelle.enter(); gazelle.start(); } static GazelleV actualMain(S... args) { System.out.println(hmsWithColonsAndMS() + ": Init"); //x30.coreInit(); __javax = x30.class; x30.__javax = x30.class; // for hotwire x30_pkg.x30_util.__setJavaX(x30.class); x30.cleanKillMsg = ""; callOnLoadMethods(mc()); printWithMS("new GazelleV"); gazelle = new GazelleV; stem = new Stem; gazelle._host = stem; temp gazelle.enter(); printWithMS("Visualize"); var vis = swing(() -> gazelle.visualize()); vis = makeWindowBorderAndTitle(vis, windowTitle); printWithMS("Show frame"); //stem.window = showMainFrame("Gazella", vis); JFrame frame = makeUndecoratedFrame(windowTitle, vis); stem.window = mainWindow = frame; //stem.window = makeWindow(vis); //stem.window.setSize(500, 500); //centerWindow(stem.window); onWindowClosing(stem.window, r cleanExit); showWindow(stem.window); printWithMS("Dudadoneski"); ret gazelle; } static JComponent makeWindowBorderAndTitle(JComponent contents, S title) { //ret jCenteredSection_fontSizePlus(10, title, vis); var icons = jline(); icons.add(jbutton("Close", r { disposeWindow(icons) })); var titleBar = centerAndEastWithMargin( setOpaqueBackground(awtColor("ADD8E6"), fontSizePlus(7, jCenteredLabel(title))), icons); ret withBorder(createBevelBorder(), northAndCenter(titleBar, contents)); } sO dm_getStem(O moduleOrID) { ret stem; } sO resolveModule(O moduleOrID) { ret moduleOrID == stem ? gazelle : moduleOrID; } svoid cleanExit { System.exit(0); } !include early #1033309 // GazelleV