X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FColourSchemeProperty.java;h=500047b1e554a1423a4a6cfaf04872716aa8bb8d;hb=17e77c3f2949a0729322b4a8d907f3f34b6a9914;hp=cc303d65e21308178bd79cd596701250d85897e8;hpb=7ab5d6b0ba5fec1ea4a4239e79c476d841622485;p=jalview.git diff --git a/src/jalview/schemes/ColourSchemeProperty.java b/src/jalview/schemes/ColourSchemeProperty.java index cc303d6..500047b 100755 --- a/src/jalview/schemes/ColourSchemeProperty.java +++ b/src/jalview/schemes/ColourSchemeProperty.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -597,4 +597,41 @@ public class ColourSchemeProperty return col; } + + public static Color rnaHelices[] = null; + + public static void initRnaHelicesShading(int n) + { + int j = 0; + if (rnaHelices == null) + { + rnaHelices = new Color[n + 1]; + } + else if (rnaHelices != null && rnaHelices.length <= n) + { + Color[] t = new Color[n + 1]; + System.arraycopy(rnaHelices, 0, t, 0, rnaHelices.length); + j = rnaHelices.length; + rnaHelices = t; + } + else + { + return; + } + // Generate random colors and store + for (; j <= n; j++) + { + rnaHelices[j] = jalview.util.ColorUtils + .generateRandomColor(Color.white); + } + } + + /** + * delete the existing cached RNA helces colours + */ + public static void resetRnaHelicesShading() + { + rnaHelices = null; + } + }