\r
SearchResults searchResults = null;\r
\r
- int chunkHeight;\r
- int chunkWidth;\r
-\r
boolean fastPaint = false;\r
\r
\r
+ int cursorX = 0;\r
+ int cursorY = 0;\r
+\r
+\r
public SeqCanvas(AlignViewport av)\r
{\r
this.av = av;\r
continue;\r
}\r
\r
- value = av.alignment.getSequenceAt(i).findPosition(index);\r
+ value = seq.findPosition(index);\r
break;\r
}\r
if (value != -1)\r
int LABEL_WEST, LABEL_EAST;\r
public int getWrappedCanvasWidth(int cwidth)\r
{\r
+ cwidth -= cwidth % av.charWidth;\r
+\r
FontMetrics fm = getFontMetrics(av.getFont());\r
\r
LABEL_EAST = 0;\r
\r
FontMetrics fm = getFontMetrics(av.getFont());\r
\r
- int LABEL_EAST = 0;\r
\r
if (av.scaleRightWrapped)\r
{\r
LABEL_EAST = fm.stringWidth(getMask());\r
}\r
\r
- int LABEL_WEST = 0;\r
-\r
if (av.scaleLeftWrapped)\r
{\r
LABEL_WEST = fm.stringWidth(getMask());\r
av.endRes = av.startRes + cWidth;\r
\r
\r
- int endx = (startRes + cWidth) - 1;\r
+ int endx;\r
int ypos = hgap;\r
\r
\r
while ((ypos <= canvasHeight) && (startRes < av.alignment.getWidth()))\r
{\r
+ endx = startRes + cWidth -1;\r
+\r
+ if (endx > al.getWidth())\r
+ {\r
+ endx = al.getWidth();\r
+ }\r
+\r
g.setColor(Color.black);\r
\r
if (av.scaleLeftWrapped)\r
drawNorthScale(g, startRes, endx, ypos);\r
}\r
\r
-\r
- if (av.vconsensus!=null && av.alignment.getWidth() >= av.vconsensus.size())\r
- {\r
- endx = av.vconsensus.size() - 2;\r
- }\r
-\r
-\r
if(g.getClip()==null)\r
g.setClip(0, 0, cWidth * av.charWidth, canvasHeight);\r
\r
if(annotations==null)\r
annotations = new AnnotationPanel(av);\r
\r
- annotations.drawComponent( g, startRes, endx + 1);\r
+ annotations.drawComponent( g, startRes, endx+1 );\r
g.translate(0, -cHeight - ypos-4);\r
}\r
g.translate(-LABEL_WEST, 0);\r
\r
\r
startRes += cWidth;\r
- endx = (startRes + cWidth) - 1;\r
-\r
- if (endx > al.getWidth())\r
- {\r
- endx = al.getWidth();\r
- }\r
}\r
\r
}\r
av.charWidth, av.charHeight);\r
}\r
}\r
+\r
+ if (av.cursorMode && cursorY == i\r
+ && cursorX >= startRes && cursorX <= endRes)\r
+ {\r
+ sr.drawCursor(nextSeq, cursorX, (cursorX - startRes) * av.charWidth,\r
+ offset + ( (i - startSeq) * av.charHeight));\r
+ }\r
+\r
}\r
\r
//\r
groupIndex = 0;\r
}\r
\r
- if ( group != null)\r
+ if ( group != null )\r
{\r
do\r
{\r
boolean inGroup = false;\r
int top = -1;\r
int bottom = -1;\r
+ int alHeight = av.alignment.getHeight()-1;\r
\r
for (i = startSeq; i < endSeq; i++)\r
{\r
group.sequences.contains(av.alignment.getSequenceAt(\r
i)))\r
{\r
- if (bottom == -1)\r
+ if ( (bottom == -1) &&\r
+ (i >= alHeight ||\r
+ !group.sequences.contains(\r
+ av.alignment.getSequenceAt(i + 1))))\r
{\r
- if(i == endSeq-1 || // Dont check for i+1 if on the bottom row\r
- !group.sequences.contains(av.alignment.getSequenceAt(i+1 )))\r
-\r
bottom = sy + av.charHeight;\r
}\r
\r