prasath-ideas2it / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

Improve APIs to track progress of document loading #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
*** This issue was imported from http://java.net/jira/browse/XHTMLRENDERER-272

It was reported by pdoubleya on 21.03.2009 13:59:41 +0100 and last updated in 
the previous bug tracker on 21.03.2009 14:00:11 +0100

Found in
Operating System: All
Platform: All

The priority for this issue at migration was Major.

Original description: 
See this mail thread: http://markmail.org/thread/rpumkic7xppdruug

Pete: You could keeping a
running count in LayoutContext of (block) boxes created in BoxBuilder.
 In recent FS versions, the render tree is created up front so that
would give you a reasonable estimate of how much work you have to do.
BlockBox.layout() would let you update the amount of you've done.  The
tricky part is that this is all happening in the EDT, but I think you
could create another EventQueue to update a progress monitor (ala Java
FX's "do" blocks).  I'm not enough of a Swing guru to be confident of
the details though.

Patrick: would suggest hitting lower-hanging fruit first. An approach would be: 
- monitor document 
(XML) load start and end (I think we already have this) - track, on loading the 
document, using a filter, 
the number of external resources (CSS and image), and later, count these down 
in the UAC as they are 
loaded - track layout start and layout end (I think before and after doLayout() 
in the panel, for example) 
- leave internal tracking of layout and render alone for now  For many 
documents, the bulk of the effort 
will be in resource loading. Tracking that, plus the completion of layout, will 
probably go a long way 
improving progress tracking.  Currently, at least for Swing rendering, we track 
the start and end of the 
whole process and broadcast via the DocumentListener interface. By adding a 
couple more milestone 
events in between setDocument() and the end of doDocumentLayout(), we'd have a 
start. Tracking 
resource loading would be more involved, but not too hard.

Original issue reported on code.google.com by pdoubl...@gmail.com on 16 Feb 2011 at 9:47

GoogleCodeExporter commented 9 years ago
pdoubleya wrote on 21.03.2009 14:00:11 +0100:
Defer for R9

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:47