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)

// f : voidfunc(DoublePt) - point can be null, then mouse has exited
static void imageSurfaceOnMouseMoveOrDrag_double(final ImageSurface is, final O f) {
  swing {
    MouseAdapter ma = new MouseAdapter {
      public void mouseMoved(MouseEvent e) {
        pcallF(f, imageSurface_doublePtFromEvent(is, e));
      }
      
      public void mouseDragged(MouseEvent e) {
        pcallF(f, imageSurface_doublePtFromEvent(is, e));
      }
      
      public void mouseEntered(MouseEvent e) {
        pcallF(f, imageSurface_doublePtFromEvent(is, e));
      }
  
      public void mouseExited(MouseEvent e) {
        pcallF(f, (DoublePt) null);
      }
    };
    is.addMouseMotionListener(ma);
    is.addMouseListener(ma);
  }
}

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: 280 / 313
Version history: 2 change(s)
Referenced in: [show references]