Go to Post The closest and strongest friendships that I have formed, however, have come from the FIRST robotics program. Friends that I can call “brother,” that I can call “sister,” that I can just call “family.” - DanDon [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2012, 21:29
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Trouble with custom SmartDashboard Widgets

I decided to create some of my own widgets for the SmartDashboard and have been only somewhat successfull. So far, I have taken the source code for the Dashboard and edited the code for the ProgressBar in a new project. As of now the bar works exactly the same except that it also displays the value superimposed over the bar. However, I'm using it for values that range from -1 to 1. Instead of having the bar half full when it is at 0 value, I want it empty at 0 value, full for 1 or -1 values, and in-between for corresponding values. I think I can get that done. BUT, I also want it to change color to indicate if the value is negative or positive(green for positive, red for negative) hoever I am unable to find a way to override the nimbus configuration and change to color at all. Everything I have tried so far has either caused the bar to disappear or not change at all. Please Help!
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2012, 23:36
Sunstroke Sunstroke is offline
Programmer
AKA: Joe Grinstead
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: New England
Posts: 49
Sunstroke is an unknown quantity at this point
Re: Trouble with custom SmartDashboard Widgets

Instead of copying the SmartDashboard project, why not make an extension for it?

That way, you can give your compiled code to other teams in a standard manner.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2012, 23:59
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Trouble with custom SmartDashboard Widgets

I am, I'm just using a lot of the code that came with it and adding on to it.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2012, 21:35
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Trouble with custom SmartDashboard Widgets

I don't seem to be getting many responses...Is what I'm asking not possible, or is it hard to understand? Just to clarify, I need to know how to change the color of the bar on a single JProgressBar that was created using Nimbus L&F.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #5   Spotlight this post!  
Unread 26-01-2012, 00:00
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 434
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Trouble with custom SmartDashboard Widgets

Quote:
Originally Posted by Ipiano View Post
I don't seem to be getting many responses...Is what I'm asking not possible, or is it hard to understand? Just to clarify, I need to know how to change the color of the bar on a single JProgressBar that was created using Nimbus L&F.
I was actually hoping more people would post about creating widgets, because our team has no experience with this yet, and it would be nice to have some examples available.

That said, it doesn't seem like your question is really related to smartdashboard. It's more of a Nimbus/Java UI question... I'm not familiar with Nimbus... but does this google result help?: http://stackoverflow.com/questions/7...ar-with-nimbus
__________________
http://team2168.org
Reply With Quote
  #6   Spotlight this post!  
Unread 26-01-2012, 08:19
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Trouble with custom SmartDashboard Widgets

I saw that and tried the first two lines

UIDefaults defaults = UIManager.getLookAndFeelDefaults();
defaults.put("nimbusOrange",defaults.get("nimbusBa se"));

but it just made the bar disappear altogether.
I'm thinking what I really need is a painter, but I don't know how to use them.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
Reply


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 13:04.

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