X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FIdCanvas.java;h=30560d784268caf25ab788903c5a6ad9ac2c7299;hb=ee53965807b83bf93a21cbc341cee9a9e005b2cb;hp=399506ed1a9f73cc59981bcad81b8ff13cda77dc;hpb=0a2dcc2309a1fceb5e3ee8fe1dbbf89572e8e1f3;p=jalview.git diff --git a/src/jalview/appletgui/IdCanvas.java b/src/jalview/appletgui/IdCanvas.java index 399506e..30560d7 100755 --- a/src/jalview/appletgui/IdCanvas.java +++ b/src/jalview/appletgui/IdCanvas.java @@ -177,23 +177,51 @@ public class IdCanvas { Color currentColor = Color.white; Color currentTextColor = Color.black; + Font italic = new Font(av.getFont().getName(), Font.ITALIC, + av.getFont().getSize()); if (av.getWrapAlignment()) { + int annotationHeight = 0; + AnnotationLabels labels = null; - int rowSize = av.getEndRes() - av.getStartRes(); - // Draw the rest of the panels - - for (int ypos = 2 * av.charHeight, row = av.startRes; - ypos <= getSize().height && row < av.alignment.getWidth(); - ypos += av.chunkHeight, row += rowSize) + if(av.showAnnotation) { - for (int i = starty; i < av.alignment.getHeight(); i++) + AnnotationPanel ap = new AnnotationPanel(av); + annotationHeight = ap.adjustPanelHeight(); + labels = new AnnotationLabels(av); + } + + int hgap = av.charHeight; + if (av.scaleAboveWrapped) + hgap += av.charHeight; + + int cHeight = av.getAlignment().getHeight() * av.charHeight + + hgap + + annotationHeight; + + int rowSize = av.getEndRes() - av.getStartRes(); + + // Draw the rest of the panels + for (int ypos = hgap, row = av.startRes; + (ypos <= getSize().height) && (row < av.alignment.getWidth()); + ypos += cHeight, row += rowSize) { - SequenceI s = av.alignment.getSequenceAt(i); - drawIdString(gg, s, i, 0, ypos); + for (int i = starty; i < av.alignment.getHeight(); i++) + { + SequenceI s = av.alignment.getSequenceAt(i); + drawIdString(gg, s, i, 0, ypos); + } + + if(labels!=null) + { + gg.setFont(av.getFont()); + gg.translate(0, ypos+(av.getAlignment().getHeight() * av.charHeight)); + labels.drawComponent(gg, getSize().width); + gg.translate(0, -ypos-(av.getAlignment().getHeight() * av.charHeight)); + gg.setFont(italic); + } } - } } else