[Biojava-dev] TranslatedSequencePanel / LabelledSequenceRenderer fix

Michael Kowalchuk kowalchukm at AGR.GC.CA
Fri Apr 7 19:34:05 UTC 2006


Hi,

I'm developing a J2SE application using BioJava 1.4, and I've found a
bug where a LabelledSequenceRenderer will not be drawn correctly on a
TranslatedSequencePanel.  Specifically, the label will not be visible at
all, and the graphics will be cut off on the left.

I've fixed this by translating the Graphics2D context by the minimum
leading space specified by the renderer.  This is equivalent to what is
done in SequencePanel.

There is still a placement problem with LabelledSequenceRenderer when
the TranslatedSequencePanel is vertically aligned, but it works
perfectly when aligned horizontally.  I'm unsure if this is the fault of
TranslatedSequencePanel or LabelledSequenceRenderer.

I've attached my patch and the source code for a demonstration of this
bug to this message.

Michael Kowalchuk,
Cereal Research Centre
Agriculture and Agri-Food Canada


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 930 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/biojava-dev/attachments/20060407/e20da954/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo.java
Type: text/x-java
Size: 2046 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/biojava-dev/attachments/20060407/e20da954/attachment-0005.bin>


More information about the biojava-dev mailing list