You could also erase the system cursor and draw a custom one (which
could use XORmode too). This way, you would eliminate the problem of
rectangles lagging behind the mouse when dragging an object.


That's part of the efficiency methods I have implemented in my ZUI
(2.5D/zoomable user interface) toolkit that is based on Java2D. It's
called XVTM [1] and it is open source (LGPL). It is specialized in the
creation of GUIs which have to handle large quantities of graphical
objects (continuous zooming capabilities, clipping algorithms for
efficiency) and animations (e.g. rotations, color changes, translation,...)

For instance, it has been used to create a visual editor for RDF models
(directed graphs) called IsaViz [2] also freely available.

[1] http://www.xrce.xerox.com/competencies/contextual-computing/vtm/
[2] http://www.w3c.org/2001/11/IsaViz/

Emmanuel

--
[EMAIL PROTECTED] |  Xerox Research Centre Europe
Contextual Computing             |  6, Chemin de Maupertuis
tel: +33 4 76 61 50 32           |  38240 Meylan
fax: +33 4 76 61 50 99           |  France
http://www.xrce.xerox.com/people/pietriga/



Adrian Barnett wrote:

 > David Eisner wrote
 >
 >>
 >> This isn't a real-world program, but I'm wondering how one
 >> would improve the performance -- with the hope that any such
 >> improvements might be applicable elsewhere.
 >>
 >> Thanks.
 >>
 > One thing that might help is to use a BSP (binary space partition) tree
 > to store the positions of all the rectangles. Then, instead of comparing
 > each rectangle to the clip box, ask the BSP tree to return a list of
 > all rectangles within the clip box and draw them. That way you're not
 > comparing every single rectangle to the box for each update. It can
 > dramatically decrease the time taken to decide what to draw. The
 > downside is that you have to rebuild the BSP tree if rectangles are
moved.
 >
 > --
 > Adrian BAAWA aa#128
 > Website : http://www.abarnett.demon.co.uk/atheism/
 > Message boards : http://pub45.ezboard.com/bwastelandofwonders
 > Atheist shop :
 > http://www.cafepress.com/cp/store/store.aspx?storeid=wow_atheism
 >
 > ( This outgoing email has been scanned for viruses. )
 >
 >
===========================================================================
 > To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
 > of the message "signoff JAVA2D-INTEREST".  For general help, send
email to
 > [EMAIL PROTECTED] and include in the body of the message "help".
 >
 > .
 >

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to