Libraryless. Click here for Pure Java version (11158L/79K/275K).
1 | !7 |
2 | |
3 | concept UserScreenshot { |
4 | S text; |
5 | new Ref<PNGFile> pngFile; |
6 | } |
7 | |
8 | p-substance { |
9 | final SimpleCRUD<UserScreenshot> crud = new SimpleCRUD<UserScreenshot>(UserScreenshot) { |
10 | @Override |
11 | void makeComponents(UserScreenshot c, Map<S, JComponent> map) { |
12 | map.put("image", new ImageChooser(c == null ? null : c.pngFile->loadImage()); |
13 | map.put("text", jTextField(getString(c, "text")); |
14 | if (c != null) |
15 | map.put("PNG File", jlabel(absolutePath(c.pngFile->pngFile()))); |
16 | } |
17 | |
18 | @Override |
19 | void saveData(UserScreenshot c, Map<S, JComponent> components) { |
20 | super.saveData(c, components); |
21 | cset(c, pngFile := new PNGFile(((ImageChooser) components.get("image")).getImage()); |
22 | } |
23 | }.show(); |
24 | |
25 | crud.buttons.add(tableDependButton(crud.table, jbutton("Show screenshot", r { |
26 | showFullScreenImageSurface(crud.selectedConcept().pngFile->loadImage()) |
27 | }))); |
28 | |
29 | hideConsole(); |
30 | } |
Began life as a copy of #1006589
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: | #1006593 |
Snippet name: | Manage User's Screenshots |
Eternal ID of this version: | #1006593/1 |
Text MD5: | a132f5671bc59c9a548d7b1ed45baaec |
Transpilation MD5: | f1e8355a12901800af9613d652634611 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-01-21 23:01:26 |
Source code size: | 946 bytes / 30 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 561 / 1149 |
Referenced in: | [show references] |