1 package jalview.schemes;
\r
3 import java.lang.reflect.*;
\r
6 public class ColourSchemeFactory {
\r
8 public static ColourSchemeI get(int index) {
\r
10 String name = ColourProperties.getClassName(index);
\r
11 Class c = Class.forName(name);
\r
13 return (ColourSchemeI)c.newInstance();
\r
14 } catch (Exception e) {
\r
15 System.err.println(e);
\r
20 public static ColourSchemeI get(String scheme) {
\r
21 return get(ColourProperties.indexOf(scheme));
\r
24 public static int get(ColourSchemeI cs) {
\r
25 return ColourProperties.indexOfClass(cs);
\r