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

44
LINES

< > BotCompany Repo | #1007146 // Automatic Image Machine

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

Uses 4489K of libraries. Click here for Pure Java version (7369L/53K/184K).

1  
!7
2  
3  
static JTextField tf;
4  
static SingleComponentPanel scp;
5  
static ImageSurface is;
6  
static Q q;
7  
static volatile bool boss; // boss mode (after pressing Escape)
8  
9  
p-substance-thread {
10  
  final S word = randomEnglishWord();
11  
  swing {
12  
    q = new Q(true);
13  
    showMaximizedFrame("Automatic Image Machine!", northAndCenter(tf = setTextFieldFontSize(jCenteredTextField(word), 20), scp = new SingleComponentPanel));
14  
    // Escape = Boss Key!
15  
    registerEscape(getFrame(tf), r {
16  
      boss = true;
17  
      tf.setText(""); scp.noComponent();
18  
    });
19  
    
20  
    onEnterAndNow(tf, r {
21  
      boss = false;
22  
      awt { tf.selectAll(); }
23  
      final S text = getTextTrim(tf);
24  
      q.add(r {
25  
        if (boss) ret;
26  
        long time = sysNow();
27  
        loading {
28  
          final BufferedImage img = quickVisualize(text);
29  
          if (boss) ret;
30  
          awt {
31  
            JLabel lbl = jcenteredlabel(text);
32  
            lbl.setFont(sansSerifBold(20));
33  
            scp.setComponent(centerAndSouth(
34  
              jscroll_centered(is = new ImageSurface(img)),
35  
              lbl);
36  
            awt { is.zoomToWindow(); }
37  
          }
38  
        }
39  
        sleepUntilSys(time+1000); // min display time
40  
      });
41  
    });
42  
    hideConsole();
43  
  }
44  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007146
Snippet name: Automatic Image Machine
Eternal ID of this version: #1007146/28
Text MD5: 5f5bc29345da29286b7d87e3c997389f
Transpilation MD5: 4914244fc1dd377a3ec0a1b3bb135b7a
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-26 11:17:16
Source code size: 1259 bytes / 44 lines
Pitched / IR pitched: No / No
Views / Downloads: 626 / 756
Version history: 27 change(s)
Referenced in: [show references]