X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FIdCanvas.java;h=214f218c0294d16a65cecb7111c4c5669c5bf917;hb=a853fae4d9d4dbc80e877741c017fca7ee80c59e;hp=2951c14358db46c7710dd01ca1981bcb2c7b1ce9;hpb=ce728f87f1f43be3041ef02f7f2cc2e39314711a;p=jalview.git diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 2951c14..214f218 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,17 +199,27 @@ 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); + + if (av.antiAlias) + 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; @@ -242,21 +239,51 @@ public class IdCanvas extends JPanel { 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 { //Now draw the id strings + int tmp, hiddenIndex = starty; + boolean markHidden = false; for (int i = starty; i < endy; i++) { + if (av.hasHiddenRows) + { + tmp = av.adjustForHiddenSeqs(i); + if(hiddenIndex != tmp) + { + hiddenIndex = tmp; + markHidden = true; + } + else + markHidden = false; + + hiddenIndex++; + } + + if(av.hasHiddenRows && av.alignment.getSequenceAt(i).getHiddenSequences()!=null) + { + currentTextColor = Color.blue; + } + else // Selected sequence colours if ((searchResults != null) && searchResults.contains(av.alignment.getSequenceAt(i))) { - gg.setColor(Color.black); currentColor = Color.black; currentTextColor = Color.white; } @@ -276,25 +303,36 @@ public class IdCanvas extends JPanel gg.setColor(currentColor); gg.fillRect(0, (i - starty) * av.charHeight, getWidth(), - av.charHeight); - - gg.setColor(currentTextColor); + av.charHeight); - String string = av.alignment.getSequenceAt(i).getName(); - - if (av.getShowFullId()) + if (markHidden) { - string = av.alignment.getSequenceAt(i).getDisplayId(); + gg.setColor(Color.blue); + // gg.drawLine(0, (i-starty)*av.charHeight, getWidth(),(i-starty)*av.charHeight); + gg.fillPolygon(new int[] { getWidth() - av.charHeight, + getWidth() - av.charHeight, + getWidth() }, + new int[] + { + (i-starty)*av.charHeight -av.charHeight/4, + (i-starty)*av.charHeight +av.charHeight/4, + (i-starty)*av.charHeight + }, 3); + } + gg.setColor(currentTextColor); + + String string = av.alignment.getSequenceAt(i).getDisplayId( av.getShowJVSuffix()); + gg.drawString(string, 0, (((i - starty) * av.charHeight) + av.charHeight) - (av.charHeight / 5)); } // add a border - gg.setColor(Color.white); - gg.fillRect(getWidth() - 4, 0, 4, getHeight()); + // gg.setColor(Color.cyan); + // gg.fillRect(getWidth() - 4, 0, 4, getHeight()); } }