From: amwaterhouse Date: Thu, 19 May 2005 18:00:03 +0000 (+0000) Subject: returns name if given colourscheme X-Git-Tag: Release_2_0~273 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a0dfca2ab49882cb8544d16cd105faaaf9f2ef10;p=jalview.git returns name if given colourscheme --- 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;