X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FColourSchemeProperty.java;h=278cf6afcafad8b8de0d3f8c2cdc364ca805bfa1;hb=ca26cdb914e0a8885bb0a3986750481bde71383a;hp=d27dcf012972f2a43fd081f4a29e20748803ec61;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/schemes/ColourSchemeProperty.java b/src/jalview/schemes/ColourSchemeProperty.java index d27dcf0..278cf6a 100755 --- a/src/jalview/schemes/ColourSchemeProperty.java +++ b/src/jalview/schemes/ColourSchemeProperty.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 @@ -40,28 +40,32 @@ public class ColourSchemeProperty public static final int ZAPPO = 3; /** DOCUMENT ME!! */ - public static final int HYDROPHOBIC = 4; + public static final int TAYLOR = 4; /** DOCUMENT ME!! */ - public static final int HELIX = 5; + public static final int HYDROPHOBIC = 5; /** DOCUMENT ME!! */ - public static final int STRAND = 6; + public static final int HELIX = 6; /** DOCUMENT ME!! */ - public static final int TURN = 7; + public static final int STRAND = 7; /** DOCUMENT ME!! */ - public static final int BURIED = 8; + public static final int TURN = 8; /** DOCUMENT ME!! */ - public static final int NUCLEOTIDE = 9; + public static final int BURIED = 9; /** DOCUMENT ME!! */ - public static final int USER_DEFINED = 10; + public static final int NUCLEOTIDE = 10; /** DOCUMENT ME!! */ - public static final int NONE = 11; + public static final int USER_DEFINED = 11; + + + /** DOCUMENT ME!! */ + public static final int NONE = 12; /** * DOCUMENT ME! @@ -72,7 +76,7 @@ public class ColourSchemeProperty */ public static int getColourIndexFromName(String name) { - int ret = 11; + int ret = 12; if (name.equalsIgnoreCase("Clustal")) { @@ -90,6 +94,10 @@ public class ColourSchemeProperty { ret = ZAPPO; } + else if (name.equalsIgnoreCase("Taylor")) + { + ret = TAYLOR; + } else if (name.equalsIgnoreCase("Hydrophobic")) { ret = HYDROPHOBIC; @@ -131,12 +139,8 @@ public class ColourSchemeProperty */ public static String getColourName(ColourSchemeI cs) { - if (cs instanceof ConservationColourScheme) - { - cs = ((ConservationColourScheme) cs).cs; - } - int index = 11; + int index = 12; if (cs instanceof ClustalxColourScheme) { @@ -154,6 +158,10 @@ public class ColourSchemeProperty { index = ZAPPO; } + else if (cs instanceof TaylorColourScheme) + { + index = TAYLOR; + } else if (cs instanceof HydrophobicColourScheme) { index = HYDROPHOBIC; @@ -219,6 +227,10 @@ public class ColourSchemeProperty break; + case TAYLOR: + ret = "Taylor"; + break; + case HYDROPHOBIC: ret = "Hydrophobic"; @@ -328,6 +340,10 @@ public class ColourSchemeProperty break; + case TAYLOR: + cs = new TaylorColourScheme(); + break; + case HYDROPHOBIC: cs = new HydrophobicColourScheme(); @@ -359,8 +375,10 @@ public class ColourSchemeProperty break; case USER_DEFINED: - cs = new UserColourScheme(new Color[0]); - + Color[] col = new Color[24]; + for (int i = 0; i < 24; i++) + col[i] = Color.white; + cs = new UserColourScheme(col); break; default: