/*\r
* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
}\r
}\r
\r
- public void setHydrophobicityColours() {\r
- float hydmin = (float) ResidueProperties.getHydmin();\r
- float hydmax = (float) ResidueProperties.getHydmax();\r
- double[] hyd = ResidueProperties.getHyd();\r
-\r
- Hashtable AA3Hash = ResidueProperties.getAA3Hash();\r
\r
+ public void setChainColours(jalview.schemes.ColourSchemeI cs)\r
+ {\r
+ Bond b;\r
for (int i = 0; i < bonds.size(); i++) {\r
try {\r
- Bond b = (Bond) bonds.elementAt(i);\r
-\r
- int atno = ((Integer) AA3Hash.get(b.at1.resName.toUpperCase())).intValue();\r
- float red = ((float) hyd[atno] - hydmin) / (hydmax - hydmin);\r
-\r
- if (red > (float) 1.0) {\r
- red = (float) 1.0;\r
- }\r
-\r
- if (red < (float) 0.0) {\r
- red = (float) 0.0;\r
- }\r
+ b = (Bond) bonds.elementAt(i);\r
\r
- b.startCol = new Color(red, (float) 0.0, (float) 1.0 - red);\r
- atno = ((Integer) AA3Hash.get(b.at2.resName.toUpperCase())).intValue();\r
+ ( (Bond) bonds.elementAt(i)).startCol = cs.findColour(\r
+ ResidueProperties.aa[ ( (Integer) ResidueProperties.aa3Hash.\r
+ get(b.at1.resName)).intValue()]\r
+ );\r
\r
- red = ((float) hyd[atno] - hydmin) / (hydmax - hydmin);\r
+ b.endCol = cs.findColour(\r
+ ResidueProperties.aa[ ( (Integer) ResidueProperties.aa3Hash.\r
+ get(b.at2.resName)).intValue()]\r
+ );\r
\r
- if (red > (float) 1.0) {\r
- red = (float) 1.0;\r
- }\r
-\r
- if (red < (float) 0.0) {\r
- red = (float) 0.0;\r
- }\r
-\r
- b.endCol = new Color(red, (float) 0.2, (float) 1.0 - red);\r
- } catch (Exception e) {\r
- Bond b = (Bond) bonds.elementAt(i);\r
+ } catch (Exception e)\r
+ {\r
+ b = (Bond) bonds.elementAt(i);\r
b.startCol = Color.gray;\r
b.endCol = Color.gray;\r
}\r