-
Notifications
You must be signed in to change notification settings - Fork 0
/
Button.java
69 lines (67 loc) · 1.39 KB
/
Button.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
67
68
69
import java.awt.Image;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
class Button implements java.io.Serializable{
int x;
int y;
int width;
int height;
String text;
public BufferedImage icon = null;
public static BufferedImage anotherPlanet;
boolean accessible = false;
public static void initializeButtons(){
}
public Button(int x, int y, int w, int h){
this.x = x;
this.y = y;
width = w;
height = h;
}
public Button(int x, int y, int w, int h, String s){
this.x = x;
this.y = y;
width = w;
height = h;
text = s;
}
public boolean isAccessible(){
return accessible;
}
public void setAccessible(boolean it){
accessible = it;
}
public boolean isClicked(int pointX, int pointY){
return helpful.pointInRect(x, y-height, width, height, pointX, pointY);
}
public String getText(){
return text;
}
public void setText(String s){
text = s;
}
public int getX(){
return x;
}
public int getY(){
return y;
}
public int getWidth(){
return width;
}
public int getHeight(){
return height;
}
public void setX(int nx){
x = nx;
}
public void setY(int ny){
y = ny;
}
public void setWidth(int nw){
width = nw;
}
public void setHeight(int nh){
height = nh;
}
}