> No, that's not the case.

Well, it's supposed to be, since that's the way I designed it to work.  :-)

> I think there is a design pattern mismatch here.
> We have the general situation that our getPreferredSize() methods never 
> update internal layout information fields.
> But TextAreaSkin is violating that assumption in the way that it uses 
> ParagraphView.
> The correct fix IMO is to create getPreferredSize() methods on ParagraphView, 
> so that ParagraphView can know to do the
> necessary calculations without updating it's internal structures.

I have thought about that. But that would have a negative impact on performance 
since we'd be calling it twice (once to calculate size and once to lay out). 
That is necessary for components, but not for text. Text is always given its 
"preferred" size, so no "negotiation" is necessary.

So maybe your fix is correct. We simply tell the paragraph view what its break 
width is every time we need size info from it, and if that causes it to 
invalidate and recalculate, so be it.

G

Reply via email to