JAL-2349 method to get display colour to represent a range of contacts
authorJim Procter <jprocter@issues.jalview.org>
Mon, 12 Dec 2016 21:06:05 +0000 (21:06 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 12 Dec 2016 21:06:05 +0000 (21:06 +0000)
src/jalview/datamodel/ContactListI.java
src/jalview/datamodel/ContactMatrixTest.java

index 4d5142a..0459732 100644 (file)
@@ -11,6 +11,14 @@ public interface ContactListI
 
   Color getColorForScore(int column);
 
+  /**
+   * return colour representing contacts from i through to j for this site
+   * 
+   * @param i
+   * @param j
+   * @return
+   */
+  Color getColorForRange(int i, int j);
   
   /**
    * get a value representing contact at column for this site
index b978d8f..96eb783 100644 (file)
@@ -25,6 +25,14 @@ public class ContactMatrixTest implements ContactMatrixI
         return jalview.util.ColorUtils.getGraduatedColour(Math.abs(column-p), 0, Color.white, width, Color.magenta);
       }
       @Override
+      public Color getColorForRange(int i, int j)
+      {
+        return jalview.util.ColorUtils.getGraduatedColour(
+                Math.abs(j + i - 2 * p) / 2, 0, Color.white, width,
+                Color.magenta);
+      }
+
+      @Override
       public int getColumnWidth()
       {
         return 1;