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

30
LINES

< > BotCompany Repo | #1033869 // AWTOnConceptChanges - successor of awtOnConceptChanges

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (20642L/126K).

1  
sclass AWTOnConceptChanges is AutoCloseable {
2  
  settable JComponent component;
3  
  settable Runnable action;
4  
  settable Concepts concepts;
5  
  settable int firstDelay;
6  
  settable int delay = 500;
7  
  
8  
  long changes = -1;
9  
  javax.swing.Timer timer;
10  
  
11  
  *(Concepts *concepts, JComponent *component, Runnable *action) {}
12  
  
13  
  void install {
14  
    assertNotNull(concepts);
15  
    
16  
    timer = installTimer(component, delay, firstDelay, r _trigger);
17  
  }
18  
  
19  
  void _trigger {
20  
    long c = concepts.changes;
21  
    if (changes != c) {
22  
      changes = c;
23  
      action?.run();
24  
    }
25  
  }
26  
  
27  
  close {
28  
    dispose timer;
29  
  }
30  
}

Author comment

Began life as a copy of #1005359

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033869
Snippet name: AWTOnConceptChanges - successor of awtOnConceptChanges
Eternal ID of this version: #1033869/9
Text MD5: a71fb75bd825d9d161f77e13fc52f9ef
Transpilation MD5: f4183a544b54384295a9d0a8bc0cc6c8
Author: stefan
Category: javax / concepts / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-08 15:53:35
Source code size: 632 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 177 / 296
Version history: 8 change(s)
Referenced in: [show references]