Jeremias Maerki wrote:
Ok, the FOEventHandler is created in the FOTreeBuilder. One FOIncidentally, I'd like to get the fonts out of FOEventHandler, I think they should be declared only within those subclasses of FOEventHandler that need them. But we can take up that issue later.
TreeBuilder is instantiated per processing run. The FOEventHandler is
set on FONode's static variable during startDocument(). The
FOEventHandler keeps track of used fonts, number of pages, tracking IDs
etc. which are all relevant to one document run.
Now imagine a situation where multiple processing runs occur and justBut that would be another instance of the application, so that would be another instance's FOEventHandler that would be altered. Statics are common to a running instance, not all running instances of the same application in general. Please continue to elaborate.
after the TreeBuilder sets the FOEventHandler on FONode in
startDocument() and continues layout, another thread starts another
processing run and runs through FOTreeBuilder.startDocument() before the
whole layout process of the first processing run is finished.
Also, are you aware of why I switched to a static? To end the continuous recursion to the fo:root each time any of the child nodes need to call getFOEventHandler().startThisFormattingObject() and/or getFOEventHandler().endSomeFormattingObject().