public void fastPaint(int vertical)
{
- if (gg == null)
+ if (gg == null || av.getWrapAlignment())
{
repaint();
return;
ss = es - vertical;
if (ss < ranges.getStartSeq()) // ie scrolling too fast, more than a page
// at a
- // time
+ // time
{
ss = ranges.getStartSeq();
}
// Fill in the background
gg.setColor(Color.white);
- Font italic = new Font(av.getFont().getName(), Font.ITALIC, av
- .getFont().getSize());
+ Font italic = new Font(av.getFont().getName(), Font.ITALIC,
+ av.getFont().getSize());
gg.setFont(italic);
gg.fillRect(0, 0, getSize().width, getSize().height);
continue;
}
// hardwired italic IDs in applet currently
- Font italic = new Font(av.getFont().getName(), Font.ITALIC, av
- .getFont().getSize());
+ Font italic = new Font(av.getFont().getName(), Font.ITALIC,
+ av.getFont().getSize());
gg.setFont(italic);
// boolean isrep=false;
if (doHiddenCheck)
protected void drawIdsWrapped(int starty, final boolean doHiddenCheck,
boolean hiddenRows)
{
- int maxwidth = av.getAlignment().getWidth();
+ int maxwidth = av.getAlignment().getVisibleWidth();
int alheight = av.getAlignment().getHeight();
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .findColumnPosition(maxwidth) - 1;
- }
-
int annotationHeight = 0;
AnnotationLabels labels = null;
int cHeight = alheight * avcharHeight + hgap + annotationHeight;
- int rowSize = av.getRanges().getEndRes()
- - av.getRanges().getStartRes();
+ int rowSize = av.getRanges().getViewportWidth();
// hardwired italic IDs in applet currently
- Font italic = new Font(av.getFont().getName(), Font.ITALIC, av
- .getFont().getSize());
+ Font italic = new Font(av.getFont().getName(), Font.ITALIC,
+ av.getFont().getSize());
gg.setFont(italic);
/*
* draw repeating sequence ids until out of sequence data or
* out of visible space, whichever comes first
*/
- for (int ypos = hgap, row = av.getRanges().getStartRes(); (ypos <= getSize().height)
- && (row < maxwidth); ypos += cHeight, row += rowSize)
+ int ypos = hgap;
+ int row = av.getRanges().getStartRes();
+ while ((ypos <= getHeight()) && (row < maxwidth))
{
for (int i = starty; i < alheight; i++)
{
labels.drawComponent(gg, getSize().width);
gg.translate(0, -ypos - (alheight * avcharHeight));
}
+ ypos += cHeight;
+ row += rowSize;
}
}
void drawMarker(int i, int starty, int yoffset)
{
- SequenceI[] hseqs = av.getAlignment().getHiddenSequences().hiddenSequences;
+ SequenceI[] hseqs = av.getAlignment()
+ .getHiddenSequences().hiddenSequences;
// Use this method here instead of calling hiddenSeq adjust
// 3 times.
int hSize = hseqs.length;
gg.setColor(Color.blue);
if (below)
{
- gg.fillPolygon(new int[] { getSize().width - avcharHeight,
- getSize().width - avcharHeight, getSize().width }, new int[] {
- (i - starty) * avcharHeight + yoffset,
- (i - starty) * avcharHeight + yoffset + avcharHeight / 4,
- (i - starty) * avcharHeight + yoffset }, 3);
+ gg.fillPolygon(
+ new int[]
+ { getSize().width - avcharHeight,
+ getSize().width - avcharHeight, getSize().width },
+ new int[]
+ { (i - starty) * avcharHeight + yoffset,
+ (i - starty) * avcharHeight + yoffset + avcharHeight / 4,
+ (i - starty) * avcharHeight + yoffset },
+ 3);
}
if (above)
{
- gg.fillPolygon(new int[] { getSize().width - avcharHeight,
- getSize().width - avcharHeight, getSize().width }, new int[] {
- (i - starty + 1) * avcharHeight + yoffset,
- (i - starty + 1) * avcharHeight + yoffset - avcharHeight / 4,
- (i - starty + 1) * avcharHeight + yoffset }, 3);
+ gg.fillPolygon(
+ new int[]
+ { getSize().width - avcharHeight,
+ getSize().width - avcharHeight, getSize().width },
+ new int[]
+ { (i - starty + 1) * avcharHeight + yoffset,
+ (i - starty + 1) * avcharHeight + yoffset
+ - avcharHeight / 4,
+ (i - starty + 1) * avcharHeight + yoffset },
+ 3);
}
}
boolean setHiddenFont(SequenceI seq)
{
- Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont()
- .getSize());
+ Font bold = new Font(av.getFont().getName(), Font.BOLD,
+ av.getFont().getSize());
if (av.isReferenceSeq(seq) || av.isHiddenRepSequence(seq))
{
{
String propertyName = evt.getPropertyName();
if (propertyName.equals(ViewportRanges.STARTSEQ)
- || (av.getWrapAlignment() && propertyName
- .equals(ViewportRanges.STARTRES)))
+ || (av.getWrapAlignment()
+ && propertyName.equals(ViewportRanges.STARTRES)))
{
fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
}
+ else if (propertyName.equals(ViewportRanges.STARTRESANDSEQ))
+ {
+ fastPaint(((int[]) evt.getNewValue())[1]
+ - ((int[]) evt.getOldValue())[1]);
+ }
+ else if (propertyName.equals(ViewportRanges.MOVE_VIEWPORT))
+ {
+ repaint();
+ }
}
}