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

31
LINES

< > BotCompany Repo | #1006114 // What is it? [collect comments on images, WORKS]

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

Libraryless. Click here for Pure Java version (8998L/61K/204K).

1  
!759
2  
3  
concept UserComment {
4  
  BWImage image;
5  
  S imageMD5;
6  
  S comment;
7  
}
8  
9  
static L<GrabbedImage> images;
10  
11  
p {
12  
  conceptsAndBot();
13  
  
14  
  images = getGrabbedImages();
15  
  showTheForm();
16  
}
17  
18  
// show random image and let user comment on it
19  
svoid showTheForm {
20  
  final GrabbedImage gi = random(images);
21  
  if (gi == null) messageBox("No images grabbed! Run #1005951");
22  
  
23  
  UserComment uc = findConcept(UserComment, imageMD5 := gi.md5);
24  
  final JTextField tf = jTextField(uc == null ? "" : uc.comment);
25  
  showForm("Image", new ImageSurface(gi.image.getBufferedImage()),
26  
    "What is it?", tf, r {
27  
      cset(uniq(UserComment, imageMD5 := gi.md5),
28  
        image := gi.image, comment := trim(tf.getText()));
29  
      showTheForm();
30  
    });
31  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006114
Snippet name: What is it? [collect comments on images, WORKS]
Eternal ID of this version: #1006114/1
Text MD5: b4c8e717b33651044afe98a8019f5ff8
Transpilation MD5: d33242e714a761796af9325053b30d56
Author: stefan
Category: javax / gui
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-19 23:39:51
Source code size: 757 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 406 / 503
Referenced in: [show references]