forked from bsondermann/BlackboxSticksExporter3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IFLabel.pde
42 lines (31 loc) · 866 Bytes
/
IFLabel.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
public class IFLabel extends GUIComponent {
private int textSize = 13;
public IFLabel (String argLabel, int argX, int argY) {
this (argLabel, argX, argY, 13);
}
public IFLabel (String newLabel, int newX, int newY, int size) {
setLabel(newLabel);
setPosition(newX, newY);
if (size > 8 && size < 20)
textSize = size;
else
textSize = 13;
}
// ***** SET THE LABEL'S SIZE SO WE CAN GET ITS BOUNDING BOX *****
public boolean canReceiveFocus() {
return false;
}
public void setTextSize(int size) {
if (size > 8 && size < 20)
textSize = size;
else
textSize = 13;
}
public int getTextSize() {
return textSize;
}
public void show () {
controller.parent.fill (lookAndFeel.textColor);
controller.parent.text (getLabel(), getX(), getY() + textSize - 3);
}
}