From 28baf07e56ad6178dc4fe565643bcf5315b76a4c Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 15 Apr 2005 15:09:18 +0000 Subject: [PATCH] no longer used --- src/jalview/schemes/ColourProperties.java | 144 -------------------------- src/jalview/schemes/ColourSchemeFactory.java | 27 ----- 2 files changed, 171 deletions(-) delete mode 100755 src/jalview/schemes/ColourProperties.java delete mode 100755 src/jalview/schemes/ColourSchemeFactory.java diff --git a/src/jalview/schemes/ColourProperties.java b/src/jalview/schemes/ColourProperties.java deleted file mode 100755 index e243da7..0000000 --- a/src/jalview/schemes/ColourProperties.java +++ /dev/null @@ -1,144 +0,0 @@ -package jalview.schemes; - -import java.util.*; - -public class ColourProperties { - - public static final int ZAPPO = 0; - public static final int TAYLOR = 1; - public static final int PID = 2; - public static final int BLOSUM62 = 3; - public static final int SECONDARY = 4; - public static final int USER = 5; - public static final int HYDROPHOBIC = 6; - public static final int CONSERVATION = 7; - public static final int HELIX = 8; - public static final int STRAND = 9; - public static final int TURN = 10; - public static final int BURIED = 11; - public static final int FEATURES = 12; - public static final int CLUSTALX = 13; - - static ColourSchemePropertyVector colourSchemes = new ColourSchemePropertyVector(); - - static { - String prefix = getDefaultClassPrefix(); - - // MC 27/03/02 These should be read in from a file - - colourSchemes.add(new ColourSchemeProperty("Zappo", - prefix + "ZappoColourScheme", - "Zappo colours")); - - colourSchemes.add(new ColourSchemeProperty("Taylor", - prefix + "TaylorColourScheme", - "Taylor colours")); - - colourSchemes.add(new ColourSchemeProperty("Hydrophobic", - prefix + "HydrophobicColourScheme", - "By Hydrophobicity")); - - colourSchemes.add(new ColourSchemeProperty("Helix", - prefix + "HelixColourScheme", - "Helix propensity")); - - colourSchemes.add(new ColourSchemeProperty("Strand", - prefix + "StrandColourScheme", - "Strand propensity")); - - colourSchemes.add(new ColourSchemeProperty("Turn", - prefix + "TurnColourScheme", - "Turn propensity")); - - colourSchemes.add(new ColourSchemeProperty("Buried", - prefix + "BuriedColourScheme", - "Buried index")); - - colourSchemes.add(new ColourSchemeProperty("BLOSUM62", - prefix + "Blosum62ColourScheme", - "By BLOSUM62 Score")); - - colourSchemes.add(new ColourSchemeProperty("User defined", - prefix + "ZappoColourScheme", - "User defined colours")); - - colourSchemes.add(new ColourSchemeProperty("PID", - prefix + "PIDColourScheme", - "By PID")); - - colourSchemes.add(new ColourSchemeProperty("Secondary structure", - prefix + "SecondaryColourScheme", - "By Secondary Structure")); - - colourSchemes.add(new ColourSchemeProperty("Conservation", - prefix + "ZappoColourScheme", - null)); - - colourSchemes.add(new ColourSchemeProperty("Features", - prefix + "FeatureColourScheme", - null)); - - colourSchemes.add(new ColourSchemeProperty("Clustalx", - prefix + "ClustalXColourScheme", - "ClustalX colours")); - } - - static int indexOf(String scheme) { - if (colourSchemes.contains(scheme)) { - return colourSchemes.indexOf(scheme); - } else { - return -1; - } - } - - public static int indexOfClass(ColourSchemeI scheme) { - return colourSchemes.indexOfClass(scheme); - } - - public static String getClassName(int index) { - return colourSchemes.getClassName(index); - } - - public static String getMenuString(int index) { - return colourSchemes.getMenuString(index); - } - - static boolean contains(String scheme) { - return colourSchemes.contains(scheme); - } - - public static Vector getColourSchemeNames() { - return colourSchemes.getColourSchemeNames(); - } - - protected static String getDefaultClassPrefix() { - return "jalview.schemes."; - } - - public static ColourSchemeI getColourScheme(int i) - { - switch(i) - { - case ColourProperties.HYDROPHOBIC: return new HydrophobicColourScheme(); - - case ColourProperties.TAYLOR: return new TaylorColourScheme(); - case ColourProperties.HELIX: return new HelixColourScheme(); - case ColourProperties.STRAND: return new StrandColourScheme(); - case ColourProperties.TURN: return new TurnColourScheme(); - case ColourProperties.BURIED: return new BuriedColourScheme(); - case ColourProperties.PID: return new PIDColourScheme(); - case ColourProperties.BLOSUM62: return new Blosum62ColourScheme(null); - - case ColourProperties.ZAPPO: - case ColourProperties.USER: - case ColourProperties.CONSERVATION: - case ColourProperties.FEATURES: - case ColourProperties.CLUSTALX: - default: return new ZappoColourScheme(); - } - - } -} - - - diff --git a/src/jalview/schemes/ColourSchemeFactory.java b/src/jalview/schemes/ColourSchemeFactory.java deleted file mode 100755 index 71c32c7..0000000 --- a/src/jalview/schemes/ColourSchemeFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -package jalview.schemes; - -import java.lang.reflect.*; -import java.util.*; - -public class ColourSchemeFactory { - - public static ColourSchemeI get(int index) { - try { - String name = ColourProperties.getClassName(index); - Class c = Class.forName(name); - - return (ColourSchemeI)c.newInstance(); - } catch (Exception e) { - System.err.println(e); - return null; - } - } - - public static ColourSchemeI get(String scheme) { - return get(ColourProperties.indexOf(scheme)); - } - - public static int get(ColourSchemeI cs) { - return ColourProperties.indexOfClass(cs); - } -} -- 1.7.10.2