X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMCview%2FPDBChain.java;h=ddf05e1320e827b35ea4d32d8aef973135ad335f;hb=5655997c202bfcb4ab2778999d785490d3a7dbae;hp=0715b6abd2e8ac892fbd166856e9256b31631e2f;hpb=dbbe146185027d9cb041a83645985a6b1a26cb75;p=jalview.git diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index 0715b6a..ddf05e1 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -228,44 +228,27 @@ public class PDBChain { } } - public void setHydrophobicityColours() { - float hydmin = (float) ResidueProperties.getHydmin(); - float hydmax = (float) ResidueProperties.getHydmax(); - double[] hyd = ResidueProperties.getHyd(); - - Hashtable AA3Hash = ResidueProperties.getAA3Hash(); + public void setChainColours(jalview.schemes.ColourSchemeI cs) + { + Bond b; for (int i = 0; i < bonds.size(); i++) { try { - Bond b = (Bond) bonds.elementAt(i); - - int atno = ((Integer) AA3Hash.get(b.at1.resName.toUpperCase())).intValue(); - float red = ((float) hyd[atno] - hydmin) / (hydmax - hydmin); - - if (red > (float) 1.0) { - red = (float) 1.0; - } - - if (red < (float) 0.0) { - red = (float) 0.0; - } + b = (Bond) bonds.elementAt(i); - b.startCol = new Color(red, (float) 0.0, (float) 1.0 - red); - atno = ((Integer) AA3Hash.get(b.at2.resName.toUpperCase())).intValue(); + ( (Bond) bonds.elementAt(i)).startCol = cs.findColour( + ResidueProperties.aa[ ( (Integer) ResidueProperties.aa3Hash. + get(b.at1.resName)).intValue()] + ); - red = ((float) hyd[atno] - hydmin) / (hydmax - hydmin); + b.endCol = cs.findColour( + ResidueProperties.aa[ ( (Integer) ResidueProperties.aa3Hash. + get(b.at2.resName)).intValue()] + ); - if (red > (float) 1.0) { - red = (float) 1.0; - } - - if (red < (float) 0.0) { - red = (float) 0.0; - } - - b.endCol = new Color(red, (float) 0.2, (float) 1.0 - red); - } catch (Exception e) { - Bond b = (Bond) bonds.elementAt(i); + } catch (Exception e) + { + b = (Bond) bonds.elementAt(i); b.startCol = Color.gray; b.endCol = Color.gray; }