Layout issues
Scott Palmer
swpalmer at gmail.com
Wed Oct 10 11:13:48 PDT 2012
I found my original problem. One of my components called requestLayout on some of it's children in response to layoutChildren. I changed that to a direct call to layoutChildren and that did the trick.
I'm still struggling with odd sizing behaviour - when I remove content from within a container the container still seems to think it counts as far as the layout bounds go. It's odd as I can see the container shrink because it knows some of the content has been removed, but there is another bit of content that is clearly defining the size of the parent even though it has been removed from the parent.
Scott
On 2012-10-10, at 12:11 PM, Tom Eugelink <tbee at tbee.org> wrote:
> I have been attempting to get custom panes laid out by overriding layoutChilderen as well, and ended up with only partial correct layouts, never quite perfect. Then I switched to listening to the pane's width and height properties and then call a custom relayout() method. That works perfectly. Furthermore, by using binding to such properties combined with the calculation features, it now is a breeze to get stuff laid out.
>
> Tom
>
>
> On 2012-10-10 15:42, Scott Palmer wrote:
>> Hi,
>>
>> I have a custom container extending Pane that implements layoutChildren. I've noticed that this method is called continuously even though my scene is static. It's like something is always in the list of "dirty" nodes and is forcing a re-layout. I don't understand this. I've googled but I can't find a decent tutorial for implementing custom containers or custom layouts.
>>
>> Part of the problem with my application is that nodes are not properly shrining when I remove content from within them, they shrink a little, but not as much as they should. I'm still debugging, but wonder if there is any insight into how the layout system works that I've missed somewhere?
>>
>> Thanks,
>>
>> Scott
>
More information about the openjfx-dev
mailing list