clear selection with escape key
[jalview.git] / src / jalview / gui / ColourKey.java
index 4dd62a2..6d6646e 100755 (executable)
@@ -116,8 +116,8 @@ protected void taylorMenuItem_actionPerformed(ActionEvent e)
 {\r
   menu.setText("Taylor colour scheme");\r
   String [] res = new String[]{"A","V","I","L","M","F","Y","W","H","R","K","N","Q","E","D","S","T","G","P","C"};\r
-  Color [] col = new Color[20];\r
-  for (int i=0; i<20; i++)\r
+  Color [] col = new Color[res.length];\r
+  for (int i=0; i<res.length; i++)\r
     col[i] = ResidueProperties.taylor[ ((Integer)ResidueProperties.aaHash.get(res[i])).intValue() ];\r
 \r
 \r
@@ -130,10 +130,10 @@ protected void hydroMenuItem_actionPerformed(ActionEvent e)
 \r
   menu.setText("Hydrophobicity colour scheme");\r
   String [] res = new String[]{"I","V","L","F","C","M","A","G","X","T","S","W","Y","P","H","E","Z","Q","D","B","N","K","R"};\r
-  Color [] col = new Color[20];\r
+  Color [] col = new Color[res.length];\r
   HydrophobicColourScheme cs = new HydrophobicColourScheme();\r
-  for (int i=0; i<20; i++)\r
-    col[i] = cs.findColour(null,  res[i], -1,  null);\r
+  for (int i=0; i<res.length; i++)\r
+    col[i] = cs.findColour( res[i], -1,  null);\r
 \r
   displayKey( res, null, col, "According to the hydrophobicity table of  Kyte, J., and Doolittle, R.F., J. Mol. Biol. 1157, 105-132, 1982.  The most hydrophobic residues according to this table are coloured red and the most hydrophilic ones are coloured blue.");\r
 \r
@@ -147,7 +147,7 @@ protected void helixMenuItem_actionPerformed(ActionEvent e)
   Color[] col = new Color[res.length];\r
   HelixColourScheme cs = new HelixColourScheme();\r
   for (int i = 0; i < res.length; i++)\r
-    col[i] = cs.findColour(null, res[i], -1, null);\r
+    col[i] = cs.findColour( res[i], -1, null);\r
 \r
   displayKey(res, null, col, null);\r
 }\r
@@ -160,7 +160,7 @@ protected void strandMenuItem_actionPerformed(ActionEvent e)
 Color[] col = new Color[res.length];\r
 StrandColourScheme cs = new StrandColourScheme();\r
 for (int i = 0; i < res.length; i++)\r
-  col[i] = cs.findColour(null, res[i], -1, null);\r
+  col[i] = cs.findColour( res[i], -1, null);\r
   displayKey(res, null, col, null);\r
 }\r
 \r
@@ -172,7 +172,7 @@ protected void turnMenuItem_actionPerformed(ActionEvent e)
 Color[] col = new Color[res.length];\r
 TurnColourScheme cs = new TurnColourScheme();\r
 for (int i = 0; i < res.length; i++)\r
-  col[i] = cs.findColour(null, res[i], -1, null);\r
+  col[i] = cs.findColour( res[i], -1, null);\r
 \r
   displayKey(res, null, col, null);\r
 }\r
@@ -185,7 +185,7 @@ protected void buriedMenuItem_actionPerformed(ActionEvent e)
 Color[] col = new Color[res.length];\r
 BuriedColourScheme cs = new BuriedColourScheme();\r
 for (int i = 0; i < res.length; i++)\r
-  col[i] = cs.findColour(null, res[i], -1, null);\r
+  col[i] = cs.findColour( res[i], -1, null);\r
 \r
   displayKey(res, null, col, null);\r
 }\r