Clover icon

Coverage Report

  1. Project Clover database Thu Nov 7 2024 17:01:39 GMT
  2. Package jalview.schemes

File RNAHelicesColourChooser.java

 

Coverage histogram

../../img/srcFileCovDistChart0.png
0% of files have more coverage

Code metrics

12
25
2
1
110
67
8
0.32
12.5
2
4

Classes

Class Line # Actions
RNAHelicesColourChooser 40 25 8
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
20    */
21    package jalview.schemes;
22   
23    import jalview.api.AlignViewportI;
24    import jalview.api.AlignmentViewPanel;
25    import jalview.datamodel.AlignmentAnnotation;
26    import jalview.datamodel.SequenceGroup;
27   
28    import java.util.Hashtable;
29    import java.util.Map;
30    import java.util.Vector;
31   
32    /**
33    * Helps generate the colors for RNA secondary structure. Future: add option to
34    * change colors based on covariation.
35    *
36    * @author Lauren Michelle Lui
37    * @deprecated this seems to be unfinished - just use RNAHelicesColour
38    */
39    @Deprecated
 
40    public class RNAHelicesColourChooser
41    {
42   
43    AlignViewportI av;
44   
45    AlignmentViewPanel ap;
46   
47    ColourSchemeI oldcs;
48   
49    Map<SequenceGroup, ColourSchemeI> oldgroupColours;
50   
51    AlignmentAnnotation currentAnnotation;
52   
53    boolean adjusting = false;
54   
 
55  0 toggle public RNAHelicesColourChooser(AlignViewportI av,
56    final AlignmentViewPanel ap)
57    {
58  0 oldcs = av.getGlobalColourScheme();
59  0 if (av.getAlignment().getGroups() != null)
60    {
61  0 oldgroupColours = new Hashtable<>();
62  0 for (SequenceGroup sg : ap.getAlignment().getGroups())
63    {
64  0 if (sg.getColourScheme() != null)
65    {
66  0 oldgroupColours.put(sg, sg.getColourScheme());
67    }
68    }
69    }
70  0 this.av = av;
71  0 this.ap = ap;
72   
73  0 adjusting = true;
74  0 Vector<String> list = new Vector<>();
75  0 int index = 1;
76  0 AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation();
77  0 if (anns != null)
78    {
79  0 for (int i = 0; i < anns.length; i++)
80    {
81  0 String label = anns[i].label;
82  0 if (!list.contains(label))
83    {
84  0 list.addElement(label);
85    }
86    else
87    {
88  0 list.addElement(label + "_" + (index++));
89    }
90    }
91    }
92   
93  0 adjusting = false;
94  0 changeColour();
95    }
96   
 
97  0 toggle void changeColour()
98    {
99    // Check if combobox is still adjusting
100  0 if (adjusting)
101    {
102  0 return;
103    }
104  0 RNAHelicesColour rhc = new RNAHelicesColour(av.getAlignment());
105   
106  0 av.setGlobalColourScheme(rhc);
107   
108  0 ap.paintAlignment(true, true);
109    }
110    }