Op Thu, 29 Mar 2007 07:36:02 +0200 schreef Christian Stapfer <nil@[EMAIL PROTECTED]
>:
> "Boudewijn Dijkstra" <usenet@[EMAIL PROTECTED]
> wrote in message
> news:op.tpw3tuhu9s1m7x@[EMAIL PROTECTED]
>> Op Mon, 19 Mar 2007 07:10:40 +0100 schreef Christian Stapfer
>> <nil@[EMAIL PROTECTED]
>:
>>> As to my application possibly not being able to keep
>>> up with mouse movements: although my application has
>>> hardly anything other to do than to process those mouse
>>> movements (i.e. storing them but also drawing a small
>>> line segment connecting the last point with the current
>>> point of the stroke being drawn), this seems quite
>>> possible to me.
>>
>> Nobody should paint in an event dispatch thread.
>> Just store it and issue a repaint.
>
> I can understand your position, kind of. However,
> the line drawing has to follow the dragging of
> the mouse *immediately*: because, for the user,
> it represents the movement of the pen.
Drawing involves at least an order of magnitude more work than registering
and storing a mouse event. It does not matter much if drawing is
interrupted shortly when an event comes in. Note that "immediately" is
for the user something different than to the machine.
> How, for example, would I handle rubberbanding,
> if I were to follow your precept ("don't ever
> draw anything in an event handler")?
What is the problem with rubberbanding?
> As compared
> to rubberbanding of a large rectangle, I have
> to draw a really only very tiny line segment when
> incrementally drawing the pen-path from within
> an event handler...
>
> Regards,
> Christian
>
> P.S: No amount of clever coding seems to help
> compensate for the fact that mouse-coordinates
> are coarser than pen-coordinates on a Tablet PC
> (because they are screen coordinates rather
> than pen-digitizer coordinates) .
Does that include Newtonian physics calculations on speed, drag and
momentum? If you do not paint on the event dispatch thread, you can
collect more useful timing information from the events.
--
Gemaakt met Opera's revolutionaire e-mailprogramma:
http://www.opera.com/mail/


|