X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FNucleotideColourScheme.java;h=899fc60ae99d22f2cc372d99e22a543480dd3534;hb=1b1a1007c534a02fdbae76df0c084f215c7c4c21;hp=0f2101e06a089a7fe5d8a1ab3788ba00746b17aa;hpb=99c58ee0ae2a848f982552e53feaf6d5cb9925e5;p=jalview.git diff --git a/src/jalview/schemes/NucleotideColourScheme.java b/src/jalview/schemes/NucleotideColourScheme.java index 0f2101e..899fc60 100755 --- a/src/jalview/schemes/NucleotideColourScheme.java +++ b/src/jalview/schemes/NucleotideColourScheme.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -16,39 +16,70 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - package jalview.schemes; import java.awt.*; + +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ public class NucleotideColourScheme extends ResidueColourScheme { - public NucleotideColourScheme() { - super(ResidueProperties.nucleotide,0); - } - - - public Color findColour(String n) - { - // System.out.println("called"); log.debug - return colors[((Integer)(ResidueProperties.nucleotideHash.get(n))).intValue()]; - } - + /** + * Creates a new NucleotideColourScheme object. + */ + public NucleotideColourScheme() + { + super(ResidueProperties.nucleotide, 0); + } - public Color findColour(String n, int j) { + /** + * DOCUMENT ME! + * + * @param n DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public Color findColour(char c) + { + // System.out.println("called"); log.debug + return colors[ResidueProperties.nucleotideIndex[c]]; + } - if (threshold == 0 || aboveThreshold( n, j)) - try - { - return colors[ ( (Integer) (ResidueProperties.nucleotideHash.get(n))).intValue()]; - } - catch (Exception ex) - { - return Color.white; - } - else - return Color.white; + /** + * DOCUMENT ME! + * + * @param n DOCUMENT ME! + * @param j DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public Color findColour(char c, int j) + { + Color currentColour; + if ((threshold == 0) || aboveThreshold(c, j)) + { + try + { + currentColour = colors[ ResidueProperties.nucleotideIndex[c]]; + } + catch (Exception ex) + { + return Color.white; + } + } + else + { + return Color.white; + } - } + if(conservationColouring) + currentColour = applyConservation(currentColour, j); + return currentColour; + } }