* DOCUMENT ME!
*
* @param g
- * DOCUMENT ME!
+ * DOCUMENT ME!
* @param hiddenRows
- * true - check and display hidden row marker if need be
+ * true - check and display hidden row marker if need be
* @param s
- * DOCUMENT ME!
+ * DOCUMENT ME!
* @param i
- * DOCUMENT ME!
+ * DOCUMENT ME!
* @param starty
- * DOCUMENT ME!
+ * DOCUMENT ME!
* @param ypos
- * DOCUMENT ME!
+ * DOCUMENT ME!
+ * @param idWidth
*/
public void drawIdString(Graphics2D g, boolean hiddenRows, SequenceI s,
- int i, int starty, int ypos)
+ int i, int starty, int ypos, int idWidth)
{
int xPos = 0;
int panelWidth = getWidth();
if (hiddenRows)
{
- drawMarker(g, av, i, starty, ypos);
+ drawMarker(g, av, i, starty, ypos, idWidth);
}
}
gg.translate(0, transY);
- drawIds(gg, av, ss, es, searchResults);
+ drawIds(gg, av, ss, es, searchResults, getWidth());
gg.translate(0, -transY);
gg.setColor(Color.white);
gg.fillRect(0, 0, getWidth(), imgHeight);
- drawIds(gg, av, av.getRanges().getStartSeq(), av.getRanges().getEndSeq(), searchResults);
+ drawIds(gg, av, av.getRanges().getStartSeq(), av.getRanges().getEndSeq(), searchResults, getWidth());
g.drawImage(image, 0, 0, this);
}
/**
* Draws sequence ids from sequence index startSeq to endSeq (inclusive), with
* the font and other display settings configured on the viewport. Ids of
- * sequences included in the selection are coloured grey, otherwise the
- * current id colour for the sequence id is used.
+ * sequences included in the selection are coloured grey, otherwise the current
+ * id colour for the sequence id is used.
*
* @param g
* @param alignViewport
* @param startSeq
* @param endSeq
* @param selection
+ * @param idWidth
*/
void drawIds(Graphics2D g, AlignViewport alignViewport, final int startSeq,
- final int endSeq, List<SequenceI> selection)
+ final int endSeq, List<SequenceI> selection, int idWidth)
{
Font font = alignViewport.getFont();
if (alignViewport.isSeqNameItalics())
if (alignViewport.getWrapAlignment())
{
- drawIdsWrapped(g, alignViewport, startSeq, getHeight());
+ drawIdsWrapped(g, alignViewport, startSeq, getHeight(), getWidth());
return;
}
if (hasHiddenRows)
{
- drawMarker(g, alignViewport, i, startSeq, 0);
+ drawMarker(g, alignViewport, i, startSeq, 0, idWidth);
}
}
}
* @param g
* @param alignViewport
* @param startSeq
+ * @param idWidth
*/
void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
- int startSeq, int pageHeight)
+ int startSeq, int pageHeight, int idWidth)
{
int alignmentWidth = alignViewport.getAlignment().getWidth();
final int alheight = alignViewport.getAlignment().getHeight();
{
g.setFont(getIdfont());
}
- drawIdString(g, hasHiddenRows, s, i, 0, ypos);
+ drawIdString(g, hasHiddenRows, s, i, 0, ypos, idWidth);
}
if (labels != null && alignViewport.isShowAnnotation())
}
/**
- * Draws a marker (a blue right-pointing triangle) between sequences to
- * indicate hidden sequences.
+ * Draws a marker (a blue right-pointing triangle) between sequences to indicate
+ * hidden sequences.
*
* @param g
* @param alignViewport
* @param seqIndex
* @param starty
* @param yoffset
+ * @param idWidth
*/
- void drawMarker(Graphics2D g, AlignViewport alignViewport, int seqIndex, int starty, int yoffset)
+ void drawMarker(Graphics2D g, AlignViewport alignViewport, int seqIndex, int starty, int yoffset, int idWidth)
{
SequenceI[] hseqs = alignViewport.getAlignment()
.getHiddenSequences().hiddenSequences;
/*
* vertices of the triangle, below or above hidden seqs
*/
- int[] xPoints = new int[]
- { getWidth() - charHeight,
- getWidth() - charHeight, getWidth() };
+ int[] xPoints = new int[] { idWidth - charHeight, idWidth - charHeight,
+ idWidth };
int yShift = seqIndex - starty;
if (below)