Remove system.out
[jalview.git] / src / MCview / PDBChain.java
index 0715b6a..fa4bbf9 100755 (executable)
@@ -228,44 +228,27 @@ public class PDBChain {
         }\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