1 package jalview.schemes;
3 import jalview.datamodel.AnnotatedCollectionI;
6 import java.util.HashMap;
10 * An enum with the colour schemes supported by Jalview.
12 public enum JalviewColourScheme
17 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
19 return new ClustalxColourScheme(coll, null);
25 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
27 return new Blosum62ColourScheme();
33 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
35 return new PIDColourScheme();
41 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
43 return new ZappoColourScheme();
49 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
51 return new TaylorColourScheme();
54 Hydrophobic("Hydrophobic")
57 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
59 return new HydrophobicColourScheme();
62 Helix("Helix Propensity")
65 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
67 return new HelixColourScheme();
70 Strand("Strand Propensity")
73 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
75 return new StrandColourScheme();
78 Turn("Turn Propensity")
81 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
83 return new TurnColourScheme();
86 Buried("Buried Index")
89 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
91 return new BuriedColourScheme();
94 Nucleotide("Nucleotide")
97 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
99 return new NucleotideColourScheme();
102 PurinePyrimidine("Purine/Pyrimidine")
105 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
107 return new PurinePyrimidineColourScheme();
110 TCoffee("T-Coffee Scores")
113 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
115 return new TCoffeeColourScheme(coll);
118 RNAHelices("RNA Helices")
121 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
123 return new RNAHelicesColour(coll);
126 // RNAInteraction("RNA Interaction type")
129 // public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
131 // return new RNAInteractionColourScheme();
134 UserDefined("User Defined")
137 public ColourSchemeI getColourScheme(AnnotatedCollectionI coll)
139 Color[] col = new Color[24];
140 for (int i = 0; i < 24; i++)
142 col[i] = Color.white;
144 return new UserColourScheme("white");
148 static Map<String, JalviewColourScheme> names = new HashMap<String, JalviewColourScheme>();
154 for (JalviewColourScheme scheme : values())
156 names.put(scheme.name.toLowerCase(), scheme);
161 * Answers the colour scheme with the 'given name', or null if name is invalid
162 * or null. The name is not case-sensitive.
167 public static JalviewColourScheme forName(String name)
169 return name == null ? null : names.get(name.toLowerCase());
173 * Constructor given the name of the colour scheme (as used in Jalview
174 * parameters). Note this is not necessarily the same as the 'display name'
175 * used in menu options (as this may be language-dependent).
179 JalviewColourScheme(String s)
185 * Returns an instance of the colour scheme with which to colour the given
191 public abstract ColourSchemeI getColourScheme(AnnotatedCollectionI coll);
194 * Returns the 'official' name of this colour scheme. This is the name that
195 * identifies the colour scheme as a start-up parameter for the Jalview
196 * application or applet. Note that it may not be the name shown in menu
197 * options, as these may be internationalised.
200 public String toString()