X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FContactMatrixI.java;h=3510ed135f9809b4dd8c5f2d060fffb2c6926f3a;hb=173c541c3bdef7cee4f72a76cc8e23e8902a8614;hp=2367414c32e9c8a0853bb20e29e4d4db422fa5b2;hpb=335e6b12c126bcb6825cd3f66422677db7cd91c7;p=jalview.git diff --git a/src/jalview/datamodel/ContactMatrixI.java b/src/jalview/datamodel/ContactMatrixI.java index 2367414..3510ed1 100644 --- a/src/jalview/datamodel/ContactMatrixI.java +++ b/src/jalview/datamodel/ContactMatrixI.java @@ -1,5 +1,10 @@ package jalview.datamodel; +import java.awt.Color; +import java.util.Arrays; +import java.util.BitSet; +import java.util.List; + public interface ContactMatrixI { @@ -18,12 +23,57 @@ 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() { + return false; + } + default BitSet getGroupsFor(int column) { + BitSet colbitset = new BitSet(); + colbitset.set(column); + return colbitset; + } + + default List 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 colGroups); + + void setColorForGroup(BitSet bs, Color color); + default Color getColourForGroup(BitSet bs) { return Color.white;}; }