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

20
LINES

< > BotCompany Repo | #1005948 // imageSurfaceOnMouseMove

JavaX fragment (include)

1  
// f : voidfunc(Pt) - point can be null, then mouse has exited
2  
static void imageSurfaceOnMouseMove(final ImageSurface is, final O f) {
3  
  swing {
4  
    MouseAdapter ma = new MouseAdapter {
5  
      public void mouseMoved(MouseEvent e) {
6  
        pcallF(f, is.pointFromEvent(e));
7  
      }
8  
      
9  
      public void mouseEntered(MouseEvent e) {
10  
        pcallF(f, is.pointFromEvent(e));
11  
      }
12  
  
13  
      public void mouseExited(MouseEvent e) {
14  
        pcallF(f, (Pt) null);
15  
      }
16  
    };
17  
    is.addMouseMotionListener(ma);
18  
    is.addMouseListener(ma);
19  
  }
20  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005948
Snippet name: imageSurfaceOnMouseMove
Eternal ID of this version: #1005948/2
Text MD5: 345447120ac9f56d17f2df21b6e9a379
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-11 13:43:25
Source code size: 565 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 501 / 521
Version history: 1 change(s)
Referenced in: [show references]