[Biojava-l] LabelledSequenceRenderer does not work with TranslatedSequenceRenderer, Newbie

David Huen smh1008 at cus.cam.ac.uk
Thu Mar 25 12:45:10 EST 2004


On Thursday 25 Mar 2004 5:26 pm, Keith James wrote:
> >>>>> "Kalle" == Kalle Näslund <kalle.naslund at genpat.uu.se> writes:
>
> [...]
>
>     Kalle> Also, can anyone remind me why we have several Panel
>     Kalle> implementations please ? shouldnt it be very nice to have
>     Kalle> one single implementation, that supports the unique
>     Kalle> features of both SequencePanel and TranslatedSequencePanel
>     Kalle> ?
>
> Long story...
>
> This came about because SequencePanel had two problems:
>
> 1. It will by default render a huge sequence in a single huge
>    coordinate space which leads to floating point errors in marking
>    tics/points at the far end of the sequence.
>
>    To solve this a hack was put in to translate the drawing
>    coordinates to ~0 before drawing. However that broke rendering to
>    any Graphics2D derived from a BufferedImage where it produced an
>    un-renderable region between 0 and the offset (which was 50 pixels
>    wide, if I remember)
>
> 2. It was far too slow with available sequence/feature renderers.
>
>
> So I wrote TranslatedSequencePanel which solves the first problem
> without using the offset hack. Instead of placing a huge virtual
> rendering area in a ScrollPane, it clips a window of sequence to
> render and runs the window along the sequence. Therefore you are
> always drawing from 0, even at base 100,000,001 of the sequence.
>
> As a nice side-effect, it also turned out to be 5-10x faster at
> rendering with the current sequence/feature renderers.
>
> But people were still using the SequencePanel in their client code, so
> I didn't want to remove it.
>
Let's go to TranslatedSequencePanel then.  It seems the sane way to go and 
it is good at high coord spaces.  The only way this is going to happen is 
if we tag it "DEPRECATED" immediately and shoot it at 1.4 final.

David Huen




More information about the Biojava-l mailing list