X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSeqCanvas.java;h=02c99902e6ff1204b65d14c2b4b96bdfeac49992;hb=05cc1e453976137138e0d24ba0264b8e5f35b628;hp=465dd3864f67138994c37b6bda2b35101c62348a;hpb=225b4ceeafe280273cfe90c5a7d44d11c192498e;p=jalview.git diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index 465dd38..02c9990 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -37,12 +37,13 @@ public class SeqCanvas SearchResults searchResults = null; - int chunkHeight; - int chunkWidth; - boolean fastPaint = false; + int cursorX = 0; + int cursorY = 0; + + public SeqCanvas(AlignViewport av) { this.av = av; @@ -140,7 +141,7 @@ public class SeqCanvas continue; } - value = av.alignment.getSequenceAt(i).findPosition(index); + value = seq.findPosition(index); break; } if (value != -1) @@ -293,6 +294,8 @@ public class SeqCanvas int LABEL_WEST, LABEL_EAST; public int getWrappedCanvasWidth(int cwidth) { + cwidth -= cwidth % av.charWidth; + FontMetrics fm = getFontMetrics(av.getFont()); LABEL_EAST = 0; @@ -333,15 +336,12 @@ public class SeqCanvas FontMetrics fm = getFontMetrics(av.getFont()); - int LABEL_EAST = 0; if (av.scaleRightWrapped) { LABEL_EAST = fm.stringWidth(getMask()); } - int LABEL_WEST = 0; - if (av.scaleLeftWrapped) { LABEL_WEST = fm.stringWidth(getMask()); @@ -365,7 +365,7 @@ public class SeqCanvas while ((ypos <= canvasHeight) && (startRes < av.alignment.getWidth())) { - endx = startRes + cWidth; + endx = startRes + cWidth -1; if (endx > al.getWidth()) { @@ -406,7 +406,7 @@ public class SeqCanvas if(annotations==null) annotations = new AnnotationPanel(av); - annotations.drawComponent( g, startRes, endx ); + annotations.drawComponent( g, startRes, endx+1 ); g.translate(0, -cHeight - ypos-4); } g.translate(-LABEL_WEST, 0); @@ -468,6 +468,14 @@ public class SeqCanvas av.charWidth, av.charHeight); } } + + if (av.cursorMode && cursorY == i + && cursorX >= startRes && cursorX <= endRes) + { + sr.drawCursor(nextSeq, cursorX, (cursorX - startRes) * av.charWidth, + offset + ( (i - startSeq) * av.charHeight)); + } + } // @@ -487,7 +495,7 @@ public class SeqCanvas groupIndex = 0; } - if ( group != null) + if ( group != null ) { do { @@ -496,6 +504,7 @@ public class SeqCanvas boolean inGroup = false; int top = -1; int bottom = -1; + int alHeight = av.alignment.getHeight()-1; for (i = startSeq; i < endSeq; i++) { @@ -513,11 +522,11 @@ public class SeqCanvas group.sequences.contains(av.alignment.getSequenceAt( i))) { - if (bottom == -1) + if ( (bottom == -1) && + (i >= alHeight || + !group.sequences.contains( + av.alignment.getSequenceAt(i + 1)))) { - if(i == endSeq-1 || // Dont check for i+1 if on the bottom row - !group.sequences.contains(av.alignment.getSequenceAt(i+1 ))) - bottom = sy + av.charHeight; }