X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FIdCanvas.java;h=97730191def5251c84a5dac291a872a995deae1a;hb=32ce9ddb7ce1a68add53dd81785ae428ca136a83;hp=399506ed1a9f73cc59981bcad81b8ff13cda77dc;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/appletgui/IdCanvas.java b/src/jalview/appletgui/IdCanvas.java index 399506e..9773019 100755 --- a/src/jalview/appletgui/IdCanvas.java +++ b/src/jalview/appletgui/IdCanvas.java @@ -21,7 +21,6 @@ package jalview.appletgui; import java.awt.*; -import jalview.analysis.*; import jalview.datamodel.*; public class IdCanvas @@ -75,13 +74,8 @@ public class IdCanvas gg.setColor(Color.black); } - String string = s.getName(); - if (av.getShowFullId()) - { - string = s.getDisplayId(); - } - gg.drawString(string, 0, + gg.drawString( s.getDisplayId(av.getShowJVSuffix()), 0, ((i - starty) * charHeight) + ypos + charHeight - (charHeight / 5)); @@ -177,23 +171,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 @@ -233,12 +255,9 @@ public class IdCanvas av.charHeight); gg.setColor(currentTextColor); - String string = av.alignment.getSequenceAt(i).getName(); - if (av.getShowFullId()) - { - string = av.alignment.getSequenceAt(i).getDisplayId(); - } - gg.drawString(string, 0, + + gg.drawString(av.alignment.getSequenceAt(i) + .getDisplayId(av.getShowJVSuffix()), 0, ((i - starty) * av.charHeight) + av.charHeight - (av.charHeight / 5)); }