JAL-2349 JAL-3855 ContactListI.getPosition() to recover original position passed...
[jalview.git] / src / jalview / datamodel / ContactMatrix.java
index fac1dee..2968ab9 100644 (file)
@@ -2,7 +2,6 @@ package jalview.datamodel;
 
 import jalview.ws.params.InvalidArgumentException;
 
-import java.awt.Color;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -74,13 +73,7 @@ public class ContactMatrix implements ContactMatrixI
     }
   }
 
-  Color minColor = Color.white, maxColor = Color.magenta;
 
-  Color shadeFor(float value)
-  {
-    return jalview.util.ColorUtils.getGraduatedColour(value, 0,
-            Color.white, max, Color.magenta);
-  }
   @Override
   public ContactListI getContactList(final int column)
   {
@@ -88,38 +81,15 @@ public class ContactMatrix implements ContactMatrixI
     {
       return null;
     }
-    return new ContactListI()
+
+    return new ContactListImpl(new ContactListProviderI()
     {
       int p = column;
 
       @Override
-      public Color getColorForScore(int column)
-      {
-
-        return shadeFor((float) getContactAt(column));
-      }
-
-      @Override
-      public Color getColorForRange(int i, int j)
-      {
-        double contc;
-        double v = 0;
-        for (int r=i;r<j;r++)
-        {
-          contc = getContactAt(r);
-          if (contc != contc)
-          {
-            v += contc;
-          }
-        }
-        // average for moment - probably more interested in maxIntProj though
-        return shadeFor(((float) v) / (j - i + 1));
-      }
-
-      @Override
-      public int getColumnWidth()
+      public int getPosition()
       {
-        return 1;
+        return p;
       }
 
       @Override
@@ -159,7 +129,32 @@ public class ContactMatrix implements ContactMatrixI
         }
         return cl.doubleValue();
       }
-    };
+    });
   }
 
+  @Override
+  public float getMin()
+  {
+    return min;
+  }
+
+  @Override
+  public float getMax()
+  {
+    return max;
+  }
+
+  @Override
+  public boolean hasReferenceSeq()
+  {
+    // TODO Auto-generated method stub
+    return false;
+  }
+
+  @Override
+  public SequenceI getReferenceSeq()
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
 }