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

39
LINES

< > BotCompany Repo | #1018870 // Auto-Google Image [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (9053L/47K).

1  
!7
2  
3  
static BufferedImage googleImageSearch_new(S query) {
4  
  ret googleImageSearch_new2(query);
5  
}
6  
7  
cmodule AutoGoogleImage > DynImageSurface {
8  
  S typingText;
9  
  transient S text;
10  
  bool listen;
11  
  
12  
  start {
13  
    dm_onTopInput_q(voidfunc(S s) {
14  
      if (listen) show(s)
15  
    });
16  
  }
17  
  
18  
  enhanceFrame { minFrameSize(f, 300, 300); }
19  
20  
  visualize {
21  
    ret northCenterSouthWithMargins(dm_bigInputAndSubmit('typingText, "Visualize", rThread { show(typingText) }),
22  
      super.visualize(),
23  
      vstackWithSpacing(
24  
        centeredLiveValueLabel(dm_fieldLiveValue('text)),
25  
        dm_rightAlignedCheckBox('listen)));
26  
  }
27  
  
28  
  // API
29  
  
30  
  void show(S query) q {
31  
    pcall {
32  
      setField(typingText := query);
33  
      BufferedImage img = quickVisualize(query);
34  
      if (img == null) ret;
35  
      setImage(img);
36  
      setField(text := query);
37  
    }
38  
  }
39  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018870
Snippet name: Auto-Google Image [Dyn Module]
Eternal ID of this version: #1018870/34
Text MD5: e12b4019e34f05022cff02a1ec218ae3
Transpilation MD5: 229500e38825bf4618bec0a10ff6c9de
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-10 19:08:39
Source code size: 881 bytes / 39 lines
Pitched / IR pitched: No / No
Views / Downloads: 564 / 4737
Version history: 33 change(s)
Referenced in: [show references]