X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Frenderer%2FResidueShaderTest.java;fp=test%2Fjalview%2Frenderer%2FResidueShaderTest.java;h=78f00c80ce16a07a3f6009050f785c0a4d69db5e;hb=5e20c0116864d77705d951e35c41a13197791156;hp=eba5f59d76fcfae034215437b0add9b95a04f5e5;hpb=1bad3c3f74b2e204e0d7ba93a745f5ec775c8a3e;p=jalview.git diff --git a/test/jalview/renderer/ResidueShaderTest.java b/test/jalview/renderer/ResidueShaderTest.java index eba5f59..78f00c8 100644 --- a/test/jalview/renderer/ResidueShaderTest.java +++ b/test/jalview/renderer/ResidueShaderTest.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.renderer; import static org.testng.AssertJUnit.assertEquals; @@ -161,9 +181,12 @@ public class ResidueShaderTest assertEquals(Color.WHITE, ccs.applyConservation(colour, 4)); assertEquals(Color.WHITE, ccs.applyConservation(colour, 5)); assertEquals(Color.WHITE, ccs.applyConservation(colour, 6)); - assertEquals(new Color(235, 225, 215), ccs.applyConservation(colour, 7)); - assertEquals(new Color(215, 195, 175), ccs.applyConservation(colour, 8)); - assertEquals(new Color(195, 165, 135), ccs.applyConservation(colour, 9)); + assertEquals(new Color(235, 225, 215), + ccs.applyConservation(colour, 7)); + assertEquals(new Color(215, 195, 175), + ccs.applyConservation(colour, 8)); + assertEquals(new Color(195, 165, 135), + ccs.applyConservation(colour, 9)); assertEquals(colour, ccs.applyConservation(colour, 10)); assertEquals(colour, ccs.applyConservation(colour, 11)); assertEquals(Color.WHITE, ccs.applyConservation(colour, 12)); @@ -186,10 +209,10 @@ public class ResidueShaderTest colours[23] = Color.red; // gap colour ColourSchemeI cs = new UserColourScheme(colours); rs = new ResidueShader(cs); - + assertEquals(Color.red, rs.findColour(' ', 7, null)); assertEquals(Color.blue, rs.findColour('Q', 7, null)); - + /* * stub Conservation to return a given consensus string */ @@ -204,14 +227,14 @@ public class ResidueShaderTest } }; rs.setConservation(cons); - + /* * with 0% threshold, there should be no fading */ rs.setConservationInc(0); assertEquals(Color.red, rs.findColour(' ', 7, null)); assertEquals(Color.blue, rs.findColour('Q', 7, null)); - + /* * with 40% threshold, 'fade factor' is * (11-score)/10 * 40/20 = (11-score)/5 @@ -261,12 +284,14 @@ public class ResidueShaderTest protected ProfilesI getStubConsensus(final String modalResidue, final float pid) { - ProfilesI consensus = new ProfilesI() { + ProfilesI consensus = new ProfilesI() + { @Override public ProfileI get(int i) { - return new ProfileI() { + return new ProfileI() + { @Override public void setCounts(ResidueCount residueCounts) { @@ -312,7 +337,8 @@ public class ResidueShaderTest public int getNonGapped() { return 0; - }}; + } + }; } @Override @@ -326,7 +352,7 @@ public class ResidueShaderTest { return 0; } - + }; return consensus; }