PrefWidth/Height calculations only works if stage is shown
swpalmer at gmail.com
Tue Sep 24 16:34:56 PDT 2013
On Wed, Aug 28, 2013 at 3:18 PM, John Smith <John_Smith at symantec.com> wrote:
> I hadn't seen the applyCSS conversation, but looks like it was contained
> deep in a node validation thread:
> Looks like the request is already covered in RT-21206 as pointed out by
> Looks like the feature will show up some time post-Java8, which is why
> there is nothing on Node now.
> For now, I stick with Kevin's node snapshot workaround:
> // create a dummy scene so layout and CSS will work
> new Scene(new Group(node));
> Thanks for the info!
I have a need to apply the CSS so when I 'snapshot' a node that isn't in my
scene, it looks correct.
I'm doing this:
Parent p = n.getParent(); // The node I want tosnapshot isn't the root of
Scene s = KayakFXUtils.createDarkScene(p,1000,1000);
I get a reasonable size for the node, but the CSS isn't applied.
I get a ton of warnings like this:
WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve
'-fx-text-background-color' while resolving lookups for '-fx-text-fill'
from rule '*.label' in stylesheet
More information about the openjfx-dev