Uses 108K of libraries. Click here for Pure Java version (16101L/113K).
1 | !7 |
2 | |
3 | module OnlineChecker > DynImageSurface {
|
4 | volatile transient bool online; |
5 | |
6 | visualize {
|
7 | ret jscroll(jBackground(Color.white, jFullCenter(imageSurface = imageSurface(image)))); |
8 | } |
9 | |
10 | start {
|
11 | preloadImagesNow(#1101405, #1101406); |
12 | setImage(#1101404); |
13 | thread { doEveryAndNow(10000, r actualUpdate); }
|
14 | } |
15 | |
16 | void actualUpdate {
|
17 | temp enter(); |
18 | time "online check" {
|
19 | online = main.areWeOnline(); |
20 | } |
21 | setImage(online ? #1101406 : #1101405); |
22 | S text = online ? "We are online!" : "We are offline..."; |
23 | setToolTip(imageSurface, text); |
24 | S name = online ? "ONLINE" : "OFFLINE"; |
25 | setModuleName(name); |
26 | } |
27 | |
28 | // API |
29 | |
30 | bool areWeOnline() { ret online; }
|
31 | } |
Began life as a copy of #1018978
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1018999 |
| Snippet name: | Internet Detector v2 [detects online status, Dyn Module] |
| Eternal ID of this version: | #1018999/19 |
| Text MD5: | eda39bf2345f20a32f95cbe299281317 |
| Transpilation MD5: | d08d65b084430701515ecd03968ae9a9 |
| Author: | stefan |
| Category: | javax / networking |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-10-20 16:50:49 |
| Source code size: | 734 bytes / 31 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 825 / 1237 |
| Version history: | 18 change(s) |
| Referenced in: | [show references] |