>>>>> "WH" == William Huang <[EMAIL PROTECTED]> writes:

WH> Dear Thomas, How are you?

Hi William,

   I'm doing well and you?

WH> I made my Scrollbar work with most of the features of currently
WH> available scrollbars. However, one significant problem is that
WH> when I drag the sliders, it seems that the speed of scrolling is
WH> limited. That is, when I drag fast, the scrollbar still responds
WH> with a slow speed. I think it may not be the problem of CPU power
WH> and memory constraint since now I am using a faster machine,
WH> should the reason be Batik Javascript event queuing and
WH> processing? If so, could you give me some ideas about how to
WH> modify it so that it can process the drag event quicker?

    I suspect this is due to the multi-threaded nature of event
handling in Batik.  See the mouse move event simply posts a runnable
in the DOM's runnable queue.  The first of these causes a repaint to
occure (which also happens async) while the repaint is happening the
event thread is dumping lots and lots of mouse-move events into the
DOM's runnable queue, since adding a runnable to the DOM's runnable
queue takes no time you get lots of them with small differences.

    That said, in the swing.svg.JSVGCompnent there is event
compression code for mouse Move/Drag (search on
dispatchMouseMoved). So this shouldn't happen. :)

    To start with I would instrument this code to see if it is in fact
doing anything (picking up duplicate events).

    There is also a frame-rate limiter (requires that at least 20ms
goes by between frames) - but several mouse move events can be
processed in that time.

    Finally there is a bit of code the holds off on rendering an
update if there are pending ECMA Script functions, but it too will
only hold off for a little while, and of course the mouse events
should be compressed while that is happening.

    So I've given a whole bunch of ideas but no smoking gun.  If you
want to send me the sample SVG I'll see if anything pops out, but on
the face of it there is nothing clear.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to