[Biojava-dev] [Bug 2107] LabelledSequenceRenderer

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu Sep 28 09:27:11 UTC 2006


http://bugzilla.open-bio.org/show_bug.cgi?id=2107


jolyon.holdstock at ogt.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jolyon.holdstock at ogt.co.uk




------- Comment #1 from jolyon.holdstock at ogt.co.uk  2006-09-28 05:27 -------
I've had a look at the TranslatedSequencePanel code and seem to have a work
around. I say 'seem' as I'm not an expert on Graphics2D

When using the LabelledSequenceRenderer in the TSP the paint method in the TSP
doesn't set the clip for the renderer correctly.

I have edited the following code in the TSP to change

clip.x
clip.width
The point for g2.translate

This sets the clip correctly, the label renders and the correct sequence
displayed. 

//OLD CODE ==========================================================
if (direction == HORIZONTAL) {
  // Clip x to edge of delegate renderer's leader
  clip.x = renderer.getMinimumLeader(this);
  clip.y = 0.0;
  // Set the width to visible symbols + the delegate
  // renderer's minimum trailer (which may have something in
  // it to render).
  clip.width = sequenceToGraphics(getVisibleSymbolCount() + 1) +
renderer.getMinimumTrailer(this);
  clip.height = renderer.getDepth(this);
  g2.translate(leadingBorder.getSize() + insets.left, insets.top); } 

//NEW CODE ============================================================
if (direction == HORIZONTAL) {
  // Clip x to edge of delegate renderer's leader
  //clip.x = renderer.getMinimumLeader(this);
  clip.x = 0 - renderer.getMinimumLeader(this);
  clip.y = 0.0;
  // Set the width to visible symbols + the delegate
  // renderer's minimum trailer (which may have something in
  // it to render).
  clip.width = sequenceToGraphics(getVisibleSymbolCount() + 1) +
renderer.getMinimumLeader(this) + renderer.getMinimumTrailer(this);
  clip.height = renderer.getDepth(this);
  g2.translate(leadingBorder.getSize() - clip.x + insets.left, insets.top); }


I have used this code with the RulerRenderer via the MultiLineRenderer
and think that the ruler doesn't renderer numbers/ticks accurately for
the sequence in the TSP. It's marginal and only relevant at high resolution but
I'll have a look at this.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the biojava-dev mailing list