JAL-629 Tidy up tests and replaced methods before merge to develop
[jalview.git] / src / jalview / datamodel / ContactMatrixI.java
1 package jalview.datamodel;
2
3 import java.awt.Color;
4 import java.util.Arrays;
5 import java.util.BitSet;
6 import java.util.List;
7
8 public interface ContactMatrixI
9 {
10
11   ContactListI getContactList(int column);
12
13   float getMin();
14
15   float getMax();
16
17   boolean hasReferenceSeq();
18
19   SequenceI getReferenceSeq();
20
21   String getAnnotDescr();
22
23   String getAnnotLabel();
24
25   /**
26    * string indicating how the contactMatrix should be rendered - stored in
27    * calcId
28    * 
29    * @return
30    */
31   String getType();
32
33   int getWidth();
34
35   int getHeight();
36   
37   default boolean hasGroups() {
38     return false;
39   }
40   default BitSet getGroupsFor(int column) {
41     BitSet colbitset  = new BitSet();
42     colbitset.set(column);
43     return colbitset;
44   }
45
46   default List<BitSet> getGroups() {
47     return Arrays.asList();
48   }
49
50   default boolean hasTree() {
51     return false;
52   }
53
54   /**
55    * Newick representation of clustered matrix
56    * @return null unless hasTree is true
57    */
58   default String getNewick() {
59     return null;
60   }
61
62   default String getTreeMethod() {
63     return null;
64   }
65
66   default boolean hasCutHeight() {
67     return false;
68   }
69
70   default double getCutHeight() {
71     return 0;
72   }
73
74   void updateGroups(List<BitSet> colGroups);
75
76   void setColorForGroup(BitSet bs, Color color);
77
78   default Color getColourForGroup(BitSet bs) { return Color.white;};
79 }