[Biojava-l] getDepth() method - change required?

Matthew Pocock mrp@sanger.ac.uk
Fri, 11 May 2001 12:58:38 +0100


Hi.

I've put your symbolsequencerenderer patch in - it will appear next time 
I CVS commit.

If the Graphics2D was added to SequenceRenderContext, then this 
interface becomes all the information necisary to do prety much 
everything. Normal AWT components have access to the graphics object via 
API, but our ultra-light-weight renderers don't.

The paint methods would obviously change as you no longer need to 
explicitly pass in the Graphics2D argument.

Do you fell confident enough to roll this change through yourself?

Matthew

ps If you can work CVS & SSH, I can get you a development account on 
biojava.org which means that you can make changes directly.


Dr S.M. Huen wrote:

> Currently, the getDepth method of renderer classes of various kinds take
> SequenceRenderContext as the single argument.
> 
> However, it is not possible to go from a font returned by
> SequenceRenderContext to information about the dimensions of that font
> without creating a FontRenderContext.  That, in turn, requires the
> Graphics2D object as the pixel dimensions of a font depends on the drawing
> resolution of the display device.  We cannot exclude the possibility that
> a single SequenceRenderContext may be used in more than one display with
> varying resolutions.
> 
> Could we make the Graphics2D object become an argument of this method too?
> If so, this modified method may have to be retrofitted to the interface as
> all our getDepth() are called by LayeredRenderer with the same parameter
> list.
> 
> I came across this problem when attempting to correct a bug in
> SymbolSequenceRenderer.  As it stands, the getDepth of this class returns
> a fixed value irrespective of whether the text is visible which will force
> allocation of space for this renderer even when it has nothing to display.
> However, it cannot determine font dimensions in the getDepth(0 method
> without access to the graphics object.  We have not observed the effect os
> this omission to date because the GUI uses the sequence renderer at the
> bottom of the window.
> 
> Thanks,
> David Huen, Univ. of Cambridge
> 
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l