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

30
LINES

< > BotCompany Repo | #1006593 // Manage User's Screenshots

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

Libraryless. Click here for Pure Java version (11158L/79K/275K).

!7

concept UserScreenshot {
  S text;
  new Ref<PNGFile> pngFile;
}

p-substance {
  final SimpleCRUD<UserScreenshot> crud = new SimpleCRUD<UserScreenshot>(UserScreenshot) {
    @Override
    void makeComponents(UserScreenshot c, Map<S, JComponent> map) {
      map.put("image", new ImageChooser(c == null ? null : c.pngFile->loadImage());
      map.put("text", jTextField(getString(c, "text"));
      if (c != null)
        map.put("PNG File", jlabel(absolutePath(c.pngFile->pngFile())));
    }
  
    @Override
    void saveData(UserScreenshot c, Map<S, JComponent> components) {
      super.saveData(c, components);
      cset(c, pngFile := new PNGFile(((ImageChooser) components.get("image")).getImage());
    }
  }.show();
  
  crud.buttons.add(tableDependButton(crud.table, jbutton("Show screenshot", r {
    showFullScreenImageSurface(crud.selectedConcept().pngFile->loadImage())
  })));
  
  hideConsole();
}

Author comment

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: 559 / 1145
Referenced in: [show references]