X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FIdCanvas.java;h=f4c73800ae3194b98cc5b9ee57e0e4ec01ad389e;hb=627834dc46a79d74dec14c3d7a64a529f2337f6f;hp=9581cccfbcd61a7a82a144327c6d0f5999a2ffce;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 9581ccc..f4c7380 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -18,8 +18,6 @@ */ package jalview.gui; -import jalview.analysis.*; - import jalview.datamodel.*; import java.awt.*; @@ -95,15 +93,9 @@ public class IdCanvas extends JPanel gg.setColor(Color.black); } - String string = s.getName(); - if (av.getShowFullId()) - { - string = s.getDisplayId(); - } - - gg.drawString(string, 0, - (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5)); + gg.drawString( s.getDisplayId(av.getShowJVSuffix()), + 0, (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5)); } /** @@ -192,12 +184,7 @@ public class IdCanvas extends JPanel //Fill in the background gg.setColor(Color.white); gg.fillRect(0, 0, getWidth(), imgHeight); - gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); - Font italic = new Font(av.getFont().getName(), Font.ITALIC, - av.getFont().getSize()); - gg.setFont(italic); drawIds(av.getStartSeq(), av.endSeq); @@ -212,23 +199,56 @@ public class IdCanvas extends JPanel */ void drawIds(int starty, int endy) { + Font italic = new Font(av.getFont().getName(), Font.ITALIC, + av.getFont().getSize()); + gg.setFont(italic); + gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + Color currentColor = Color.white; Color currentTextColor = Color.black; if (av.getWrapAlignment()) { + int annotationHeight = 0; + AnnotationLabels labels = null; + + if(av.showAnnotation) + { + 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 = 2 * av.charHeight, row = av.startRes; + for (int ypos = hgap, row = av.startRes; (ypos <= getHeight()) && (row < av.alignment.getWidth()); - ypos += av.chunkHeight, row += rowSize) + ypos += cHeight, row += rowSize) { for (int i = starty; i < av.alignment.getHeight(); i++) { SequenceI s = av.alignment.getSequenceAt(i); + gg.setFont(italic); drawIdString(gg, s, i, 0, ypos); } + + if(labels!=null) + { + gg.translate(0, ypos+(av.getAlignment().getHeight() * av.charHeight)); + labels.drawComponent(gg, getWidth()); + gg.translate(0, -ypos-(av.getAlignment().getHeight() * av.charHeight)); + + } } } else @@ -264,12 +284,7 @@ public class IdCanvas extends JPanel gg.setColor(currentTextColor); - String string = av.alignment.getSequenceAt(i).getName(); - - if (av.getShowFullId()) - { - string = av.alignment.getSequenceAt(i).getDisplayId(); - } + String string = av.alignment.getSequenceAt(i).getDisplayId( av.getShowJVSuffix()); gg.drawString(string, 0, (((i - starty) * av.charHeight) + av.charHeight) -