Control and alt for toggle hide
authoramwaterhouse <Andrew Waterhouse>
Thu, 17 Aug 2006 10:08:02 +0000 (10:08 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 17 Aug 2006 10:08:02 +0000 (10:08 +0000)
src/jalview/appletgui/AlignFrame.java
src/jalview/gui/AlignmentPanel.java

index 64423b0..0c7f5d1 100755 (executable)
@@ -331,20 +331,29 @@ public class AlignFrame extends Frame implements ActionListener,
         break;\r
       case KeyEvent.VK_H:\r
       {\r
-        SequenceGroup sg = viewport.getSelectionGroup();\r
+        boolean toggleSeqs = !evt.isControlDown();\r
+        boolean toggleCols = !evt.isAltDown();\r
         boolean hide = false;\r
-        if (sg != null && sg.getSize(false) != viewport.alignment.getHeight())\r
+        SequenceGroup sg = viewport.getSelectionGroup();\r
+\r
+        if(toggleSeqs)\r
         {\r
-          hide = true;\r
-          viewport.hideAllSelectedSeqs();\r
+          if (sg != null && sg.getSize(false) != viewport.alignment.getHeight())\r
+          {\r
+            hide = true;\r
+            viewport.hideAllSelectedSeqs();\r
+          }\r
+          else\r
+            viewport.showAllHiddenSeqs();\r
         }\r
-        else if (viewport.colSel.getSelected().size() < 1)\r
-          viewport.showAllHiddenSeqs();\r
 \r
-        if (viewport.colSel.getSelected().size() > 0)\r
-          viewport.hideSelectedColumns();\r
-        else if (!hide)\r
-          viewport.showAllHiddenColumns();\r
+        if(toggleCols)\r
+        {\r
+          if (viewport.colSel.getSelected().size() > 0)\r
+            viewport.hideSelectedColumns();\r
+          else if (!hide)\r
+            viewport.showAllHiddenColumns();\r
+        }\r
 \r
         alignPanel.repaint();\r
         break;\r
index c0de33e..f7cc054 100755 (executable)
@@ -237,21 +237,29 @@ public class AlignmentPanel extends GAlignmentPanel
             break;\r
           case KeyEvent.VK_H:\r
           {\r
-            SequenceGroup sg = av.getSelectionGroup();\r
+            boolean toggleSeqs = !evt.isControlDown();\r
+            boolean toggleCols = !evt.isAltDown();\r
             boolean hide = false;\r
-            if(sg!=null && sg.getSize(false)!=av.alignment.getHeight())\r
-            {\r
-              hide = true;\r
-              alignFrame.hideSelSequences_actionPerformed(null);\r
-            }\r
-            else if(av.colSel.getSelected().size()<1)\r
-              alignFrame.showAllSeqs_actionPerformed(null);\r
-\r
-            if(av.colSel.getSelected().size()>0)\r
-              alignFrame.hideSelColumns_actionPerformed(null);\r
-            else if(!hide)\r
-              alignFrame.showAllColumns_actionPerformed(null);\r
 \r
+            SequenceGroup sg = av.getSelectionGroup();\r
+            if(toggleSeqs)\r
+             {\r
+               if(sg != null && sg.getSize(false) != av.alignment.getHeight())\r
+               {\r
+                 alignFrame.hideSelSequences_actionPerformed(null);\r
+                 hide = true;\r
+               }\r
+               else\r
+                 alignFrame.showAllSeqs_actionPerformed(null);\r
+             }\r
+\r
+             if (toggleCols)\r
+             {\r
+               if(av.colSel.getSelected().size() > 0)\r
+                 alignFrame.hideSelColumns_actionPerformed(null);\r
+               else if(!hide)\r
+                 alignFrame.showAllColumns_actionPerformed(null);\r
+             }\r
             break;\r
           }\r
 \r