Currently I have overriden a slider using LookAndFeel_V3 and I want to redraw the slider background dynamically (redraw the background or foreground slider too if needed). The slider is read only to simplify the requirements.
How would I do this? Is instantiating a laf object and calling
laf.drawLinearSliderBackground possible? I know this might be computationally expensive to redraw the background of the slider, but my update will be minimal and this is an experiment at designing dynamic GUIs. Any ideas?
just call it’s
repaint() function. This will cause the component to have it’s
paint() function called (async from your call to
I’m sorry, I didn’t quite get this.
Do you mean calling the slider’s
repaint() function would call the
drawLinearSlider which in turns calls
I would also like to access some data while redrawing the background. So i was hoping to
Then access the data in
I do not fully understand all the other trickery you want to do, but if you want to repaint the background of your slider, yes, called
The LookAndFeel is shared by all your Components (or at least many Components, you can have multiple LookAndFeels). So the LnF should be stateless. It only defines behaviour, not a state of a specific slider.
However you can use the getProperties() NamedValueSet, that every Component has, and in your LnF implementation you get a reference to the coponent that is calling your drawSliderBackground or whatever, it can access these properties.