Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

36
LINES

< > BotCompany Repo | #1014645 // Suggester (OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (8285L/56K).

!7

static DynamicVStack stack;
static O module;
static S moduleID;
static java.util.Timer moduleRestarter;

p-subst {
  autoRestart();
  defaultFrameIcon(#1101180);
  stack = dynamicVStack(); // spaces only between components
  showFrame(jscroll(withMargin(5, stack)));
  
  repeat with sleep 1 {
    updateModule();
    L<Pair<S, O>> l = (L) quickImport(callOpt(module, 'suggest));
    if (l != null) {
      stack.clearComponents();
      for (final Pair<S, O> p : l)
        stack.addComponent(jMarginButton(p.a, r-thread {
          appendToMechList_noUniq_inQ("Suggested buttons clicked by user", now() + ": " + p.a);
          callF(p.b);
        }));
    }
  }
}

svoid updateModule {
  S moduleID = first(mL("Best suggester module"));
  if (neq(moduleID, main.moduleID)) {
    if (main.moduleID != null) infoBox("Switching to module " + moduleID);
    stopTimer(moduleRestarter);
    main.moduleID = moduleID;
    moduleRestarter = loadAndAutoRestartModule('module, moduleID);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1014645
Snippet name: Suggester (OK)
Eternal ID of this version: #1014645/18
Text MD5: 7c6d81e72dcf5221570bc92eb7966991
Transpilation MD5: 5aed4919d6d87e3455f859657543e4ba
Author: stefan
Category: javax / a.i. / gui
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-07 12:43:38
Source code size: 1026 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 312 / 7002
Version history: 17 change(s)
Referenced in: [show references]