Skip to content

Commit e46b3c4

Browse files
committed
Playback scrollback bg color and consolidate usage of OpenBCI_Blue
1 parent 70f61c3 commit e46b3c4

9 files changed

Lines changed: 53 additions & 33 deletions

OpenBCI_GUI/ADS1299SettingsController.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class ADS1299SettingsController {
102102
if (isVisible) {
103103
//Control button space above channels
104104
pushStyle();
105-
//stroke(31,69,110, 50);
105+
//stroke(OPENBCI_BLUE_ALPHA50);
106106
stroke(OBJECT_BORDER_GREY);
107107
fill(GREY_100);
108108
rect(x, y - columnLabelH, w, columnLabelH);

OpenBCI_GUI/Containers.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public class Container {
210210
//stroke(255, 0, 0);
211211
//rect(x0, y0, w0, h0);
212212

213-
fill(31, 69, 110, 100);
213+
fill(OPENBCI_BLUE_ALPHA100);
214214
noStroke();
215215
rect(x, y, w, h);
216216

OpenBCI_GUI/ControlPanel.pde

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ class SessionDataBox {
13391339
.setOpen(false)
13401340
.setColor(settings.dropdownColors)
13411341
.setOutlineColor(150)
1342-
//.setColorBackground(color(31,69,110)) // text field bg color
1342+
//.setColorBackground(OPENBCI_BLUE) // text field bg color
13431343
.setColorValueLabel(OPENBCI_DARKBLUE) // text color
13441344
//.setColorCaptionLabel(color(255))
13451345
//.setColorForeground(color(125)) // border color when not selected
@@ -1987,7 +1987,7 @@ class RecentPlaybackBox {
19871987
void createRecentPlaybackFilesDropdown(String name, List<String> _items){
19881988
recentPlaybackSL = rpb_cp5.addScrollableList(name)
19891989
.setOpen(false)
1990-
.setColorBackground(color(31,69,110)) // text field bg color
1990+
.setColorBackground(OPENBCI_BLUE) // text field bg color
19911991
.setColorValueLabel(color(255)) // text color
19921992
.setColorCaptionLabel(color(255))
19931993
.setColorForeground(color(125)) // border color when not selected
@@ -2132,7 +2132,7 @@ class GaleaBox {
21322132
private ScrollableList createDropdown(String name, GaleaSettingsEnum[] enumValues){
21332133
ScrollableList list = localCP5.addScrollableList(name)
21342134
.setOpen(false)
2135-
.setColorBackground(color(31,69,110)) // text field bg color
2135+
.setColorBackground(OPENBCI_BLUE) // text field bg color
21362136
.setColorValueLabel(color(255)) // text color
21372137
.setColorCaptionLabel(color(255))
21382138
.setColorForeground(color(125)) // border color when not selected
@@ -2598,7 +2598,7 @@ class StreamingBoardBox {
25982598
private ScrollableList createDropdown(String name, BrainFlowStreaming_Boards[] enumValues){
25992599
ScrollableList list = localCP5.addScrollableList(name)
26002600
.setOpen(false)
2601-
.setColorBackground(color(31,69,110)) // text field bg color
2601+
.setColorBackground(OPENBCI_BLUE) // text field bg color
26022602
.setColorValueLabel(color(255)) // text color
26032603
.setColorCaptionLabel(color(255))
26042604
.setColorForeground(color(125)) // border color when not selected

OpenBCI_GUI/CustomCp5Classes.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ class ButtonHelpText{
115115
//if on left side of screen, draw box brightness to prevent box off screen
116116
if(x <= width/2){
117117
rect(x, y, 200, 2*padding + numLines*lineSpacing + 4);
118-
fill(31,69,110, masterOpacity); //text colof
118+
fill(31,69,110, masterOpacity); //text color
119119
text(myText, x + padding, y + padding, 180, (numLines*lineSpacing + 4));
120120
} else{ //if on right side of screen, draw box left to prevent box off screen
121121
rect(x - 200, y, 200, 2*padding + numLines*lineSpacing + 4);
122-
fill(31,69,110); //text colof
122+
fill(OPENBCI_BLUE); //text color
123123
text(myText, x + padding - 200, y + padding, 180, (numLines*lineSpacing + 4));
124124
}
125125
popStyle();

OpenBCI_GUI/Debugging.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class HelpWidget {
9595
} else if (colorScheme == COLOR_SCHEME_ALTERNATIVE_A){
9696
// draw background of widget
9797
stroke(OPENBCI_DARKBLUE);
98-
fill(31,69,110);
98+
fill(OPENBCI_BLUE);
9999
rect(-1, height-h, width+2, h);
100100
noStroke();
101101

OpenBCI_GUI/OpenBCI_GUI.pde

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,15 @@ final color WHITE = color(255);
231231
final color BLACK = color(0);
232232
final color OPENBCI_DARKBLUE = color(1, 18, 41);
233233
final color OPENBCI_BLUE = color(31, 69, 110);
234+
final color OPENBCI_BLUE_ALPHA50 = color(31, 69, 110, 50);
235+
final color OPENBCI_BLUE_ALPHA100 = color(31, 69, 110, 100);
234236
final color boxColor = color(200);
235237
final color boxStrokeColor = OPENBCI_DARKBLUE;
236238
final color isSelected_color = color(184, 220, 105); //Used for textfield borders,
237239
final color colorNotPressed = WHITE;
238240
final color buttonsLightBlue = color(57,128,204);
241+
final color GREY_235 = color(235);
242+
final color GREY_200 = color(200);
239243
final color GREY_125 = color(125);
240244
final color GREY_100 = color(100);
241245
final color GREY_20 = color(20);

OpenBCI_GUI/W_AnalogRead.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class AnalogReadBar{
393393
pushStyle();
394394

395395
//draw plot
396-
stroke(31,69,110, 50);
396+
stroke(OPENBCI_BLUE_ALPHA50);
397397
fill(color(125,30,12,30));
398398

399399
rect(x + 36 + 4, y, w - 36 - 4, h);

OpenBCI_GUI/W_Networking.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ class W_Networking extends Widget {
600600
ScrollableList scrollList = cp5_networking_dropdowns.addScrollableList(name)
601601
.setOpen(false)
602602
.setOutlineColor(OPENBCI_DARKBLUE)
603-
.setColorBackground(color(31,69,110)) // text field bg color
603+
.setColorBackground(OPENBCI_BLUE) // text field bg color
604604
.setColorValueLabel(color(255)) // text color
605605
.setColorCaptionLabel(color(255))
606606
.setColorForeground(color(125)) // border color when not selected
@@ -637,7 +637,7 @@ class W_Networking extends Widget {
637637
ScrollableList scrollList = cp5_networking_baudRate.addScrollableList(name)
638638
.setOpen(false)
639639
.setOutlineColor(OPENBCI_DARKBLUE)
640-
.setColorBackground(color(31,69,110)) // text field bg color
640+
.setColorBackground(OPENBCI_BLUE) // text field bg color
641641
.setColorValueLabel(color(255)) // text color
642642
.setColorCaptionLabel(color(255))
643643
.setColorForeground(color(125)) // border color when not selected
@@ -675,7 +675,7 @@ class W_Networking extends Widget {
675675
ScrollableList scrollList = cp5_networking_portName.addScrollableList(name)
676676
.setOpen(false)
677677
.setOutlineColor(OPENBCI_DARKBLUE)
678-
.setColorBackground(color(31,69,110)) // text field bg color
678+
.setColorBackground(OPENBCI_BLUE) // text field bg color
679679
.setColorValueLabel(color(255)) // text color
680680
.setColorCaptionLabel(color(255))
681681
.setColorForeground(color(125)) // border color when not selected

OpenBCI_GUI/W_TimeSeries.pde

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class W_timeSeries extends Widget {
155155
plotBottomWell = 45.0; //this appears to be an arbitrary vertical space adds GPlot leaves at bottom, I derived it through trial and error
156156
ts_padding = 10.0;
157157
ts_x = xF + ts_padding;
158-
ts_y = yF + (ts_padding);
158+
ts_y = yF + ts_padding;
159159
ts_w = wF - ts_padding*2;
160160
ts_h = hF - playbackWidgetHeight - plotBottomWell - (ts_padding*2);
161161
numChannelBars = nchan; //set number of channel bars = to current nchan of system (4, 8, or 16)
@@ -171,8 +171,12 @@ class W_timeSeries extends Widget {
171171
pb_y = ts_y + ts_h + playbackWidgetHeight + (ts_padding * 3);
172172
pb_w = ts_w - ts_padding*4;
173173
pb_h = playbackWidgetHeight/2;
174+
int _x = floor(xF) - 1;
175+
int _y = int(ts_y + ts_h + playbackWidgetHeight + 5);
176+
int _w = int(wF) + 1;
177+
int _h = int(playbackWidgetHeight);
174178
//Make a new scrollbar
175-
scrollbar = new PlaybackScrollbar(int(pb_x), int(pb_y), int(pb_w), int(pb_h));
179+
scrollbar = new PlaybackScrollbar(_x, _y, _w, _h, int(pb_x), int(pb_y), int(pb_w), int(pb_h));
176180
} else {
177181
int td_h = 18;
178182
timeDisplay = new TimeDisplay(int(ts_x), int(ts_y + hF - td_h), int(ts_w), td_h);
@@ -263,11 +267,6 @@ class W_timeSeries extends Widget {
263267

264268
//Display playback scrollbar, timeDisplay, or ADSSettingsController depending on data source
265269
if ((currentBoard instanceof FileBoard) && hasScrollbar) { //you will only ever see the playback widget in Playback Mode ... otherwise not visible
266-
pushStyle();
267-
fill(GREY_20);
268-
stroke(31,69,110);
269-
rect(xF, ts_y + ts_h + playbackWidgetHeight + 5, wF, playbackWidgetHeight);
270-
popStyle();
271270
scrollbar.draw();
272271
} else if (currentBoard instanceof ADS1299SettingsBoard) {
273272
//Hide time display when ADSSettingsController is open for compatible boards
@@ -301,11 +300,15 @@ class W_timeSeries extends Widget {
301300

302301
////Resize the playback slider if using playback mode, or resize timeDisplay div at the bottom of timeSeries
303302
if((currentBoard instanceof FileBoard) && hasScrollbar) {
303+
int _x = floor(xF) - 1;
304+
int _y = int(ts_y + ts_h + playbackWidgetHeight + 5);
305+
int _w = int(wF) + 1;
306+
int _h = int(playbackWidgetHeight);
304307
pb_x = ts_x - ts_padding/2;
305308
pb_y = ts_y + ts_h + playbackWidgetHeight + (ts_padding*3);
306309
pb_w = ts_w - ts_padding*4;
307310
pb_h = playbackWidgetHeight/2;
308-
scrollbar.screenResized(pb_x, pb_y, pb_w, pb_h);
311+
scrollbar.screenResized(_x, _y, _w, _h, pb_x, pb_y, pb_w, pb_h);
309312
} else {
310313
int td_h = 18;
311314
timeDisplay.screenResized(int(ts_x), int(ts_y + hF - td_h), int(ts_w), td_h);
@@ -529,7 +532,7 @@ class ChannelBar {
529532
plot.getXAxis().setAxisLabelText("Time (s)");
530533
plot.getXAxis().getAxisLabel().setOffset(plotBottomWellH/2 + 5f);
531534
}
532-
// plot.setBgColor(color(31,69,110));
535+
// plot.setBgColor(OPENBCI_BLUE);
533536

534537
//Fill the GPlot with initial data
535538
nPoints = nPointsBasedOnDataSource();
@@ -647,7 +650,7 @@ class ChannelBar {
647650

648651
//draw channel holder background
649652
pushStyle();
650-
stroke(31,69,110, 50);
653+
stroke(OPENBCI_BLUE_ALPHA50);
651654
noFill();
652655
rect(x,y,w,h);
653656
popStyle();
@@ -862,6 +865,7 @@ class ChannelBar {
862865
//========================== PLAYBACKSLIDER ==========================
863866
class PlaybackScrollbar {
864867
private final float ps_Padding = 50.0; //used to make room for skip to start button
868+
private int x, y, w, h;
865869
private int swidth, sheight; // width and height of bar
866870
private float xpos, ypos; // x and y position of bar
867871
private float spos; // x position of slider
@@ -879,7 +883,11 @@ class PlaybackScrollbar {
879883
private final DateFormat currentTimeFormatLong = new SimpleDateFormat("HH:mm:ss");
880884
private final DateFormat timeStampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
881885

882-
PlaybackScrollbar (float xp, float yp, int sw, int sh) {
886+
PlaybackScrollbar (int _x, int _y, int _w, int _h, float xp, float yp, int sw, int sh) {
887+
x = _x;
888+
y = _y;
889+
w = _w;
890+
h = _h;
883891
swidth = sw;
884892
sheight = sh;
885893
//float widthtoheight = sw - sh;
@@ -902,7 +910,7 @@ class PlaybackScrollbar {
902910
}
903911

904912
private void createSkipToStartButton(String name, String text, int _x, int _y, int _w, int _h) {
905-
skipToStartButton = createButton(pbsb_cp5, name, text, _x, _y, _w, _h, 0, p5, 12, color(235), OPENBCI_DARKBLUE, BUTTON_HOVER, BUTTON_PRESSED, (Integer)null, 0);
913+
skipToStartButton = createButton(pbsb_cp5, name, text, _x, _y, _w, _h, 0, p5, 12, GREY_235, OPENBCI_DARKBLUE, BUTTON_HOVER, BUTTON_PRESSED, (Integer)null, 0);
906914
PImage defaultImage = loadImage("skipToStart_default-30x26.png");
907915
skipToStartButton.setImage(defaultImage);
908916
skipToStartButton.setForceDrawBackground(true);
@@ -1019,9 +1027,13 @@ class PlaybackScrollbar {
10191027
void draw() {
10201028
pushStyle();
10211029

1030+
fill(GREY_235);
1031+
stroke(OPENBCI_BLUE);
1032+
rect(x, y, w, h);
1033+
10221034
//draw the playback slider inside the playback sub-widget
10231035
noStroke();
1024-
fill(204);
1036+
fill(GREY_200);
10251037
rect(xpos, ypos, swidth, sheight);
10261038

10271039
//select color for playback indicator
@@ -1046,11 +1058,15 @@ class PlaybackScrollbar {
10461058
pbsb_cp5.draw();
10471059
}
10481060

1049-
void screenResized(float _x, float _y, float _w, float _h) {
1050-
swidth = int(_w);
1051-
sheight = int(_h);
1052-
xpos = _x + ps_Padding; //add lots of padding for use
1053-
ypos = _y - sheight/2;
1061+
void screenResized(int _x, int _y, int _w, int _h, float _pbx, float _pby, float _pbw, float _pbh) {
1062+
x = _x;
1063+
y = _y;
1064+
w = _w;
1065+
h = _h;
1066+
swidth = int(_pbw);
1067+
sheight = int(_pbh);
1068+
xpos = _pbx + ps_Padding; //add lots of padding for use
1069+
ypos = _pby - sheight/2;
10541070
sposMin = xpos;
10551071
sposMax = xpos + swidth - sheight/2;
10561072
//update the position of the playback indicator us
@@ -1059,8 +1075,8 @@ class PlaybackScrollbar {
10591075
pbsb_cp5.setGraphics(ourApplet, 0, 0);
10601076

10611077
skipToStartButton.setPosition(
1062-
int(_x) + int(skipToStart_diameter*.5),
1063-
int(_y) - int(skipToStart_diameter*.5)
1078+
int(_pbx) + int(skipToStart_diameter*.5),
1079+
int(_pby) - int(skipToStart_diameter*.5)
10641080
);
10651081
}
10661082

0 commit comments

Comments
 (0)