\r
public void fastPaint(int horizontal, int vertical)\r
{\r
- if(horizontal==0 && vertical==0)\r
- {\r
- return;\r
- }\r
-\r
+ if (horizontal == 0 && vertical == 0)\r
+ return;\r
\r
- if (img==null || paintFlag)\r
- {\r
+ if (img == null || paintFlag)\r
+ {\r
repaint();\r
return;\r
- }\r
-\r
- gg.copyArea( 0,0, imgWidth, imgHeight, -horizontal*av.charWidth, -vertical*av.charHeight );\r
-\r
- int sr=av.startRes, er=av.endRes+1, ss = av.startSeq, es = av.endSeq, transX=0, transY = 0;\r
- 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
-\r
-\r
-\r
+ }\r
\r
- if(vertical>0) // scroll down\r
- {\r
- transY = imgHeight - vertical*av.charHeight;\r
- ss = es - vertical;\r
- }\r
- else if(vertical<0)\r
- {\r
+ gg.copyArea(0, 0, imgWidth, imgHeight, -horizontal * av.charWidth,\r
+ -vertical * av.charHeight);\r
\r
- es = ss-vertical;\r
+ int sr = av.startRes, er = av.endRes + 1, ss = av.startSeq, es = av.endSeq,\r
+ transX = 0, transY = 0;\r
+ 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
+ er = sr - horizontal;\r
\r
- }\r
+ else if (vertical > 0) // scroll down\r
+ {\r
+ transY = imgHeight - vertical * av.charHeight;\r
+ ss = es - vertical;\r
+ }\r
+ else if (vertical < 0)\r
+ es = ss - vertical;\r
\r
gg.translate(transX, transY);\r
\r
- drawPanel(gg, sr,er,ss,es,sr,ss,0);\r
+ drawPanel(gg, sr, er, ss, es, sr, ss, 0);\r
\r
- gg.translate( -transX, -transY );\r
- getGraphics().drawImage(img,0,0,this);\r
+ gg.translate( -transX, -transY);\r
+ getGraphics().drawImage(img, 0, 0, this);\r
\r
}\r
\r
public void paintComponent(Graphics g)\r
{\r
// this draws the whole of the alignment\r
-\r
imgWidth = getWidth();\r
imgHeight = getHeight();\r
\r
gg = (Graphics2D)img.getGraphics();\r
gg.setFont(av.getFont());\r
gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);\r
- gg.setClip(0,0,imgWidth, imgHeight);\r
paintFlag = false;\r
\r
+ gg.setColor(Color.white);\r
+ gg.fillRect(0,0,imgWidth,imgHeight);\r
\r
chunkWidth = getWidth()/av.charWidth;\r
chunkHeight = (av.getAlignment().getHeight() + 2)*av.charHeight;\r
av.setChunkHeight(chunkHeight);\r
av.setChunkWidth(chunkWidth);\r
\r
- g.setColor(Color.WHITE);\r
- g.fillRect(0,0,getWidth(), getHeight());\r
\r
if (av.getWrapAlignment())\r
drawWrappedPanel(gg, getWidth(), getHeight(), av.startRes);\r
else\r
drawPanel(gg, av.startRes, av.endRes, av.startSeq, av.endSeq, av.startRes, av.startSeq, 0);\r
\r
-\r
+ g.setColor(Color.white);\r
+ g.fillRect(0,0,getWidth(),getHeight());\r
g.drawImage(img,0,0,this);\r
\r
}\r