JAL-1551 spotless
[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   {
39     return false;
40   }
41
42   default BitSet getGroupsFor(int column)
43   {
44     BitSet colbitset = new BitSet();
45     colbitset.set(column);
46     return colbitset;
47   }
48
49   default List<BitSet> getGroups()
50   {
51     return Arrays.asList();
52   }
53
54   default boolean hasTree()
55   {
56     return false;
57   }
58
59   /**
60    * Newick representation of clustered matrix
61    * 
62    * @return null unless hasTree is true
63    */
64   default String getNewick()
65   {
66     return null;
67   }
68
69   default String getTreeMethod()
70   {
71     return null;
72   }
73
74   default boolean hasCutHeight()
75   {
76     return false;
77   }
78
79   default double getCutHeight()
80   {
81     return 0;
82   }
83
84   void updateGroups(List<BitSet> colGroups);
85
86   void setColorForGroup(BitSet bs, Color color);
87
88   default Color getColourForGroup(BitSet bs)
89   {
90     return Color.white;
91   };
92 }