thanks for your inputs. That strengthens a bit the picture I have in
mind. I'm wondering if the following makes any sense:

We would have a list of page-level Knuth elements; some of those
elements would be wrapper around line-level Knuth elements. Almost every
element would contain a Position pointing to the LayoutManager that
generated the element. Special elements created to achieve various
effects (say, text-centering), would contain null Positions.

The breaking algorithm would break the list of Knuth elements into
chunks representing lines/pages. From that we would iterate over the
non-null Positions, and for each one call
position.getLM().addArea(position). That is, the position would notify
its LM that its corresponding areas must be added.

For page-level elements wrapping line-level elements, we would also
iterate over the wrapped inline Positions.

Now, does that picture represent the current code? If not, what is
missing/wrong, apart from the many details relevant to each particular
LM? Does that make sense?


Jeremias Maerki a écrit :
> On 07.03.2007 15:28:37 Andreas L Delmelle wrote:
>> On Mar 7, 2007, at 09:07, Vincent Hennebert wrote:
>> Hi Vincent,
>>> I have some questions regarding the handling of Position elements. I'm
>>> not familiar with that part of the code yet, and as there is little or
>>> no javadoc for those it's a bit difficult to guess their purposes just
>>> by looking at the code.
>> I think you're not the only one with this problem... :/
>> Note that there is also an illustrious resetPosition() method, which  
>> currently seems to be used nowhere. All references to it seem to be  
>> circular. BlockLayoutManager.resetPosition() is only called by  
>> AbstractLayoutManager.reset(), which in turn is only called by one of  
>> the other LM's resetPosition(), etc.
> That's a left-over from the Keiron's and Karen's first approach before
> we introduced Knuth's algorithm. The resetting was used to go back to a
> certain position after deciding line/page breaks. When I merged in
> Luca's Knuth code I mostly removed most of this resetting because I
> thought we wouldn't need it anymore. Turns out I could have been wrong 
> ("changing available IPD" topic). But maybe it's also good I didn't
> remove everything so we still know that there was such a mechanism. At
> some point we obviously have to resurrect it (if we need it again) or to
> remove it for good.
>> The closest understanding that I have of those Positions is still a  
>> bit limited, I'm afraid, so I'm hoping others chime in to correct my  
>> mistakes or offer further clarification. (Just noticed that Luca  
>> already did; will share my thoughts in any case, to see if I may have  
>> misinterpreted something)
> <snip/>
>> That is all: as far as I get it...
> Oh, I think you pretty much got it.
> Jeremias Maerki

Reply via email to