[Biojava-dev] [Bug 2107] LabelledSequenceRenderer[Scanned]

Jolyon Holdstock jolyon.holdstock at ogt.co.uk
Wed Oct 4 16:35:41 UTC 2006


Hi,

The changes I have made to the TranslatedSequencePanel have resolved the
issue when using a LabelledSequenceRenderer in a TSP.

Is it worth fixing the VERTICAL rendering of the label? Before I try and
do so I would like opinions as to whether there is a need for rendering
in this dimension?

There is a problem when using the RulerRenderer with the adjusted LSR as
the the ruler line is rendered from before the point where the label
ends. As a result the line overlaps the label.

Also, as the line sometimes doesn't quite extend to the end of the panel
I add scale to maxX instead of halfscale.

I have edited the RulerRenderer to avoid this.

Following the if (tickDirection == TICKS_UP) conditional
I have replaced 
  line.setLine(minX - halfScale, 0.0, maxX + halfScale, 0.0);
with
  line.setLine(minX, 0.0, maxX + scale, 0.0);


I can pass on the changes or commit it myself if you want to give an
account.


cheers,


Jolyon


-----Original Message-----
From: biojava-dev-bounces at lists.open-bio.org
[mailto:biojava-dev-bounces at lists.open-bio.org] On Behalf Of
bugzilla-daemon at portal.open-bio.org
Sent: 28 September 2006 10:27
To: biojava-dev at biojava.org
Subject: [Biojava-dev] [Bug 2107] LabelledSequenceRenderer[Scanned]

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.
_______________________________________________
biojava-dev mailing list
biojava-dev at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biojava-dev











This email has been scanned by Oxford Gene Technology Security Systems.





More information about the biojava-dev mailing list