1c169ef31e19cf6fb6d4e050c74ddc8b28b1993f
[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 calcId
27    * @return 
28    */
29   String getType();
30
31   int getWidth();
32   int getHeight();
33   
34   default boolean hasGroups() {
35     return false;
36   }
37   default BitSet getGroupsFor(int column) {
38     BitSet colbitset  = new BitSet();
39     colbitset.set(column);
40     return colbitset;
41   }
42
43   default List<BitSet> getGroups() {
44     return Arrays.asList();
45   }
46
47   default boolean hasTree() {
48     return false;
49   }
50
51   /**
52    * Newick representation of clustered matrix
53    * @return null unless hasTree is true
54    */
55   default String getNewick() {
56     return null;
57   }
58
59   default String getTreeMethod() {
60     return null;
61   }
62
63   default boolean hasCutHeight() {
64     return false;
65   }
66
67   default double getCutHeight() {
68     return 0;
69   }
70
71   void updateGroups(List<BitSet> colGroups);
72
73   void setColorForGroup(BitSet bs, Color color);
74
75   default Color getColourForGroup(BitSet bs) { return Color.white;};
76 }