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

24
LINES

< > BotCompany Repo | #1019913 // imageSurfaceOnMouseMoveOrDrag_double - higher precision

JavaX fragment (include)

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

Author comment

Began life as a copy of #1019911

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019913
Snippet name: imageSurfaceOnMouseMoveOrDrag_double - higher precision
Eternal ID of this version: #1019913/3
Text MD5: c1323624e02daa5f17afd28f206ab9b7
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-30 22:11:00
Source code size: 748 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 281 / 314
Version history: 2 change(s)
Referenced in: [show references]