-
Notifications
You must be signed in to change notification settings - Fork 1
/
RetroWidget.pde
61 lines (48 loc) · 1.04 KB
/
RetroWidget.pde
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
/*
*/
public abstract class RetroWidget{
// force access from getter so that the appropriate parent
// can be returned.
private RetroWidget parent;
//protected RetroWidget defaultParent;
protected int x, y, w, h;
protected boolean visible = true;
protected boolean debugDraw = false;
public RetroWidget(){
x = y = 0;
w = h = 0;
visible = true;
parent = null;
debugDraw = false;
}
public RetroWidget getParent(){
if(parent != null){
return parent;
}
return new RetroPanel(0, 0, width, height);
}
public void setVisible(boolean v){
visible = v;
}
public boolean getVisible(){
return visible;
}
public void setParent(RetroWidget widget){
parent = widget;
//defaultParent = null;
}
public int getWidth(){
return w;
}
public int getHeight(){
return h;
}
public void setPosition(int x, int y){
this.x = x;
this.y = y;
}
public void setDebug(boolean debugOn){
debugDraw = debugOn;
}
public abstract void draw();
}