[Biojava-dev] Dynamic renderer updates

Paul.Seed@geneprot.com Paul.Seed@geneprot.com
Tue, 5 Nov 2002 13:40:58 +0100


Hello all -

As this is my first post to the dev list, I'd like to start by saying hi
and thank you to everyone for your great work on the project so far.  I
hope I'll be able to make a small contribution...

I'm currently using the delegate feature of the AbstractBeadRenderer GUI
class to render different features in a number of styles.  This works well
when the rendering styles are fixed, but I'd like to update the display
dynamically and have found it impossible to add or remove delegates after a
renderer has been created.  If a delegate is added, it is invariably
ignored because of existing feature-renderer mappings in the cache. There
is no removeRenderer method.

I'd propose the following simple changes to the AbstractBeadRenderer to
allow delegate renderers to be added and removed dynamically:

* Add a clear() method to the cache inner class
* Add a removeDelegateRenderer(OptimizableFilter filter) method
* Clear the cache whenever a delegate renderer is added or removed

Please let me know what you think - is there another way of doing this?  I
can supply a patched source file if that will help (or check code directly
into CVS given the appropriate account).

Best regards


- Paul Seed

Bioinformatician
GeneProt Inc. (Geneva Branch)
Tel. +41 (0)22 719 88 36
Fax. +41 (0)22 719 88 69