JAL-1551 spotlessApply
[jalview.git] / src / jalview / datamodel / ContactMatrixI.java
index 4e2076d..1d7391b 100644 (file)
@@ -1,6 +1,9 @@
 package jalview.datamodel;
 
+import java.awt.Color;
+import java.util.Arrays;
 import java.util.BitSet;
+import java.util.List;
 
 public interface ContactMatrixI
 {
@@ -20,21 +23,70 @@ public interface ContactMatrixI
   String getAnnotLabel();
 
   /**
-   * string indicating how the contactMatrix should be rendered - stored in calcId
-   * @return 
+   * string indicating how the contactMatrix should be rendered - stored in
+   * calcId
+   * 
+   * @return
    */
   String getType();
 
   int getWidth();
+
   int getHeight();
-  
-  default boolean hasGroups() {
+
+  default boolean hasGroups()
+  {
     return false;
   }
-  default BitSet getGroupsFor(int column) {
-    BitSet colbitset  = new BitSet();
+
+  default BitSet getGroupsFor(int column)
+  {
+    BitSet colbitset = new BitSet();
     colbitset.set(column);
     return colbitset;
   }
 
+  default List<BitSet> getGroups()
+  {
+    return Arrays.asList();
+  }
+
+  default boolean hasTree()
+  {
+    return false;
+  }
+
+  /**
+   * Newick representation of clustered matrix
+   * 
+   * @return null unless hasTree is true
+   */
+  default String getNewick()
+  {
+    return null;
+  }
+
+  default String getTreeMethod()
+  {
+    return null;
+  }
+
+  default boolean hasCutHeight()
+  {
+    return false;
+  }
+
+  default double getCutHeight()
+  {
+    return 0;
+  }
+
+  void updateGroups(List<BitSet> colGroups);
+
+  void setColorForGroup(BitSet bs, Color color);
+
+  default Color getColourForGroup(BitSet bs)
+  {
+    return Color.white;
+  };
 }