-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventoMouse.java
66 lines (54 loc) · 1.43 KB
/
EventoMouse.java
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
60
61
62
63
64
65
66
package prg.esamiPassati.es6;
public class EventoMouse extends Evento{
private int x;
private int y;
private int sxPressione; //pressione tasto sinistro
private int dxPressione; //pressione tasto destro
//costruttori
public EventoMouse(int id, String description, int x, int y, int sxPressione, int dxPressione){
super(id, description);
this.setX(x).setY(y).setSXPressione(sxPressione).setDXPressione(dxPressione);
}
//metodi set
public EventoMouse setX(int x){
this.x = x;
return this;
}
public EventoMouse setY(int y){
this.y = y;
return this;
}
public EventoMouse setSXPressione(int sxPressione){
this.sxPressione = sxPressione;
return this;
}
public EventoMouse setDXPressione(int dxPressione){
this.dxPressione = dxPressione;
return this;
}
@Override
public Evento setDescription(String description){
super.setDescription(description + "(mouse)");
return this;
}
//metodi get
public int getX(){
return this.x;
}
public int getY(){
return this.y;
}
public int getSXPressione(){
return this.sxPressione;
}
public int getDXPressione(){
return this.dxPressione;
}
//toString
public String toString(){
return super.toString() +
"\tPOSIZIONE: (" + this.getX() + ", " + this.getY() +
")\tPRESSIONE TASTO SINISTRO: " + this.getSXPressione() +
"\tPRESSIONE TASTO DESTRO: " + this.getDXPressione();
}
}