BufferedImage image;
- Graphics2D gg;
+// Graphics2D gg;
int imgHeight = 0;
*/
public void fastPaint(int vertical)
{
+
/*
* for now, not attempting fast paint of wrapped ids...
*/
- if (gg == null || av.getWrapAlignment())
+ if (image == null || av.getWrapAlignment())
{
repaint();
ViewportRanges ranges = av.getRanges();
+ Graphics2D gg = image.createGraphics();
gg.copyArea(0, 0, getWidth(), imgHeight, 0,
-vertical * av.getCharHeight());
gg.translate(0, -transY);
+ gg.dispose();
+
fastPaint = true;
// Call repaint on alignment panel so that repaints from other alignment
@Override
public void paintComponent(Graphics g)
{
- super.paintComponent(g);
-
g.setColor(Color.white);
g.fillRect(0, 0, getWidth(), getHeight());
BufferedImage.TYPE_INT_RGB);
}
- gg = (Graphics2D) image.getGraphics();
+ Graphics2D gg = image.createGraphics();
// Fill in the background
gg.setColor(Color.white);
gg.fillRect(0, 0, getWidth(), imgHeight);
drawIds(gg, av, av.getRanges().getStartSeq(), av.getRanges().getEndSeq(), searchResults);
+
+ gg.dispose();
g.drawImage(image, 0, 0, this);
}