From a0dfca2ab49882cb8544d16cd105faaaf9f2ef10 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 19 May 2005 18:00:03 +0000 Subject: [PATCH] returns name if given colourscheme --- src/jalview/schemes/ColourSchemeProperty.java | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/jalview/schemes/ColourSchemeProperty.java b/src/jalview/schemes/ColourSchemeProperty.java index 6488b8d..4343b54 100755 --- a/src/jalview/schemes/ColourSchemeProperty.java +++ b/src/jalview/schemes/ColourSchemeProperty.java @@ -44,6 +44,39 @@ public class ColourSchemeProperty return ret; } + public static String getColourName(ColourSchemeI cs) + { + if(cs instanceof ConservationColourScheme) + cs = ((ConservationColourScheme)cs).cs; + + + int index = 11; + if(cs instanceof ClustalxColourScheme) + index = CLUSTAL; + else if(cs instanceof Blosum62ColourScheme) + index = BLOSUM; + else if(cs instanceof PIDColourScheme) + index = PID; + else if(cs instanceof ZappoColourScheme) + index = ZAPPO; + else if(cs instanceof HydrophobicColourScheme) + index = HYDROPHOBIC; + else if(cs instanceof HelixColourScheme) + index = HELIX; + else if(cs instanceof StrandColourScheme) + index = STRAND; + else if(cs instanceof TurnColourScheme) + index = TURN; + else if(cs instanceof BuriedColourScheme) + index = BURIED; + else if(cs instanceof NucleotideColourScheme) + index = NUCLEOTIDE; + else if(cs instanceof UserColourScheme) + index = USER_DEFINED; + + return getColourName(index); + } + public static String getColourName(int index) { String ret=null; -- 1.7.10.2