@@ -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 ==========================
863866class 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