if (e.isShiftDown())
{
e.consume();
- if (e.getWheelRotation() > 0)
+ double wheelRotation = e.getPreciseWheelRotation();
+ if (wheelRotation > 0)
{
av.getRanges().scrollRight(true);
}
- else
+ else if (wheelRotation < 0)
{
av.getRanges().scrollRight(false);
}
if (av.hasHiddenColumns())
{
column = av.getAlignment().getHiddenColumns()
- .adjustForHiddenColumns(column);
+ .visibleToAbsoluteColumn(column);
}
AlignmentAnnotation ann = aa[row];
{
this.setToolTipText(JvSwingUtils.wrapTooltip(true, description));
}
+ else
+ {
+ this.setToolTipText(null); // no tooltip if null or empty description
+ }
}
else
{
@Override
public void paintComponent(Graphics g)
{
+ super.paintComponent(g);
+
g.setColor(Color.white);
g.fillRect(0, 0, getWidth(), getHeight());
gg.fillRect(0, 0, imgWidth, image.getHeight());
imageFresh = true;
}
-
+
drawComponent(gg, av.getRanges().getStartRes(),
av.getRanges().getEndRes() + 1);
imageFresh = false;
int er = av.getRanges().getEndRes() + 1;
int transX = 0;
- long stime = System.currentTimeMillis();
gg.copyArea(0, 0, imgWidth, getHeight(),
-horizontal * av.getCharWidth(), 0);
- long mtime = System.currentTimeMillis();
if (horizontal > 0) // scrollbar pulled right, image to the left
{
drawComponent(gg, sr, er);
gg.translate(-transX, 0);
- long dtime = System.currentTimeMillis();
+
fastPaint = true;
- repaint();
- long rtime = System.currentTimeMillis();
- if (debugRedraw)
- {
- System.err.println("Scroll:\t" + horizontal + "\tCopyArea:\t"
- + (mtime - stime) + "\tDraw component:\t" + (dtime - mtime)
- + "\tRepaint call:\t" + (rtime - dtime));
- }
+ // Call repaint on alignment panel so that repaints from other alignment
+ // panel components can be aggregated. Otherwise performance of the overview
+ // window and others may be adversely affected.
+ av.getAlignPanel().repaint();
}
private volatile boolean lastImageGood = false;
{
fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
}
+ else if (evt.getPropertyName().equals(ViewportRanges.STARTRESANDSEQ))
+ {
+ fastPaint(((int[]) evt.getNewValue())[0]
+ - ((int[]) evt.getOldValue())[0]);
+ }
+ else if (evt.getPropertyName().equals(ViewportRanges.MOVE_VIEWPORT))
+ {
+ repaint();
+ }
}
}