Transpiled version (31949L) is out of date.
1 | persistable sclass G22_TestScreenPanel is IHasChangeListeners { |
2 | settableWithChange S script = "rasters"; |
3 | settableWithChange bool animate = true; |
4 | event change; |
5 | |
6 | transient Animation animation; |
7 | transient settable G22Utils g22utils; |
8 | transient ImageSurface isInput; |
9 | transient JGazelleVScriptRunner scriptRunner; |
10 | |
11 | void start { |
12 | scriptRunner = new JGazelleVScriptRunner( |
13 | liveValue_hasChangeListeners(this, S, -> script, x -> script = x)); |
14 | |
15 | isInput = g22utils.stdImageSurface(); |
16 | |
17 | // when test screen is visible, do the animation |
18 | awtEvery(isInput, 1000/20, r stepAnimation); |
19 | } |
20 | |
21 | void stepAnimation { |
22 | if (!animate) ret; |
23 | if (animation == null) { |
24 | animation = new AnimatedLine; |
25 | animation.start(); |
26 | } |
27 | animation.nextFrame(); |
28 | var img = whiteImage(animation.w, animation.h); |
29 | animation.setGraphics(createGraphics(img)); |
30 | animation.paint(); |
31 | isInput?.setImage(img); |
32 | |
33 | var ii = bwIntegralImage_withMeta(img); |
34 | scriptRunner.parseAndRunOn(ii); |
35 | } |
36 | |
37 | visualize { |
38 | if (isInput == null) start(); |
39 | |
40 | ret centerAndSouthWithMargin( |
41 | hsplit( |
42 | northAndCenterWithMargin(centerAndEastWithMargin( |
43 | jlabel("Input"), liveValueCheckBox("Animate", |
44 | liveValue_hasChangeListeners(this, bool.class, -> animate, x -> animate(x)))), |
45 | jscroll_centered_borderless(isInput)), |
46 | |
47 | northAndCenterWithMargin(centerAndEastWithMargin( |
48 | jlabel("Output"), scriptRunner.lblScore), |
49 | scriptRunner.scpScriptResult) |
50 | ), |
51 | |
52 | scriptRunner.scriptInputField() |
53 | ); |
54 | } |
55 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034147 |
Snippet name: | G22_TestScreenPanel [OK] |
Eternal ID of this version: | #1034147/15 |
Text MD5: | 3cbf87b6f39f921be90e9d568f0b3d4b |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-05-26 14:58:08 |
Source code size: | 1668 bytes / 55 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 195 / 384 |
Version history: | 14 change(s) |
Referenced in: | [show references] |