+ if (horizontal > 0) // scrollbar pulled right, image to the left\r
+ {\r
+ transX = (er - sr - horizontal) * av.charWidth;\r
+ sr = er - horizontal;\r
+ }\r
+ else if (horizontal < 0)\r
+ {\r
+ er = sr - horizontal;\r
+ }\r
+ else if (vertical > 0) // scroll down\r
+ {\r
+ ss = es - vertical;\r
+\r
+ if (ss < av.startSeq)\r
+ { // ie scrolling too fast, more than a page at a time\r
+ ss = av.startSeq;\r
+ }\r
+ else\r
+ {\r
+ transY = imgHeight - (vertical * av.charHeight);\r
+ }\r
+ }\r
+ else if (vertical < 0)\r
+ {\r
+ es = ss - vertical;\r
+\r
+ if (es > av.endSeq)\r
+ {\r
+ es = av.endSeq;\r
+ }\r
+ }\r
+\r
+ gg.translate(transX, transY);\r
+\r
+ gg.setColor(Color.white);\r
+ gg.fillRect(0, 0, (er - sr + 1) * av.charWidth,\r
+ (es - ss) * av.charHeight);\r
+ drawPanel(gg, sr, er, ss, es, sr, ss, 0);\r
+ gg.translate( -transX, -transY);\r
+\r
+ fastPaint = true;\r
+ repaint();\r
+ }\r
+\r
+ /**\r
+ * Definitions of startx and endx (hopefully):\r
+ * SMJS This is what I'm working towards!\r
+ * startx is the first residue (starting at 0) to display.\r
+ * endx is the last residue to display (starting at 0).\r
+ * starty is the first sequence to display (starting at 0).\r
+ * endy is the last sequence to display (starting at 0).\r
+ * NOTE 1: The av limits are set in setFont in this class and\r
+ * in the adjustment listener in SeqPanel when the scrollbars move.\r
+ */\r
+\r
+\r
+ // Set this to false to force a full panel paint\r