Merge branch 'develop' into spike/JAL-4047/JAL-4048_columns_in_sequenceID
[jalview.git] / src / jalview / datamodel / SeqDistanceContactMatrix.java
index c3f3670..f8fd750 100644 (file)
@@ -5,13 +5,17 @@ import java.util.BitSet;
 import java.util.HashMap;
 import java.util.List;
 
+import jalview.util.MapList;
+import jalview.ws.datamodel.alphafold.MappableContactMatrix;
 /**
  * Dummy contact matrix based on sequence distance
  * 
  * @author jprocter
  *
  */
-public class SeqDistanceContactMatrix implements ContactMatrixI
+public class SeqDistanceContactMatrix
+        extends MappableContactMatrix<SeqDistanceContactMatrix>
+        implements ContactMatrixI
 {
   private static final String SEQUENCE_DISTANCE = "SEQUENCE_DISTANCE";
   private int width = 0;
@@ -81,20 +85,6 @@ public class SeqDistanceContactMatrix implements ContactMatrixI
   }
 
   @Override
-  public boolean hasReferenceSeq()
-  {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public SequenceI getReferenceSeq()
-  {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
   public String getAnnotDescr()
   {
     return "Sequence distance matrix";
@@ -123,40 +113,16 @@ public class SeqDistanceContactMatrix implements ContactMatrixI
   {
     return width;
   }
-  private List<BitSet> groups=null;
   @Override
-  public void updateGroups(List<BitSet> colGroups)
+  protected double getElementAt(int _column, int i)
   {
-    groups = colGroups;
+    return Math.abs(_column - i);
   }
   @Override
-  public boolean hasGroups()
+  protected SeqDistanceContactMatrix newMappableContactMatrix(
+          SequenceI newRefSeq, MapList newFromMapList)
   {
-    return groups!=null;
-  }
-  @Override
-  public List<BitSet> getGroups()
-  {
-    return groups;
-  }  
 
-  HashMap<BitSet,Color> colorMap = new HashMap<>();
-  @Override 
-  public Color getColourForGroup(BitSet bs)
-  {
-    if (bs==null) {
-      return Color.white;
-    }
-    Color groupCol=colorMap.get(bs);
-    if (groupCol==null)
-    {
-      return Color.white;
-    }
-    return groupCol;
-  }
-  @Override 
-  public void setColorForGroup(BitSet bs,Color color)
-  {
-    colorMap.put(bs,color);
+    return new SeqDistanceContactMatrix(width);
   }
 }