Hidden Rows
authoramwaterhouse <Andrew Waterhouse>
Thu, 16 Mar 2006 15:29:10 +0000 (15:29 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 16 Mar 2006 15:29:10 +0000 (15:29 +0000)
src/jalview/gui/IdCanvas.java

index c2500c2..214f218 100755 (executable)
@@ -239,6 +239,7 @@ public class IdCanvas extends JPanel
             {\r
                 for (int i = starty; i < av.alignment.getHeight(); i++)\r
                 {\r
+\r
                     SequenceI s = av.alignment.getSequenceAt(i);\r
                     gg.setFont(italic);\r
                     drawIdString(gg, s, i, 0, ypos);\r
@@ -256,13 +257,33 @@ public class IdCanvas extends JPanel
         else\r
         {\r
             //Now draw the id strings\r
+            int tmp, hiddenIndex = starty;\r
+            boolean markHidden = false;\r
             for (int i = starty; i < endy; i++)\r
             {\r
+              if (av.hasHiddenRows)\r
+              {\r
+                tmp = av.adjustForHiddenSeqs(i);\r
+                if(hiddenIndex != tmp)\r
+                {\r
+                    hiddenIndex = tmp;\r
+                    markHidden = true;\r
+                }\r
+                else\r
+                  markHidden = false;\r
+\r
+                hiddenIndex++;\r
+              }\r
+\r
+              if(av.hasHiddenRows && av.alignment.getSequenceAt(i).getHiddenSequences()!=null)\r
+              {\r
+                currentTextColor = Color.blue;\r
+              }\r
+              else\r
                 // Selected sequence colours\r
                 if ((searchResults != null) &&\r
                         searchResults.contains(av.alignment.getSequenceAt(i)))\r
                 {\r
-                    gg.setColor(Color.black);\r
                     currentColor = Color.black;\r
                     currentTextColor = Color.white;\r
                 }\r
@@ -282,7 +303,23 @@ public class IdCanvas extends JPanel
                 gg.setColor(currentColor);\r
 \r
                 gg.fillRect(0, (i - starty) * av.charHeight, getWidth(),\r
-                    av.charHeight);\r
+                            av.charHeight);\r
+\r
+                if (markHidden)\r
+                {\r
+                  gg.setColor(Color.blue);\r
+               //   gg.drawLine(0, (i-starty)*av.charHeight, getWidth(),(i-starty)*av.charHeight);\r
+                  gg.fillPolygon(new int[] { getWidth() - av.charHeight,\r
+                                         getWidth() - av.charHeight,\r
+                                         getWidth() },\r
+                                new int[]\r
+                                {\r
+                                    (i-starty)*av.charHeight -av.charHeight/4,\r
+                                    (i-starty)*av.charHeight +av.charHeight/4,\r
+                                    (i-starty)*av.charHeight\r
+                                }, 3);\r
+\r
+                }\r
 \r
                 gg.setColor(currentTextColor);\r
 \r
@@ -294,8 +331,8 @@ public class IdCanvas extends JPanel
             }\r
 \r
             // add a border\r
-            gg.setColor(Color.white);\r
-            gg.fillRect(getWidth() - 4, 0, 4, getHeight());\r
+         //   gg.setColor(Color.cyan);\r
+          //  gg.fillRect(getWidth() - 4, 0, 4, getHeight());\r
         }\r
     }\r
 \r