From: amwaterhouse Date: Thu, 16 Mar 2006 15:27:47 +0000 (+0000) Subject: Hidden column adjustments X-Git-Tag: Root_VamJalview_2_07b+~46 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8721f6e9e9c1df94142e2513236ffff084349fd3;p=jalview.git Hidden column adjustments --- diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 1cd1229..2b5995c 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -100,8 +100,11 @@ public class SeqCanvas extends JComponent // NORTH SCALE for (int i = scalestartx; i < endx; i += 10) { - String string = String.valueOf(av.getColumnSelection().adjustForHiddenColumns(i)); - g.drawString(string, (i - startx - 1) * av.charWidth, + int value = i; + if(av.hasHiddenColumns) + value = av.getColumnSelection().adjustForHiddenColumns(value); + + g.drawString( String.valueOf(value), (i - startx - 1) * av.charWidth, ypos - (av.charHeight / 2)); g.drawLine(((i - startx - 1) * av.charWidth) + (av.charWidth / 2), @@ -124,6 +127,9 @@ public class SeqCanvas extends JComponent FontMetrics fm = getFontMetrics(av.getFont()); ypos += av.charHeight; + if(av.hasHiddenColumns) + startx = av.getColumnSelection().adjustForHiddenColumns(startx); + // EAST SCALE for (int i = 0; i < av.alignment.getHeight(); i++) { @@ -166,6 +172,9 @@ public class SeqCanvas extends JComponent { ypos += av.charHeight; + if(av.hasHiddenColumns) + endx = av.getColumnSelection().adjustForHiddenColumns(endx); + // EAST SCALE for (int i = 0; i < av.alignment.getHeight(); i++) { @@ -173,6 +182,8 @@ public class SeqCanvas extends JComponent int index = endx; int value = -1; + + while (index > startx) { if (jalview.util.Comparison.isGap(seq.getCharAt(index))) @@ -208,6 +219,7 @@ public class SeqCanvas extends JComponent return; } + fastPaint = true; gg.copyArea(horizontal * av.charWidth, @@ -224,6 +236,7 @@ public class SeqCanvas extends JComponent int transX = 0; int transY = 0; + if (horizontal > 0) // scrollbar pulled right, image to the left { er ++; @@ -280,7 +293,7 @@ public class SeqCanvas extends JComponent { super.paintComponent(g); - sr.renderGaps(av.renderGaps); + if ( img != null && (fastPaint || (getVisibleRect().width != g.getClipBounds().width) @@ -421,7 +434,6 @@ public class SeqCanvas extends JComponent int endx = (startRes + cWidth) - 1; int ypos = hgap; - while ((ypos <= canvasHeight) && (startRes < av.alignment.getWidth())) { g.setFont(av.getFont()); @@ -608,6 +620,8 @@ public class SeqCanvas extends JComponent int startSeq, int endSeq, int offset) { + + sr.renderGaps(av.renderGaps); Graphics2D g = (Graphics2D) g1; g.setFont(av.getFont());