Andreas L Delmelle wrote:

On Aug 23, 2006, at 17:44, Patrick Paul wrote:

<snip />


Why not keep getNextKnuthElements() wich does the line breaking depending on a boolean switch ? Then depending on wether the element list already exists, the (modified) collectKnuthElements() method is called.


FTM, such a boolean switch would probably be the wisest move. Not changing too much at once.

This is my perspective for the auto-table layout, since I am implementing a new LayoutManager method called determineMinMaxTextWidths() which returns an object containing the two values needed to calculate optimum column widths. These values will go up the hierarchy up to the TableLM where the optimal column widths will be determined. So no need to return the actual element lists, right ?


Correct. To determine the minimum column-widths, you don't actually need the element lists themselves, only the width of widest piece of unbreakable content in the list.

As a nit, the suggested name determineMinMaxTextWidths() is maybe a bit misleading, since it is not merely text we're dealing with (could also be images... => determineMinMaxContentWidth()?)

You are right. Thanks for the suggestion. I would even say that "determine" is misleading since the min and max content widths are calculated when getNextKnuthElements is called. So it maybe it would be better to name it getMinMaxContentWidth() ? Maybe I shouldn't be calculating the min and max content widths while element creation is done ?




Cheers,

Andreas

Patrick

Reply via email to