X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FPurinePyrimidineColourScheme.java;h=a8270cca72d66580841a102170a6a82a734d460b;hb=4f1c8f3fdd352d5e6c3e6cfe1b729f9ef7d6e47f;hp=877afad179d622e5768be342e702bd542d4a6c06;hpb=c19d2a91ca05e052e3408bf5852d88eb5d0608f1;p=jalview.git diff --git a/src/jalview/schemes/PurinePyrimidineColourScheme.java b/src/jalview/schemes/PurinePyrimidineColourScheme.java index 877afad..a8270cc 100644 --- a/src/jalview/schemes/PurinePyrimidineColourScheme.java +++ b/src/jalview/schemes/PurinePyrimidineColourScheme.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -20,7 +20,8 @@ */ package jalview.schemes; -import java.awt.Color; +import jalview.api.AlignViewportI; +import jalview.datamodel.AnnotatedCollectionI; /** * Class is based off of NucleotideColourScheme @@ -35,56 +36,29 @@ public class PurinePyrimidineColourScheme extends ResidueColourScheme public PurinePyrimidineColourScheme() { super(ResidueProperties.purinepyrimidineIndex, - ResidueProperties.purinepyrimidine, 0); + ResidueProperties.purinepyrimidine); } - /** - * Finds the corresponding color for the type of character inputed - * - * @param c - * Character in sequence - * - * @return Color from purinepyrimidineIndex in - * jalview.schemes.ResidueProperties - */ - public Color findColour(char c) + @Override + public boolean isNucleotideSpecific() { - return colors[ResidueProperties.purinepyrimidineIndex[c]]; + return true; + } + + @Override + public String getSchemeName() + { + return JalviewColourScheme.PurinePyrimidine.toString(); } /** - * Returns color based on conservation - * - * @param c - * Character in sequence - * @param j - * Threshold - * - * @return Color in RGB + * Returns a new instance of this colour scheme with which the given data may + * be coloured */ - public Color findColour(char c, int j) + @Override + public ColourSchemeI getInstance(AlignViewportI view, + AnnotatedCollectionI coll) { - Color currentColour; - if ((threshold == 0) || aboveThreshold(c, j)) - { - try - { - currentColour = colors[ResidueProperties.purinepyrimidineIndex[c]]; - } catch (Exception ex) - { - return Color.white; - } - } - else - { - return Color.white; - } - - if (conservationColouring) - { - currentColour = applyConservation(currentColour, j); - } - - return currentColour; + return new PurinePyrimidineColourScheme(); } }