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

Kalle Näslund kalle.naslund at genpat.uu.se
Thu Mar 25 11:25:43 EST 2004


Maximilian Haeussler wrote:

> Hallo everyone,
>
> I am pretty new to biojava. Can anyone give me a hint why the 
> LabelledSequenceRenderer works fine for the SequenceRenderer, but not 
> with the TranslatedSequenceRenderer? I've modified FastBeadDemo and 
> BeadDemo to include labels. BeadDemo works fine but not the translated 
> one. What is so different about the TranslatedSequenceRenderer that 
> prohibits painting into the trailing space of the sequence?
>
> Another question, this time a rather stupid one: How can I get rid of 
> those "Originally:"/"Now:"-messages of the demos? I can't find the 
> message anywhere, neither in biojava nor in the demo directory...
>
> Thanks
> Max
>
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at biojava.org
> http://biojava.org/mailman/listinfo/biojava-l


HI!

Firstly, i am going to make a  few assumptions here, as some of the 
classnames you mention seems a bit out of context
or do not exist. My appologies if these assumptions are wrong, i will 
then have to blame my lack of proper english
knowledge. But, hope i assumed correctly and this helps.

The assumption are.

1) SequenceRenderer                   == SequencePanel
   ( if we are going to compare this class to TranslatedSequencePanel, 
SequencePanel is the thing that makes sense )
  
2) TranslatedSequenceRenderer         == TranslatedSequencePanel
   ( there is no TranslatedSequenceRenderer in the bj source tree )

3) The part about painting in the trailing space of the sequence is 
realy about the leading space   
   ( The LabelledSequenceRenderer doesnt support painting into the 
trailing space, as indicated by the javadocs )
     This should of course be fixed )



then then the question becomes, why does LabelledSequenceRenderer work 
with SequencePanel and not with TranslatedSequencePanel ?

My guess is that this is a bug in either the SequencePanel or the 
TranslatedSequencePanel when it comes to handling
leading and trailing space.

The obvious solutions as i see it is

1) you use SequencePanel, after a quick look at the SequencePanel api it 
seems you can use the setRange() method call
   to mimic the TranslatedSequencePanel setSymbolTranslation(int 
translation)  behaviour.
   by something like setRange(  new RangeLocation( translation, 
symbolList.length() ) );

2) have me or someone else fix 
TranslatedSEquencePanel/SequencePanel/LabelledSequenceRenderer properly
   ( this should realy be done irrespectively of what solution you choose )

I will be able to assist you with point 2, but not until sometime in the 
beginning of next week.

Also, can anyone remind me why we have several Panel implementations 
please ? shouldnt it be very nice to have one single
implementation, that supports the unique features of both SequencePanel 
and TranslatedSequencePanel ?

Live long and prosper
/Kalle





More information about the Biojava-l mailing list