Transpiled version (61391L) is out of date.
1 | persistable sclass G22ScreenPartsPanel extends G22CRUDAndDetailPanel<G22ScreenPart> { |
2 | SimpleCRUD_v2<G22ScreenPart> makeCRUD() { |
3 | var crud = new SimpleCRUD_v2<>(g22utils.concepts(), G22ScreenPart); |
4 | crud.entityName = -> "Screen part"; |
5 | crud.addButton("Add all screens", rThread addAllScreens); |
6 | ret crud; |
7 | } |
8 | |
9 | void addAllScreens { |
10 | uniq(g22utils.concepts(), G22ScreenPart, |
11 | name := "All screens", |
12 | bounds := combinedScreenBounds()); |
13 | } |
14 | |
15 | JComponent makeDetailView(G22ScreenPart screenPart) { |
16 | var maxSize = 100; |
17 | |
18 | var full = combinedScreenRect(); |
19 | var rect = screenPart.bounds; |
20 | |
21 | var scale = min(doubleRatio(maxSize, full.w()), doubleRatio(maxSize, full.h())); |
22 | |
23 | var image = whiteImage(iround(scale*full.w()), iround(scale*full.h())); |
24 | |
25 | if (rect != null) { |
26 | var scaled = scaleRect(rect, scale); |
27 | fillRect(image, scaled, java.awt.Color.gray); |
28 | } |
29 | |
30 | image = addBorderToImage(image, java.awt.Color.black, 1); |
31 | |
32 | ret g22utils.stdImageSurface(image); |
33 | } |
34 | |
35 | selfType g22utils(G22Utils g22utils) { super.g22utils(g22utils); this; } |
36 | } |
Began life as a copy of #1035958
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1036104 |
Snippet name: | G22ScreenPartsPanel |
Eternal ID of this version: | #1036104/7 |
Text MD5: | 3d2e0adb1488f23afd4365f1af8709bc |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-09-15 19:21:57 |
Source code size: | 1151 bytes / 36 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 150 / 239 |
Version history: | 6 change(s) |
Referenced in: | [show references] |