srecord noeq G22ProjectOverviewPanel(G22Utils g22utils) { JSyntaxTextFileEditor storyView; JLabel lblStats; transient SingleComponentPanel scpShowCase; void updateStats { setText(lblStats, "Database core size: " + str_toKB(fileSize(g22utils.concepts().conceptsFile()))); } void updateShowCase() swing { if (!isShowing(scpShowCase)) ret; if (!g22utils.autoStarter().done()) ret; var script = varShowCasedScript()!; scpShowCase.set(jcenteredlabel(str(script))); // TODO } IVarWithNotify varShowCasedScript() { ret g22utils.projectActions().varShowCasedScript(); } cachedVisualize { var conceptsFile = g22utils.concepts().conceptsFile(); lblStats = rightAlignedLabel(); IVF1 fileListener = file -> { if (sameFile(file, conceptsFile)) updateStats(); }; bindToComponent(lblStats, -> { g22utils.onProjectFileChanged(fileListener); updateStats(); }, -> g22utils.removeProjectFileChangedListener(fileListener)); storyView = new JSyntaxTextFileEditor(g22utils.projectStoryTextFile()) .uneditable(true); storyView.adaptSyntaxTextArea = textArea -> g22_adaptSyntaxTextAreaForHashRefs(textArea, g22utils); addInFront(storyView.buttons(), jImageButtonScaledToWidth(16, #1103068, "Edit", rThread { //g22utils.projectActions.editProjectStory(); storyView.uneditable(false); })); g22utils.autoStarter().onDone(l0 updateShowCase); scpShowCase = singleComponentPanel( varShowCasedScript()! == null ? null : jcenteredlabel("Waiting for auto-start to finish...")); onChange(varShowCasedScript(), l0 updateShowCase); bindToComponent(scpShowCase, l0 updateShowCase); // LAYOUT S title = "Project " + quote(g22utils.projectName()) + " Overview"; var showCaseSection = jCenteredSection("Show Cased Script", northAndCenterWithMargin( bindComboBoxToVar(varShowCasedScript(), swing(-> new ConceptsComboBox<>(g22utils.concepts(), G22LeftArrowScript) .allowNull(true) .itemFilter(script -> classIs(G22LeftArrowScript, script) && script.isClearForAutoRun()) )), scpShowCase )); ret withTopAndBottomMargin(jRaisedCenteredSection(title, jvsplit( jhsplit(0.75, jCenteredSection("Project Story", centerAndSouthWithMargin( storyView, centerAndEastWithMargin(lblStats, jFilePathButton(conceptsFile)) )), northAndCenterWithMargin( new G22AutoStartPanel(g22utils), new G22VariablesPanel(g22utils).compactView(false) )), showCaseSection ) // end of jvsplit )); } }