!7 !include #1001372 // direct nohupJavax static int maxTabsToShow = 11; static MultiMap index = caseInsensitiveMultiMap(); static AutoComboBox cbInput; static JButton btnTeach; p { autoRestart(); magellan(); showCAL_defaultSize(700, 450); thread { downloadTypicalWebs(); updateIndex(); } centerBiggerConsole(); cbInput = replaceConsoleInputWithAutoComboBox(); bot(); consoleInput("Fruit Cake"); addAskButton(); showControls(jcenteredline(btnTeach = jbutton("", r { letUserMakeDiagramWithNode(consoleInput()) }))); onUpdateAndNow(consoleInputField(), r { S s = consoleInput(); setText(btnTeach, "I want to teach" + (empty(s) ? "" : " about " + s)); }); calcOnConceptChangesInOtherProgram(circlesEditorDBID(), 1000, f updateIndex, true); focusInputLater(); sleepIfMain(); } svoid updateIndex { print("Updating index."); index = dwlw_fullNodeIndex_ci(); updateAutoComboBoxItems(cbInput, keys(index)); consoleStatus(n(countDistinct(values(index), 'web), "web")); } answer { s = trim(s); L nodes = index.get(lower(s)); L webs = nodesToWebs_max(nodes, maxTabsToShow); if (nempty(webs)) { setFrameTitle(s, showTabbedWebs(map(func(Web web) { web_dropVisUnlessLoaded(cloneWeb(web)) }, webs))); ret "Found " + n(nodes, "node"); } try answer "No information found - please enter some!"; }