annotate anielskiepuzzle/src/trefle/MouseMotion.java @ 6:542e305f23f4

arkanoid-trix-debian-dir
author prymula <prymula76@outlook.com>
date Wed, 31 Jan 2024 20:40:57 +0100
parents 2787f5e749ae
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
prymula <prymula76@outlook.com>
parents:
diff changeset
1
prymula <prymula76@outlook.com>
parents:
diff changeset
2 package trefle;
prymula <prymula76@outlook.com>
parents:
diff changeset
3
prymula <prymula76@outlook.com>
parents:
diff changeset
4 import java.awt.event.MouseMotionListener;
prymula <prymula76@outlook.com>
parents:
diff changeset
5 import java.awt.event.MouseEvent;
prymula <prymula76@outlook.com>
parents:
diff changeset
6
prymula <prymula76@outlook.com>
parents:
diff changeset
7
prymula <prymula76@outlook.com>
parents:
diff changeset
8 public class MouseMotion implements MouseMotionListener {
prymula <prymula76@outlook.com>
parents:
diff changeset
9 public boolean move = false;
prymula <prymula76@outlook.com>
parents:
diff changeset
10 int x,y;
prymula <prymula76@outlook.com>
parents:
diff changeset
11 // wywoloywana w czasie przeciagania kursora myszy
prymula <prymula76@outlook.com>
parents:
diff changeset
12 public void mouseDragged (MouseEvent e){
prymula <prymula76@outlook.com>
parents:
diff changeset
13 move = true;
prymula <prymula76@outlook.com>
parents:
diff changeset
14 x=e.getX();
prymula <prymula76@outlook.com>
parents:
diff changeset
15 y=e.getY();
prymula <prymula76@outlook.com>
parents:
diff changeset
16 System.out.println("mouse drag");
prymula <prymula76@outlook.com>
parents:
diff changeset
17 }
prymula <prymula76@outlook.com>
parents:
diff changeset
18 // wywolywana w czasie 'normlanego' przesuwania
prymula <prymula76@outlook.com>
parents:
diff changeset
19 public void mouseMoved (MouseEvent e){
prymula <prymula76@outlook.com>
parents:
diff changeset
20 move = false;
prymula <prymula76@outlook.com>
parents:
diff changeset
21 }
prymula <prymula76@outlook.com>
parents:
diff changeset
22 public Coordinate get (){
prymula <prymula76@outlook.com>
parents:
diff changeset
23 return new Coordinate(x,y,true);
prymula <prymula76@outlook.com>
parents:
diff changeset
24 }
prymula <prymula76@outlook.com>
parents:
diff changeset
25 }