Transpiled version (9227L) is out of date.
1 | static <A extends JComponent> A onHover(IVF1<Pt> action, A c) { |
2 | if (c != null && action != null) swing { |
3 | MouseAdapter ma = new MouseAdapter { |
4 | public void mouseMoved(MouseEvent e) { pick(e); } |
5 | public void mouseEntered(MouseEvent e) { pick(e); } |
6 | public void mouseExited(MouseEvent e) { pick(null); } |
7 | |
8 | void pick(MouseEvent e) pcall { |
9 | action.get(ptFromEvent(e)); |
10 | } |
11 | }; |
12 | c.addMouseMotionListener(ma); |
13 | c.addMouseListener(ma); |
14 | } |
15 | ret c; |
16 | } |
17 | |
18 | static <A extends JComponent> A onHover(A c, IVF1<Pt> action) { |
19 | ret onHover(action, c); |
20 | } |
Began life as a copy of #1024565
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1036223 |
Snippet name: | onHover |
Eternal ID of this version: | #1036223/5 |
Text MD5: | 36ffece50d3a51ba70d9677bc319edce |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-10-25 22:18:53 |
Source code size: | 602 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 169 / 210 |
Version history: | 4 change(s) |
Referenced in: | [show references] |