1 package jalview.schemes;
3 import jalview.datamodel.AnnotatedCollectionI;
5 import java.util.HashMap;
9 * An enum with the colour schemes supported by Jalview.
11 public enum JalviewColourScheme
16 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
18 return new ClustalxColourScheme(coll, null);
24 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
26 return new Blosum62ColourScheme();
32 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
34 return new PIDColourScheme();
40 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
42 return new ZappoColourScheme();
48 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
50 return new TaylorColourScheme();
53 Hydrophobic("Hydrophobic")
56 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
58 return new HydrophobicColourScheme();
61 Helix("Helix Propensity")
64 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
66 return new HelixColourScheme();
69 Strand("Strand Propensity")
72 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
74 return new StrandColourScheme();
77 Turn("Turn Propensity")
80 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
82 return new TurnColourScheme();
85 Buried("Buried Index")
88 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
90 return new BuriedColourScheme();
93 Nucleotide("Nucleotide")
96 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
98 return new NucleotideColourScheme();
101 PurinePyrimidine("Purine/Pyrimidine")
104 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
106 return new PurinePyrimidineColourScheme();
109 TCoffee("T-Coffee Scores")
112 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
114 return new TCoffeeColourScheme(coll);
117 RNAHelices("RNA Helices")
120 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
122 return new RNAHelicesColour(coll);
125 // RNAInteraction("RNA Interaction type")
128 // public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
130 // return new RNAInteractionColourScheme();
133 UserDefined("User Defined")
136 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
138 return new UserColourScheme("white");
142 static Map<String, JalviewColourScheme> names = new HashMap<String, JalviewColourScheme>();
148 for (JalviewColourScheme scheme : values())
150 names.put(scheme.name.toLowerCase(), scheme);
155 * Answers the colour scheme with the 'given name', or null if name is invalid
156 * or null. The name is not case-sensitive.
161 public static JalviewColourScheme forName(String name)
163 return name == null ? null : names.get(name.toLowerCase());
167 * Constructor given the name of the colour scheme (as used in Jalview
168 * parameters). Note this is not necessarily the same as the 'display name'
169 * used in menu options (as this may be language-dependent).
173 JalviewColourScheme(String s)
179 * Returns an instance of the colour scheme with which to colour the given
185 public abstract ColourSchemeI getColourScheme(AnnotatedCollectionI coll);
188 * Returns the 'official' name of this colour scheme. This is the name that
189 * identifies the colour scheme as a start-up parameter for the Jalview
190 * application or applet. Note that it may not be the name shown in menu
191 * options, as these may be internationalised.
194 public String toString()