Go to Post I fear not the drive team who has practiced 10,000 defenses once, but I fear the drive team who has practiced one defense 10,000 times. -Bruce Lee - bEdhEd [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 26-12-2014, 20:18
Asymons Asymons is offline
Registered User
FRC #4716 (Purple Raiders)
Team Role: Driver
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Ontario
Posts: 33
Asymons is an unknown quantity at this point
SmartDashboard - Changing Default Text Color on Smart Dashboard

Hello,

I hope everyone is having a relaxing winter break. I have a small question regarding the smart dashboard, more specifically the text inputted into it. I would like to know, if possible, how to change the text color to support a black background of some sort. I'm relatively new to the Smart Dashboard, being the first year we are implementing it with our robot so I'm unsure if this is a beginner type question or what not; however, I was wondering the possibility of this. Mind you this is not a mandatory issue, as it only serves to be ascetically pleasing in the driver station. The only work around I've found is to input a string of some sort

Code:
 SmartDashboard.putString(" ", " ");
to get that white box background; however if there is a way to change the text, that would be most preferable.

Here's an image to what I am talking about if I'm not making much sense.
(Note the right half of label being covered by a black background)



TL;DR I want to change the default text color of label and the commands.

EDIT: Robot is programmed in Java to clarify.

Last edited by Asymons : 26-12-2014 at 20:27.
  #2   Spotlight this post!  
Unread 27-12-2014, 10:46
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: SmartDashboard - Changing Default Text Color on Smart Dashboard

There is no builtin way to do it AFAIK, but its not hard to write an extension that adds that a new property for color.

An extension is simply a jar file that contains classes that extend from "Widget" and is in an "extensions" directory next to "SmartDashboard.jar". I'll try to write one to show you what I mean.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
  #3   Spotlight this post!  
Unread 27-12-2014, 11:29
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: SmartDashboard - Changing Default Text Color on Smart Dashboard

Ok, here's an example for you to work off of. Its a label with a new property that sets the text color. If you uncomment the commented lines, it allows you to set the background color too. The zip contains the compiled jar and the source code.

I hope this helps. There isn't that much documentation for the internals of the SmartDashboard, but if you look through the source, its not that hard to understand.
Attached Files
File Type: zip ColorLabel.zip (4.8 KB, 44 views)
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
  #4   Spotlight this post!  
Unread 27-12-2014, 12:57
Asymons Asymons is offline
Registered User
FRC #4716 (Purple Raiders)
Team Role: Driver
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Ontario
Posts: 33
Asymons is an unknown quantity at this point
Re: SmartDashboard - Changing Default Text Color on Smart Dashboard

Quote:
Originally Posted by lopsided98 View Post
Ok, here's an example for you to work off of. Its a label with a new property that sets the text color. If you uncomment the commented lines, it allows you to set the background color too. The zip contains the compiled jar and the source code.

I hope this helps. There isn't that much documentation for the internals of the SmartDashboard, but if you look through the source, its not that hard to understand.
Thank you very much!

I'll be sure to look at the code you wrote up and see what you mean. This is a huge help, thank you.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:38.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi