X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=e2c91ba15bd769b9a19faa91b50069530038ce44;hb=155a17a423e980849fd4dc5f857da1a72b0010b9;hp=63455cb76cb5a88b54017903de874afbaec6b7be;hpb=a19aa5efc2e64c17927336f422adde1837c27042;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 63455cb..e2c91ba 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -340,8 +340,9 @@ public class AlignmentPanel extends GAlignmentPanel implements { if (Jalview.isHeadlessMode()) { - AnnotationLabels aal = this.getAlabels(); - int stringWidth = aal.drawLabels(null, false, idWidth, false, fm); + AnnotationLabels aal = getAlabels(); + int stringWidth = aal.drawLabels(null, false, idWidth, false, false, + fm); idWidth = Math.max(idWidth, stringWidth); } else @@ -566,7 +567,7 @@ public class AlignmentPanel extends GAlignmentPanel implements // this is called after loading new annotation onto alignment if (alignFrame.getHeight() == 0) { - System.out.println("NEEDS FIXING"); + jalview.bin.Console.outPrintln("NEEDS FIXING"); } validateAnnotationDimensions(true); addNotify(); @@ -628,7 +629,7 @@ public class AlignmentPanel extends GAlignmentPanel implements boolean wrap = av.getWrapAlignment(); ViewportRanges ranges = av.getRanges(); ranges.setStartSeq(0); - scalePanelHolder.setVisible(!wrap); + // scalePanelHolder.setVisible(!wrap); hscroll.setVisible(!wrap); // Allow idPanel width adjustment in wrap mode idwidthAdjuster.setVisible(true); @@ -898,6 +899,9 @@ public class AlignmentPanel extends GAlignmentPanel implements // need to make some adjustments idWidth -= (sc.getMinimumWrappedCanvasWidth() - sc.getWidth()); av.setIdWidth(idWidth); + av.getAlignPanel().getIdPanel().getIdCanvas() + .setManuallyAdjusted(true); + validateAnnotationDimensions(false); } } @@ -994,7 +998,15 @@ public class AlignmentPanel extends GAlignmentPanel implements Graphics idGraphics, Graphics alignmentGraphics) throws PrinterException { - final int idWidth = getVisibleIdWidth(false); + final int idWidth; + if (getIdPanel()!=null && getIdPanel().getWidth()>0) + { + // use the current IdPanel's width, if its set and non-zero + idWidth = getIdPanel().getWidth(); + } else { + // otherwise calculate it + idWidth = getVisibleIdWidth(false); + } /* * Get the horizontal offset to where we draw the sequences. @@ -1061,7 +1073,7 @@ public class AlignmentPanel extends GAlignmentPanel implements List selection = av.getSelectionGroup() == null ? null : av.getSelectionGroup().getSequences(null); idCanvas.drawIds((Graphics2D) idGraphics, av, startSeq, endSeq - 1, - selection); + selection, false); idGraphics.setFont(av.getFont()); idGraphics.translate(0, -scaleHeight); @@ -1085,7 +1097,7 @@ public class AlignmentPanel extends GAlignmentPanel implements int offset = getAlabels().getScrollOffset(); idGraphics.translate(0, -offset); idGraphics.translate(0, alignmentDrawnHeight); - getAlabels().drawComponent(idGraphics, idWidth); + getAlabels().drawComponentNotGUI(idGraphics, idWidth); idGraphics.translate(0, -alignmentDrawnHeight); /* @@ -1166,7 +1178,7 @@ public class AlignmentPanel extends GAlignmentPanel implements * draw sequence ids and annotation labels (if shown) */ IdCanvas idCanvas = getIdPanel().getIdCanvas(); - idCanvas.drawIdsWrapped((Graphics2D) g, av, 0, totalHeight); + idCanvas.drawIdsWrappedNoGUI((Graphics2D) g, av, 0, totalHeight); g.translate(idWidth, 0); @@ -1226,7 +1238,7 @@ public class AlignmentPanel extends GAlignmentPanel implements throws ImageOutputException { makeAlignmentImage(type, file, renderer, - BitmapImageSizing.nullBitmapImageSizing()); + BitmapImageSizing.defaultBitmapImageSizing()); } /**