From 6ddf2d553aee329db44dd36b564211c3880563ec Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Mar 2006 15:29:10 +0000 Subject: [PATCH] Hidden Rows --- src/jalview/gui/IdCanvas.java | 45 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index c2500c2..214f218 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -239,6 +239,7 @@ 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); @@ -256,13 +257,33 @@ public class IdCanvas extends JPanel 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; } @@ -282,7 +303,23 @@ public class IdCanvas extends JPanel gg.setColor(currentColor); gg.fillRect(0, (i - starty) * av.charHeight, getWidth(), - av.charHeight); + av.charHeight); + + if (markHidden) + { + 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); @@ -294,8 +331,8 @@ public class IdCanvas extends JPanel } // 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()); } } -- 1.7.10.2