PaintRefresher.Register(this, av.getSequenceSetId());
}
- public void drawIdString(Graphics gg, SequenceI s, int i, int starty,
- int ypos)
+ public void drawIdString(Graphics gg, boolean hiddenRows, SequenceI s,
+ int i, int starty, int ypos)
{
int charHeight = av.getCharHeight();
((i - starty) * charHeight) + ypos + charHeight
- (charHeight / 5));
- if (av.hasHiddenRows() && av.getShowHiddenMarkers())
+ if (hiddenRows)
{
drawMarker(i, starty, ypos);
}
gg.copyArea(0, 0, getSize().width, imgHeight, 0,
-vertical * av.getCharHeight());
- int ss = av.startSeq, es = av.endSeq, transY = 0;
+ int ss = av.getStartSeq(), es = av.getEndSeq(), transY = 0;
if (vertical > 0) // scroll down
{
ss = es - vertical;
- if (ss < av.startSeq) // ie scrolling too fast, more than a page at a time
+ if (ss < av.getStartSeq()) // ie scrolling too fast, more than a page at a
+ // time
{
- ss = av.startSeq;
+ ss = av.getStartSeq();
}
else
{
- transY = imgHeight - vertical * av.getCharHeight();
+ transY = imgHeight - ((vertical + 1) * av.getCharHeight());
}
}
else if (vertical < 0)
{
es = ss - vertical;
- if (es > av.endSeq)
+ if (es > av.getEndSeq())
{
- es = av.endSeq;
+ es = av.getEndSeq();
}
}
repaint();
}
+ @Override
public void update(Graphics g)
{
paint(g);
}
+ @Override
public void paint(Graphics g)
{
if (getSize().height < 0 || getSize().width < 0)
gg.setFont(italic);
gg.fillRect(0, 0, getSize().width, getSize().height);
- drawIds(av.startSeq, av.endSeq);
+ drawIds(av.getStartSeq(), av.getEndSeq());
g.drawImage(image, 0, 0, this);
}
* local copy of av.getCharHeight set at top of drawIds
*/
private int avcharHeight;
+
void drawIds(int starty, int endy)
{
// hardwired italic IDs in applet currently
Color currentColor = Color.white;
Color currentTextColor = Color.black;
+ final boolean doHiddenCheck = av.isDisplayReferenceSeq()
+ || av.hasHiddenRows(), hiddenRows = av.hasHiddenRows()
+ && av.getShowHiddenMarkers();
+
if (av.getWrapAlignment())
{
int maxwidth = av.getAlignment().getWidth();
int cHeight = alheight * avcharHeight + hgap + annotationHeight;
int rowSize = av.getEndRes() - av.getStartRes();
-
// Draw the rest of the panels
- for (int ypos = hgap, row = av.startRes; (ypos <= getSize().height)
+ for (int ypos = hgap, row = av.getStartRes(); (ypos <= getSize().height)
&& (row < maxwidth); ypos += cHeight, row += rowSize)
{
for (int i = starty; i < alheight; i++)
SequenceI s = av.getAlignment().getSequenceAt(i);
gg.setFont(italic);
- if (av.isDisplayReferenceSeq() || av.hasHiddenRows())
+ if (doHiddenCheck)
{
setHiddenFont(s);
}
- drawIdString(gg, s, i, 0, ypos);
+ drawIdString(gg, hiddenRows, s, i, 0, ypos);
}
if (labels != null)
{
// Now draw the id strings
SequenceI seq;
- for (int i = starty; i < endy; i++)
+ for (int i = starty; i <= endy; i++)
{
seq = av.getAlignment().getSequenceAt(i);
}
gg.setFont(italic);
// boolean isrep=false;
- if (av.isDisplayReferenceSeq() || av.hasHiddenRows())
+ if (doHiddenCheck)
{
// isrep =
setHiddenFont(seq);
(((i - starty) * avcharHeight) + avcharHeight)
- (avcharHeight / 5));
- if (av.hasHiddenRows() && av.getShowHiddenMarkers())
+ if (hiddenRows)
{
drawMarker(i, starty, 0);
}
gg.setColor(Color.blue);
if (below)
{
- gg.fillPolygon(new int[]
- { getSize().width - avcharHeight, getSize().width - avcharHeight,
- getSize().width }, new int[]
- { (i - starty) * avcharHeight + yoffset,
+ 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,
+ 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);
Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont()
.getSize());
- if (av.isHiddenRepSequence(seq))
+ if (av.isReferenceSeq(seq) || av.isHiddenRepSequence(seq))
{
gg.setFont(bold);
return true;