gg.translate(0, transY);
- drawIds(gg, av, ss, es, searchResults,true);
+ drawIds(gg, av, ss, es, searchResults, true, getWidth());
gg.translate(0, -transY);
gg.fillRect(0, 0, getWidth(), imgHeight);
drawIds(gg, av, av.getRanges().getStartSeq(),
- av.getRanges().getEndSeq(), searchResults,true);
+ av.getRanges().getEndSeq(), searchResults,true, getWidth());
gg.dispose();
* @param startSeq
* @param endSeq
* @param selection
+ * @param forGUI when false rendering for print
+ * @param panelWidth width used to calculate righthand margin - usually idCanvas.getWidth()
+ *
*/
void drawIds(Graphics2D g, AlignViewport alignViewport,
- final int startSeq, final int endSeq, List<SequenceI> selection, boolean forGUI)
+ final int startSeq, final int endSeq, List<SequenceI> selection, boolean forGUI, int panelWidth)
{
Font font = alignViewport.getFont();
if (alignViewport.isSeqNameItalics())
if (alignViewport.getWrapAlignment())
{
- drawIdsWrapped(g, alignViewport, startSeq, getHeight());
+ drawIdsWrapped(g, alignViewport, startSeq, getHeight(), manuallyAdjusted ? panelWidth : -1,forGUI);
return;
}
// Now draw the id strings
- int panelWidth = getWidth();
int xPos = 0;
// Now draw the id strings
drawIdsWrapped(g, av2, totalHeight, totalHeight, i,false);
}
- void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
+ public void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
int startSeq, int pageHeight, int idWidth, boolean forGUI)
{
int alignmentWidth = alignViewport.getAlignment().getWidth();
AnnotationLabels labels = null;
if (alignViewport.isShowAnnotation())
{
+ // in wrapped mode, no alignPanel reference is available
+ // FIXME: make the renderer not create a new object in wrapped mode everytime!
labels = new AnnotationLabels(alignViewport);
}
if (!isManuallyAdjusted())
{
int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,forGUI,
- null);
+ null, false);
thisIdWidth = idWidth < 0 ? getAnnotationsIdWidth : idWidth;
if (thisIdWidth > getWidth)
{