0
|
1
|
|
2 package trefle;
|
|
3
|
|
4 import java.awt.event.MouseMotionListener;
|
|
5 import java.awt.event.MouseEvent;
|
|
6
|
|
7
|
|
8 public class MouseMotion implements MouseMotionListener {
|
|
9 public boolean move = false;
|
|
10 int x,y;
|
|
11 // wywoloywana w czasie przeciagania kursora myszy
|
|
12 public void mouseDragged (MouseEvent e){
|
|
13 move = true;
|
|
14 x=e.getX();
|
|
15 y=e.getY();
|
|
16 System.out.println("mouse drag");
|
|
17 }
|
|
18 // wywolywana w czasie 'normlanego' przesuwania
|
|
19 public void mouseMoved (MouseEvent e){
|
|
20 move = false;
|
|
21 }
|
|
22 public Coordinate get (){
|
|
23 return new Coordinate(x,y,true);
|
|
24 }
|
|
25 }
|