\r
AlignViewport av;\r
\r
- public boolean paintFlag = false;\r
+ // public boolean paintFlag = false;\r
\r
boolean showScores = false;\r
boolean displaySearch = false;\r
int chunkHeight;\r
int chunkWidth;\r
\r
+ boolean fastPaint = false;\r
+\r
\r
public SeqCanvas(AlignViewport av)\r
{\r
if (horizontal == 0 && vertical == 0)\r
return;\r
\r
- if (img == null || paintFlag)\r
- {\r
- repaint();\r
- return;\r
- }\r
-\r
gg.copyArea(0, 0, imgWidth, imgHeight, -horizontal * av.charWidth,\r
-vertical * av.charHeight);\r
\r
drawPanel(gg, sr, er, ss, es, sr, ss, 0);\r
\r
gg.translate( -transX, -transY);\r
- getGraphics().drawImage(img, 0, 0, this);\r
+\r
+ fastPaint = true;\r
+ repaint();\r
\r
}\r
\r
\r
public void paintComponent(Graphics g)\r
{\r
+ g.setColor(Color.white);\r
+ g.fillRect(0, 0, getWidth(), getHeight());\r
+\r
+ if (fastPaint)\r
+ {\r
+ g.drawImage(img, 0, 0, this);\r
+ fastPaint = false;\r
+ return;\r
+ }\r
+\r
// this draws the whole of the alignment\r
imgWidth = getWidth();\r
imgHeight = getHeight();\r
gg = (Graphics2D)img.getGraphics();\r
gg.setFont(av.getFont());\r
gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);\r
- paintFlag = false;\r
\r
gg.setColor(Color.white);\r
gg.fillRect(0,0,imgWidth,imgHeight);\r
else\r
drawPanel(gg, av.startRes, av.endRes, av.startSeq, av.endSeq, av.startRes, av.startSeq, 0);\r
\r
- g.setColor(Color.white);\r
- g.fillRect(0,0,getWidth(),getHeight());\r
- g.drawImage(img,0,0,this);\r
+ g.drawImage(img, 0, 0, this);\r
\r
}\r
\r
\r
if (bottom == -1 &&\r
!group.sequences.contains(av.alignment.getSequenceAt(i + 1)))\r
- bottom = sy + av.charHeight - 1;\r
+ bottom = sy + av.charHeight -1;\r
\r
if (!inGroup)\r
{\r
\r
searchResults = results;\r
\r
- paintFlag = true;\r
repaint();\r
}\r
\r