Color Slider Vision

Hi every one,

Am not very good in java and everything and I got a problem using the slider o vision module. I want to change the color of every thing in that componant… Like actually in the designer you can change Foreground and Background but you dont have acces to the Track color,Thick color Back Track color and the shape and color of the slide properties.

Do you know if there a way to edit that.

Best regard,
Gabriel

In theory:

In practice:
This probably won’t work.

Thanks you for the answer and in “Theory”. How can you do that on the componant? Via a script? Property change ? How the script look like

Best regards
Gabriel

Those are client properties, so in some scripting hook (maybe a property change event filtered to componentRunning, you would do something like:
event.source.putClientProperty("Synthetica.slider.hoverAndPressed.enabled", True)

There’s also UIManager properties available for customization, although which ones are actually respected is its own complicated subject. Customizing the appearance of Vision applications is a fragile, messy, sometimes outright impossible rabbit hole. It’s far easier to simply say no. (Or, embrace the use of e.g. the Paintable Canvas and make your own implementation, if you really want).

I think @dkhayes117, maybe, was doing some pretty neat stuff with UIManager keys. He may have more specific advice for 8.X stuff, if he’s willing/able to share.

The only UIManager key I could get to work is tick color. You could set the background of the slider to transparent inside a template and add a rectangle behind it to control that color, kind of hacky though.

from javax.swing import UIManager
from java.awt import Color

color = Color(0,0,0)
UIManager.put('Slider.tickColor',color)

Here is a script to inspect UIManager default keys

from javax.swing import UIManager
keys = list(UIManager.getDefaults().keys())
for key in keys:
	if 'Slider' in str(key): 
		print key

This is an older thread, but this came up again. I did a tutorial in the newer thread, that shows a possible way to approach this problem using layered shapes and scripting. Here is the link:
Slider Object customization