@Override
public void paintComponent(Graphics g)
{
- invalidate();
-
Dimension d = getIdPanel().getIdCanvas().getPreferredSize();
idPanelHolder.setPreferredSize(d);
hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));
- validate();
-
- /*
- * set scroll bar positions
- */
- ViewportRanges ranges = av.getRanges();
- setScrollValues(ranges.getStartRes(), ranges.getStartSeq());
}
/**
gg.fillRect(0, 0, imgWidth, image.getHeight());
imageFresh = true;
}
-
+
drawComponent(gg, av.getRanges().getStartRes(),
av.getRanges().getEndRes() + 1);
imageFresh = false;
gg.translate(-transX, 0);
fastPaint = true;
- repaint();
+
+ av.getAlignPanel().alignFrame.repaint();
}
private volatile boolean lastImageGood = false;
gg.translate(0, -transY);
fastPaint = true;
- repaint();
+
+ av.getAlignPanel().alignFrame.repaint();
}
/**
g.setColor(Color.white);
g.fillRect(0, 0, getWidth(), getHeight());
-
+
if (fastPaint)
{
fastPaint = false;
g.drawImage(image, 0, 0, this);
-
+
return;
}
-
+
int oldHeight = imgHeight;
-
+
imgHeight = getHeight();
imgHeight -= (imgHeight % av.getCharHeight());
-
+
if (imgHeight < 1)
{
return;
}
-
+
if (oldHeight != imgHeight || image.getWidth(this) != getWidth())
{
image = new BufferedImage(getWidth(), imgHeight,
BufferedImage.TYPE_INT_RGB);
}
-
+
gg = (Graphics2D) image.getGraphics();
-
+
// Fill in the background
gg.setColor(Color.white);
gg.fillRect(0, 0, getWidth(), imgHeight);
-
+
drawIds(av.getRanges().getStartSeq(), av.getRanges().getEndSeq());
-
+
g.drawImage(image, 0, 0, this);
}
drawPanel(gg, startRes, endRes, startSeq, endSeq, 0);
gg.translate(-transX, -transY);
- repaint();
+ av.getAlignPanel().alignFrame.repaint();
} finally
{
fastpainting = false;
int charHeight = av.getCharHeight();
int charWidth = av.getCharWidth();
-
+
ViewportRanges ranges = av.getRanges();
-
+
int width = getWidth();
int height = getHeight();
-
+
width -= (width % charWidth);
height -= (height % charHeight);
-
+
// selectImage is the selection group outline image
BufferedImage selectImage = drawSelectionGroup(
ranges.getStartRes(), ranges.getEndRes(),
ranges.getStartSeq(), ranges.getEndSeq());
-
+
if ((img != null) && (fastPaint
|| (getVisibleRect().width != g.getClipBounds().width)
|| (getVisibleRect().height != g.getClipBounds().height)))
gg = (Graphics2D) img.getGraphics();
gg.setFont(av.getFont());
}
-
+
if (av.antiAlias)
{
gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
}
-
+
gg.setColor(Color.white);
gg.fillRect(0, 0, img.getWidth(), img.getHeight());
-
+
if (av.getWrapAlignment())
{
drawWrappedPanel(gg, getWidth(), getHeight(), ranges.getStartRes());
drawPanel(gg, ranges.getStartRes(), ranges.getEndRes(),
ranges.getStartSeq(), ranges.getEndSeq(), 0);
}
-
+
// lcimg is a local *copy* of img which we'll draw selectImage on top of
BufferedImage lcimg = buildLocalImage(selectImage);
g.drawImage(lcimg, 0, 0, this);