-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSouris.java
More file actions
59 lines (43 loc) · 1.36 KB
/
Souris.java
File metadata and controls
59 lines (43 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package planetsWars;
import javax.media.opengl.*;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;
import com.jogamp.opengl.util.FPSAnimator;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.*;
import java.awt.Robot;
public class Souris implements MouseMotionListener{
GLCanvas canvas;
Scene dessin;
JFrame frame;
Robot robot;
public Souris(){
}
public Souris(JFrame frame, GLCanvas canvas, Scene dessin){
this.canvas=canvas;
this.dessin=dessin;
this.frame=frame;
try {
robot = new Robot();
} catch (Exception e) {
System.err.println(e.getMessage());
}
}
public void mouseClicked (MouseEvent me) {
}
public void mouseEntered (MouseEvent me) {}
public void mousePressed (MouseEvent me) {
}
public void mouseReleased (MouseEvent me) {
}
public void mouseExited (MouseEvent me) {}
public void mouseMoved (MouseEvent me) {
/*dessin.setPhi(frame.getHeight()/2 - (me.getY()+38));
dessin.setTheta(frame.getWidth()/2 - (me.getX()+10));
robot.mouseMove(frame.getX() + frame.getWidth()/2, frame.getY() + frame.getHeight()/2);*/
}
public void mouseDragged (MouseEvent me) {}
}