1 package jalview.datamodel;
4 import java.util.Arrays;
5 import java.util.BitSet;
8 public interface ContactMatrixI
11 ContactListI getContactList(int column);
17 String getAnnotDescr();
19 String getAnnotLabel();
22 * string indicating how the contactMatrix should be rendered - stored in
33 public GroupSetI getGroupSet();
35 /// proxy methods to simplify use of the interface
36 /// Mappable contact matrices can override these to perform mapping
38 default public boolean hasGroupSet()
40 return getGroupSet() != null;
43 default boolean hasGroups()
45 return hasGroupSet() && getGroupSet().hasGroups();
48 default BitSet getGroupsFor(int column)
52 BitSet colbitset = new BitSet();
53 colbitset.set(column);
56 return getGroupSet().getGroupsFor(column);
59 default List<BitSet> getGroups()
63 return Arrays.asList();
65 return getGroupSet().getGroups();
68 default boolean hasTree()
70 return hasGroupSet() ? getGroupSet().hasTree() : false;
74 * Newick representation of clustered matrix
76 * @return null unless hasTree is true
78 default String getNewick()
80 return hasGroupSet() ? getGroupSet().getNewick() : null;
83 default String getTreeMethod()
85 return hasGroupSet() ? getGroupSet().getTreeMethod() : null;
88 default boolean hasCutHeight()
90 return hasGroupSet() ? getGroupSet().hasCutHeight() : false;
93 default double getCutHeight()
95 return hasGroupSet() ? getGroupSet().getCutHeight() : 0;
98 default void updateGroups(List<BitSet> colGroups)
102 getGroupSet().updateGroups(colGroups);
106 default void setColorForGroup(BitSet bs, Color color)
110 getGroupSet().setColorForGroup(bs, color);
114 default Color getColourForGroup(BitSet bs)
118 return getGroupSet().getColourForGroup(bs);
126 void setGroupSet(GroupSet makeGroups);