JAL-2349 allow PAE or other contact matrices to hold a coordinate mapping allowing...
[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   String getAnnotDescr();
18
19   String getAnnotLabel();
20
21   /**
22    * string indicating how the contactMatrix should be rendered - stored in calcId
23    * @return 
24    */
25   String getType();
26
27   int getWidth();
28   int getHeight();
29   
30   default boolean hasGroups() {
31     return false;
32   }
33   default BitSet getGroupsFor(int column) {
34     BitSet colbitset  = new BitSet();
35     colbitset.set(column);
36     return colbitset;
37   }
38
39   default List<BitSet> getGroups() {
40     return Arrays.asList();
41   }
42
43   default boolean hasTree() {
44     return false;
45   }
46
47   /**
48    * Newick representation of clustered matrix
49    * @return null unless hasTree is true
50    */
51   default String getNewick() {
52     return null;
53   }
54
55   default String getTreeMethod() {
56     return null;
57   }
58
59   default boolean hasCutHeight() {
60     return false;
61   }
62
63   default double getCutHeight() {
64     return 0;
65   }
66
67   void updateGroups(List<BitSet> colGroups);
68
69   void setColorForGroup(BitSet bs, Color color);
70
71   default Color getColourForGroup(BitSet bs) { return Color.white;}
72
73 }