diff anielskiepuzzle/src/trefle/MouseMotion.java @ 0:2787f5e749ae

INIT
author prymula <prymula76@outlook.com>
date Thu, 21 Sep 2023 22:33:57 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/anielskiepuzzle/src/trefle/MouseMotion.java	Thu Sep 21 22:33:57 2023 +0200
@@ -0,0 +1,25 @@
+
+package trefle;
+
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseEvent;
+
+
+public class MouseMotion implements MouseMotionListener {
+    public boolean move = false;
+    int x,y;
+    // wywoloywana w czasie przeciagania kursora myszy
+    public void mouseDragged (MouseEvent e){
+        move = true;
+        x=e.getX();
+        y=e.getY();
+        System.out.println("mouse drag");
+    }
+    // wywolywana w czasie 'normlanego' przesuwania
+    public void mouseMoved (MouseEvent e){
+        move = false;
+    }
+    public Coordinate get (){
+        return new Coordinate(x,y,true);
+    }
+}