-
Notifications
You must be signed in to change notification settings - Fork 3
/
SpeekerLegend.pde
48 lines (40 loc) · 1.12 KB
/
SpeekerLegend.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
class SpeekerLegend extends DisplayObject
{
/* Properties
___________________________________________________________________ */
private Speeker _speeker;
private int _boxWidth = 40;
private int _boxHeight = 20;
private PFont _font;
private int _textMarginTop = 15;
private int _showOnly = 0;
/* Constructor
___________________________________________________________________ */
SpeekerLegend(Speeker speeker, PFont font)
{
_speeker = speeker;
_font = font;
}
/* Display
___________________________________________________________________ */
void display()
{
if(_showOnly == 0 || _showOnly == _speeker.getId())
{
fill(_speeker.getLegendColor());
}
else
{
fill(_speeker.getLegendColor(), 15);
}
noStroke();
//rect(_xPos, _yPos, _boxWidth, _boxHeight);
textFont(font);
//text(_speeker.getName(), _xPos, _yPos + _boxHeight + _textMarginTop);
text(_speeker.getName(), _xPos, _yPos);
}
void showOnly(int pressedNum)
{
_showOnly = pressedNum;
}
}