[Biojava-l] SequencePanels & Swing borders

Keith James kdj@sanger.ac.uk
10 Aug 2002 23:05:45 +0100


>>>>> "Matthew" == Matthew Pocock <matthew_pocock@yahoo.co.uk> writes:

    Matthew> Hi.  I think I'm back from bosc/ismb - not quite sure yet
    Matthew> ;-) I should have learned by now not to fly with a
    Matthew> hangover. If you think that SequencePanel is
    Matthew> unmaintainable, then I've got no problems with it being
    Matthew> deprecated. Does SequencePoster shair these problems? If
    Matthew> not then it's probably a good thing to fix that as well
    Matthew> to avoid future embarasement.

The problems I know of in SequencePanel are:

It contains a graphics origin hack to allow it to draw at high
sequence coordinates using low graphics coordinates. This works for
most cases, but not when drawing to a BufferedImage where you get
unexpected blank areas. I do not think that SequencePoster shares this
problem. However it is likely to suffer from the rounding errors at
high sequence+graphics coordinates which used to effect SequencePanel.
TranslatedSequencePanel always draws at low graphics coordinates, so
it has no problem.

The Swing border problem. It existed throughout (specifically, drawing
in the area reserved by Insets), but will be easy to fix in
SequencePoster. Less easy in SequencePanel because of the need to
negotiate its extra graphics transformations.

Speed. It's dog-slow (on Java 1.3 at least) when used in a
ScrollPane. The only way to fix this seemed to be a substantial
rewrite, which was how TranslatedSequencePanel came into existance (it
is about 7-8x faster from some rough timings on Java 1.3). I expect
that SequencePoster is slow too, although I haven't timed it. However,
the API is more convenient than TranslatedSequencePanel. You can get a
scrolling SequencePoster by using a ScrollPane, while for
TranslatedSequencePanel it is necessary to code the ScrollBars by
hand.

There's also the code duplication & maintenance issue which has led to
a number of things being fixed in one class and not the others. Having
3 classes which apparently do the same thing must be confusing for
anyone using the library (I know it confused me!).

I can't do anything for now because a mysterious (and as yet unsolved)
DNS problem at Sanger has cut me off from http or ssh to all
open-bio.org and bio*.org hosts. I'll post before I do anything.

Keith

-- 

- Keith James <kdj@sanger.ac.uk> bioinformatics programming support -
- Pathogen Sequencing Unit, The Wellcome Trust Sanger Institute, UK -